Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tokenami/tokenami/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Tokenami includes common selectors likehover, focus, and active out of the box. However, you can define your own custom selectors to handle more complex styling scenarios like parent state, nested elements, and media query combinations.
Default Selectors
Tokenami provides these selectors by default:Configuring Custom Selectors
Add custom selectors in yourtokenami.config.ts file using the selectors key. Use the ampersand (&) to mark where the current element’s selector should be injected:
Nested Selectors
Selectors can be nested using arrays to combine media queries or other conditional logic:Usage Examples
Parent State
Style an element based on its parent’s state:Data Attributes
Style elements based on data attributes:Descendant Elements
Style descendant elements using underscores for spaces:Arbitrary selectors using
{&...} syntax can only style the current element and its descendants. They cannot target parents or siblings.Common Use Cases
Styling based on parent state
Styling based on parent state
Complex pseudo-selectors
Complex pseudo-selectors
Advanced state selectors
Advanced state selectors
Responsive hover with media query
Responsive hover with media query
Combining Selectors
You can combine custom selectors with breakpoints:Best Practices
Use semantic names that describe when the selector applies
Keep selector specificity low for easier overrides
Document complex selectors with comments in your config
Next Steps
Property Aliases
Create shorthand names for CSS properties
Arbitrary Selectors
Learn about one-off arbitrary selectors