
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see you're trying to override CSS styles in Sanity Studio v3, but targeting generated class names like .IkYbE won't work reliably. Let me explain the correct approach.
In Sanity Studio v3, the class name .IkYbE you're trying to override is a CSS module hash - a randomly generated class name that changes between builds. This means your override will break whenever the Studio updates or rebuilds.
The variableOverrides.css approach you mentioned is from Sanity Studio v2 and doesn't work the same way in v3. Studio v3 uses a completely different styling system.
Studio v3 uses Sanity UI under the hood, which provides stable, semantic attributes you can target. Here are your options:
data-ui Attributes (Recommended)Sanity UI components use data-ui attributes that are stable across builds. You can target these in a global CSS file:
/* styles.css or global.css */
[data-ui="Button"][data-kind="primary"] {
display: none !important;
}
/* Or target specific UI elements */
[data-ui="Card"][data-as="section"] {
background: red;
}Then import this CSS file in your sanity.config.ts:
import {defineConfig} from 'sanity'
import './styles.css' // Import your global styles
export default defineConfig({
// ... rest of config
})For color and design token changes, use the theme configuration with buildLegacyTheme:
import {buildLegacyTheme, defineConfig} from 'sanity'
const myTheme = buildLegacyTheme({
'--black': '#1a1a1a',
'--white': '#fff',
'--brand-primary': '#4285f4',
// ... other theme variables
})
export default defineConfig({
theme: myTheme,
// ... rest of config
})data-ui AttributesUse your browser's developer tools to inspect elements and look for data-ui attributes instead of class names. For example:
[data-ui="Button"][data-ui="TextInput"][data-ui="Card"][data-ui="Stack"]variableOverrides.css: The v2 pattern of using part:@sanity/base/theme/variables/override-style doesn't exist in v3Instead of:
.IkYbE { display: none !important; } /* ❌ Will break */Do this:
[data-ui="Button"][aria-label="Specific button"] {
display: none !important;
} /* ✅ Stable */The key is to use semantic attributes (data-ui, aria-*, role, etc.) rather than generated class names. If you share what specific element you're trying to hide, I can help you find the right selector!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store