Set black focus is a real challenge #1608
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey Kevin, You should be able to override the evergreen/src/buttons/src/Button.js Line 45 in 3c6184d Digging into this, I realized the types for the theme in v7 are a little out of date now that the In V7: const theme = mergeTheme(defaultTheme, {
components: {
Button: {
baseStyle: {
selectors: {
_focus: {
borderColor: 'black',
boxShadow: '0 0 0 1px black'
}
}
}
}
}
});
const App = () => {
return (
<ThemeProvider value={theme}>
<Button>Create</Button>
</ThemeProvider>
);
}; In V6: const theme = mergeTheme(defaultTheme, {
components: {
Button: {
baseStyle: {
_focus: {
borderColor: 'black',
boxShadow: '0 0 0 1px black'
}
}
}
}
});
const App = () => {
return (
<ThemeProvider value={theme}>
<Button>Create</Button>
</ThemeProvider>
);
}; The Finally, while I'm excited you're interested in using Evergreen for an educational platform, I will warn you there are accessibility issues with some components that haven't been tackled yet. We're always open to contributions from the community to help improve accessibility! |
Beta Was this translation helpful? Give feedback.
Hey Kevin,
You should be able to override the
borderColor
andboxShadow
for theButton
with a custom theme. The focus, hover, etc. styles need to be overridden using the mapped selector name (i.e._focus
- the internal logic of the component resolves this to the more complex selector)evergreen/src/buttons/src/Button.js
Line 45 in 3c6184d
Digging into this, I realized the types for the theme in v7 are a little out of date now that the
selectors
prop is used, but the same idea applies - just nested under aselectors
key.In V7: