What is Clarity's stance with regards to custom styling? #66
-
Hi! Great work on creating the Clarity Design System. I'm intrigued to possibly use the Clarity Design System, but I sense that the ability to customize the styling is quite limited. What is Clarity's stance with regards to custom styling? Is the long-term goal to be close to the VMWare brand or is there a more generic approach? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Just about everything in Clarity Core is tokenized, making it easier to create a custom theme for your use. We focus heavily on using css variables related to interactions, instead of referencing color names, so that updating a background color will update it everything. https://clarity.design/storybook/core/?path=/story/foundation-design-tokens--page Our dark mode stylesheet, for example, simply changes the values of some of the CSS variables: https://unpkg.com/@cds/[email protected]/styles/theme.dark.css The individual components themselves also expose css variables that you can tweak to meet your need. Our stance is that you may use the CSS variables however you wish, and limit targeting the elements themselves in your CSS selectors (which the Shadow DOM makes impossible to do in many cases anyway). Limiting customizations to the tokens means easier upgrades in the future. |
Beta Was this translation helpful? Give feedback.
Just about everything in Clarity Core is tokenized, making it easier to create a custom theme for your use. We focus heavily on using css variables related to interactions, instead of referencing color names, so that updating a background color will update it everything.
https://clarity.design/storybook/core/?path=/story/foundation-design-tokens--page
https://clarity.design/storybook/core/?path=/story/themes-getting-started--page
Our dark mode stylesheet, for example, simply changes the values of some of the CSS variables: https://unpkg.com/@cds/[email protected]/styles/theme.dark.css
The individual components themselves also expose css variables that you can tweak to meet your need. Our stance …