Is token overriding ok or to be avoided? #30444
-
docs say to be cautious when overriding style tokens: https://react.fluentui.dev/?path=/docs/concepts-developer-theming--page#overriding-existing-tokens What do they mean? For example, if I want to make everything more rounder I is ok to override Border Radii tokens or is that gonna cause problems all over? |
Beta Was this translation helpful? Give feedback.
Answered by
ValentinaKozlova
Feb 5, 2024
Replies: 1 comment 2 replies
-
Do you want to override token or just to customize component according to your design? If it's just a customization then rewriting tokens it's not needed. To customize your component use import { makeStyles } from '@fluentui/react-components';
const useStyles = makeStyles({
customStyle: {
borderRadius: '20px'
},
}); const YourComponent = () => {
const styles = useStyles();
return (
<div className={styles.customStyle}>
{/* Markup */}
</div>
);
}; |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It shouldn't be a problem to change it. The thing is that these tokens might be used in places you don't expect and change of a token would cause style change in all the places. But I think it's ok to try to change it and if it works fine, why not?