Keys allow your styles to be themeable. By using the CSS custom properties' fallback values, you can easily instantiate,
bind, and override values of a style/component. Sentro allows this process to be streamlined, automated, and funner than
manually coding everything in.
Basic Usage
Assigning themeable properties and keys
Get your CSS styles.
Determine what properties you want to be themeable. Usually these are color-related properties, typography properties,
shape properties (like border-radius), etc.
Attach the sentro.key-create() function to the themeable properties. Think of it as opening that specific property as an entrypoint for user-modifiable values.
Name the key in the first parameter.
We suggest putting the component name (minus the prefix) before the property name you want to assign to it. (
i.e. button-fill, button-ink, card-padding, header-brand-size).
Assign a value in the second parameter.
Alternatively, if you're already using tokens, you can use them directly.
Using the keys to make other themes, and variations
Create a class to theme the base style.
Assign new values by using the sentro.key-bind() mixin.
Assign the class to the HTML element.
Using keys with a custom separator
When you want to use custom separators for your keys, the global separator can be changed using the $separator parameter. Please refer to this guide for more information.