Tokens
Tokens (or design tokens) are the values used throughout a user interface, like colors or spacing units.
Tokens are separated and queried by namespace, so to use them in utility tags, they need to be in the correct namespace. For example, bg-red-500 and text-red-500 both ingest the color-red-500 token.
When you're defining your own theme's tokens, you'll need to make sure they're in the appropriate namespaces. Below is a reference:
| Namespace | Used in tag prefixes | Type |
|---|---|---|
align | align | Enum.TextYAlignment |
aspect | aspect | number |
automatic-size | auto | Enum.AutomaticSize |
border | border | number |
breakpoint | none | number |
color | bg, text, border, shadow, fill, stroke, scrollbar-thumb | Color3 |
container | w, min-w, max-w, inline, min-inline, max-inline | number |
delay | delay | number |
duration | transition, duration | number |
ease | ease | Enum.EasingStyle, --direction: Enum.EasingDirection |
fill-direction | flex, grid, grid-flow | Enum.FillDirection |
flex-alignment | justify, content, place-content | Enum.UIFlexAlignment |
flex-mode | flex | Enum.UIFlexMode |
flex-wrap | flex | boolean |
font | font | string (asset ID) |
font-weight | font | Enum.FontWeight |
fraction | w, h, size | UDim2 |
grow | grow | Enum.UIFlexMode |
hidden | hidden | boolean |
horizontal-alignment | justify | Enum.HorizontalAlignment |
inset-shadow | none | subtokens: offset Vector2, blur and spread number, color Color3, transparency number |
item-alignment | items, place-items, self, place-self | Enum.ItemLineAlignment |
leading | leading | number |
max-cells | grid-cols, grid-rows | number |
object | bg, object | Enum.ScaleType |
opacity | opacity | number |
order | order | number |
overflow | overflow | boolean |
place-content-start, place-content-center, place-content-end | place-content | Enum.HorizontalAlignment |
pointer-events | pointer-events | boolean |
radius | all 15 rounded* prefixes | number |
rotate | rotate | number |
scale | scale | number |
shadow | shadow | boolean; subtokens: offset Vector2, blur and spread number, color Color3, transparency number |
shrink | shrink | Enum.UIFlexMode |
spacing | p, px, py, pt, pr, pb, pl, ps, pe, pbs, pbe, gap, gap-x, gap-y, w, h, size, min-w, min-h, max-w, max-h, inline, block, min-inline, min-block, max-inline, max-block, inset, inset-x, inset-y, top, left, inset-s, inset-bs, translate, translate-x, translate-y | number |
text | text | number, --line-height: number |
text-align | text | Enum.TextXAlignment |
text-shadow | none | subtokens: offset Vector2, blur number, color Color3, transparency number |
text-truncate | text, truncate | Enum.TextTruncate |
text-wrapped | text | boolean |
vertical-alignment | content | Enum.VerticalAlignment |
visible | visible | boolean |
whitespace | whitespace | boolean |
z | z | number |