Color utilities read a key from theme.colors and write it to one Roblox property. Nothing
cascades. A class sets one property on one instance.
<frame className="bg-slate-800 rounded-lg border border-slate-700 shadow-lg"> <textlabel className="text-slate-100" Text="Ready" /></frame>import React from "@rbxts/react";
export function Swatches() { return ( <frame className="flex gap-3 justify-center items-center w-96 h-24 p-4 rounded-lg bg-slate-900"> <frame className="w-16 h-16 rounded-md bg-slate-700" /> <frame className="w-16 h-16 rounded-md bg-slate-800 border-2 border-sky-500" /> <frame className="w-16 h-16 rounded-full bg-emerald-500" /> <frame className="w-16 h-16 rounded-md bg-gradient-to-b from-sky-500 to-indigo-600" /> </frame> );}import { __VelaBoundary } from "@rbxts/vela-runtime";import React from "@rbxts/react";export function Swatches() { return <__VelaBoundary.Consume>{(<frame BackgroundColor3={Color3.fromRGB(15, 23, 43)} Size={UDim2.fromOffset(384, 96)} BorderSizePixel={0}><uilistlayout FillDirection={Enum.FillDirection.Horizontal} Padding={new UDim(0, 12)} HorizontalAlignment={Enum.HorizontalAlignment.Center} VerticalAlignment={Enum.VerticalAlignment.Center} SortOrder={Enum.SortOrder.LayoutOrder}/><uipadding PaddingTop={new UDim(0, 16)} PaddingRight={new UDim(0, 16)} PaddingBottom={new UDim(0, 16)} PaddingLeft={new UDim(0, 16)}/><uicorner CornerRadius={new UDim(0, 8)}/> <frame BackgroundColor3={Color3.fromRGB(49, 65, 88)} Size={UDim2.fromOffset(64, 64)} BorderSizePixel={0}><uicorner CornerRadius={new UDim(0, 6)}/></frame> <frame BackgroundColor3={Color3.fromRGB(29, 41, 61)} Size={UDim2.fromOffset(64, 64)} BorderSizePixel={0}><uicorner CornerRadius={new UDim(0, 6)}/><uistroke Thickness={2} Color={Color3.fromRGB(0, 166, 244)} Transparency={0}/></frame> <frame BackgroundColor3={Color3.fromRGB(0, 188, 125)} Size={UDim2.fromOffset(64, 64)} BorderSizePixel={0}><uicorner CornerRadius={new UDim(0.5, 0)}/></frame> <frame Size={UDim2.fromOffset(64, 64)} BackgroundColor3={Color3.fromRGB(255, 255, 255)} BorderSizePixel={0}><uicorner CornerRadius={new UDim(0, 6)}/><uigradient Color={new ColorSequence(Color3.fromRGB(0, 166, 244), Color3.fromRGB(79, 57, 246))} Rotation={90}/></frame> </frame>)}</__VelaBoundary.Consume>;}Open the Lowered tab to see where each class goes. bg-* lands on the frame. border-*,
rounded-* and the gradient each become a child instance.
The color families
| Family | Roblox property | Written on |
|---|---|---|
bg-* | BackgroundColor3 | the host instance |
text-* | TextColor3 | the host instance |
image-* | ImageColor3 | the host instance |
placeholder-* | PlaceholderColor3 | the host instance |
border-{color}, ring-{color}, outline-{color} | Color | the shared UIStroke child |
shadow-{color} | Color | a UIShadow child |
inset-shadow-{color}, text-shadow-{color} | Color | their own UIShadow child |
divide-{color} | BackgroundColor3 | the separator frames |
from-*, via-*, to-* | color keypoints | a UIGradient child |
border-{color} also sets the stroke’s Transparency to 0, so you don’t need a second class to
make it visible.
text-* also covers size, alignment and wrapping. See
Text and fonts for how Vela tells them apart.
Arbitrary hex colors
Any color family takes a bracketed hex: bg-[#3fa8c2] or bg-[#fff]. Only three- and six-digit
forms work. Anything else reports unsupported-arbitrary-value.
Use these sparingly. If a hex appears twice, give it a name in your theme.
Opacity modifiers
Add /N (an integer from 0 to 100) to set a color and its transparency in one class:
bg-blue-600/50setsBackgroundColor3andBackgroundTransparency = 0.5.text-slate-100/80shows the text at 80% opacity.border-slate-500/25fades the stroke, anddivide-white/10fades the separators.from-blue-600/50fades only that gradient stop.
placeholder-* is the exception. Roblox has no placeholder transparency, so /N there reports
unsupported-opacity-modifier.
transparent
transparent sets the family’s transparency to 1 and writes no color. bg-transparent emits
BackgroundTransparency = 1 and nothing else.
You rarely need bg-transparent. Preflight already
starts every classed element with a clear background. Use it when a variant paints the background
and the default should be clear, or when you set preflight: false.
Three keywords don’t work:
placeholder-transparentreportsunsupported-color-key.PlaceholderColor3has no transparency to set.currentandinheritreportunsupported-color-key. Roblox has no cascade, so aTextLabelcan’t take its color from a parent.from-transparent,via-transparentandto-transparentare dropped without a warning. A two-stop gradient then renders as a flat fill.
Shades and diagnostics
Write a palette name plus a shade (bg-blue-500), a bare palette name (bg-blue), or a semantic
key (bg-surface). A bare name uses the palette’s DEFAULT, which every built-in palette sets to
its 500.
A suffix counts as a shade only if it is one of the eleven shade numbers. Otherwise the whole payload
is one key: bg-my-color looks up my-color.
| Code | Fires when |
|---|---|
color-missing-shade | you wrote a bare palette name and that palette has no DEFAULT |
color-invalid-shade | you gave a literal a shade (bg-white-500), or asked for a shade the palette lacks |
unknown-theme-key | the name isn’t in theme.colors |
All three are warnings. The class is dropped and the build continues. See Theming to add your own colors.
Borders
border-* builds a UIStroke child. Roblox strokes do less than CSS borders.
<frame className="border-2 border-slate-600 border-miter" />- Thickness:
border(1),border-0,border-1,border-2andborder-4. Other numbers reportunsupported-border-value. For anything else, use a bracket:border-[3],border-[3px]. - Color:
border-{color}sets the color.border-transparenthides the stroke. - Corners:
border-round,border-bevelandborder-mitersetLineJoinMode. CSS has no equivalent.
These report unsupported-border-value instead of doing nothing:
- Styles like
border-dashedorborder-dotted. A stroke is always one solid line. - Single sides like
border-t-2orborder-x. A stroke outlines the whole element. For lines between children, usedivide-*. border-opacity-*. Use/Ninstead:border-slate-500/25.
Rings and outlines
ring (thickness 3) and outline (thickness 2) exist for Tailwind habits. Roblox allows one
reliable stroke per element, so border, ring and outline all write to the same UIStroke. The
last class wins. You can’t stack a ring on a border.
Radius
rounded-{key} sets CornerRadius on a UICorner child. The key must exist in theme.radius.
Numbers like rounded-8 report unknown-theme-key. Use a bracket for a one-off (rounded-[8px]),
or name the value in your theme:
theme: { extend: { radius: { card: "new UDim(0, 10)" } } }<frame className="rounded-card" />Shadows
shadow and its sizes build a UIShadow child. The sizes are fixed presets:
| Class | Blur radius | Y offset | Spread | Transparency |
|---|---|---|---|---|
shadow | 3 | 1 | 0 | 0.9 |
shadow-sm | 2 | 1 | 0 | 0.95 |
shadow-md | 6 | 4 | −1 | 0.9 |
shadow-lg | 15 | 10 | −3 | 0.9 |
shadow-xl | 25 | 20 | −5 | 0.9 |
shadow-2xl | 50 | 25 | −12 | 0.75 |
Add shadow-{color} to change the color and keep the preset’s transparency. shadow-none disables
the shadow.
<frame className="shadow-lg shadow-slate-950" />Inset and text shadows
inset-shadow-* draws a shadow inside the element. text-shadow-* draws one behind the text.
| Class | Mode | Blur radius | Y offset | Transparency |
|---|---|---|---|---|
inset-shadow-2xs | Inset | 0 | 1 | 0.95 |
inset-shadow-xs | Inset | 1 | 1 | 0.95 |
inset-shadow-sm | Inset | 4 | 2 | 0.95 |
text-shadow-2xs | Text | 0 | 1 | 0.85 |
text-shadow-xs | Text | 1 | 1 | 0.8 |
text-shadow-sm | Text | 2 | 2 | 0.8 |
text-shadow-md | Text | 4 | 2 | 0.75 |
text-shadow-lg | Text | 8 | 4 | 0.75 |
shadow-inner is the same as inset-shadow-sm. Each family has a -none form and a color form,
such as text-shadow-red-500/50. There is no inset-shadow-md. Vela reads it as a color and warns
unknown-theme-key.
Each family is its own UIShadow, so shadow-md inset-shadow-xs text-shadow-lg gives one element
all three.
Roblox hasn’t shipped these shadow modes to live games yet. The build won’t warn you.
Backdrop blur
backdrop-blur-* builds a UIBlur child. Roblox has three strengths, so the Tailwind sizes share
them:
| Class | Strength |
|---|---|
backdrop-blur, backdrop-blur-xs, backdrop-blur-sm | Light |
backdrop-blur-md, backdrop-blur-lg | Medium |
backdrop-blur-xl, backdrop-blur-2xl, backdrop-blur-3xl | Heavy |
backdrop-blur-none | Enabled = false |
Other sizes, including brackets, warn unsupported-backdrop-blur-value. Variants work:
backdrop-blur-sm hover:backdrop-blur-xl. The utilities reference
lists the type requirements.
Gradients
bg-gradient-to-{dir} (or bg-linear-to-{dir}) builds a UIGradient child. Add color stops with
from-*, via-* and to-*:
<frame className="bg-gradient-to-br from-indigo-500 via-purple-500 to-pink-500" />import React from "@rbxts/react";
export function Gradients() { return ( <frame className="flex gap-3 justify-center items-center w-96 h-24 p-4 rounded-lg bg-slate-900"> <frame className="w-24 h-16 rounded-md bg-gradient-to-r from-sky-500 to-indigo-600" /> <frame className="w-24 h-16 rounded-md bg-gradient-to-br from-indigo-500 via-purple-500 to-pink-500" /> <frame className="w-24 h-16 rounded-md bg-gradient-to-t from-emerald-500 to-teal-400" /> </frame> );}import { __VelaBoundary } from "@rbxts/vela-runtime";import React from "@rbxts/react";export function Gradients() { return <__VelaBoundary.Consume>{(<frame BackgroundColor3={Color3.fromRGB(15, 23, 43)} Size={UDim2.fromOffset(384, 96)} BorderSizePixel={0}><uilistlayout FillDirection={Enum.FillDirection.Horizontal} Padding={new UDim(0, 12)} HorizontalAlignment={Enum.HorizontalAlignment.Center} VerticalAlignment={Enum.VerticalAlignment.Center} SortOrder={Enum.SortOrder.LayoutOrder}/><uipadding PaddingTop={new UDim(0, 16)} PaddingRight={new UDim(0, 16)} PaddingBottom={new UDim(0, 16)} PaddingLeft={new UDim(0, 16)}/><uicorner CornerRadius={new UDim(0, 8)}/> <frame Size={UDim2.fromOffset(96, 64)} BackgroundColor3={Color3.fromRGB(255, 255, 255)} BorderSizePixel={0}><uicorner CornerRadius={new UDim(0, 6)}/><uigradient Color={new ColorSequence(Color3.fromRGB(0, 166, 244), Color3.fromRGB(79, 57, 246))}/></frame> <frame Size={UDim2.fromOffset(96, 64)} BackgroundColor3={Color3.fromRGB(255, 255, 255)} BorderSizePixel={0}><uicorner CornerRadius={new UDim(0, 6)}/><uigradient Color={new ColorSequence([ new ColorSequenceKeypoint(0, Color3.fromRGB(97, 95, 255)), new ColorSequenceKeypoint(0.5, Color3.fromRGB(173, 70, 255)), new ColorSequenceKeypoint(1, Color3.fromRGB(246, 51, 154)) ])} Rotation={45}/></frame> <frame Size={UDim2.fromOffset(96, 64)} BackgroundColor3={Color3.fromRGB(255, 255, 255)} BorderSizePixel={0}><uicorner CornerRadius={new UDim(0, 6)}/><uigradient Color={new ColorSequence(Color3.fromRGB(0, 188, 125), Color3.fromRGB(0, 213, 190))} Rotation={270}/></frame> </frame>)}</__VelaBoundary.Consume>;}| Class suffix | Direction | Rotation |
|---|---|---|
t | to top | 270 |
tr | to top right | 315 |
r | to right | 0 |
br | to bottom right | 45 |
b | to bottom | 90 |
bl | to bottom left | 135 |
l | to left | 180 |
tl | to top left | 225 |
Other directions report unsupported-gradient-direction.
Vela sets the background to white so the gradient colors show true. A bg-* on the same element is
lost. Use one or the other.
Element opacity
opacity-N fades the whole element. N is any integer from 0 to 100, so opacity-37 works.
opacity-40 emits a transparency of 0.6.
It fades everything the element draws, including its stroke, shadows and blur. It also fades every child under it, including children passed into your components.
To fade one part only, use /N instead. text-slate-100/80 fades the text and leaves the
background alone. The two multiply: opacity-50 bg-blue-600/50 lands at 0.75 transparency.
A transparency you set yourself is kept. <frame BackgroundTransparency={0.2} /> stays at 0.2
under a parent’s opacity-50. On the same element, the prop wins and Vela warns
explicit-prop-overrides-class.
Fading a group as one layer
Vela fades each child separately. Where siblings overlap, the overlap looks darker. Add isolate to
a frame to fade the group as one layer:
<frame className="isolate opacity-50 bg-red-500"> <frame className="bg-blue-500" /></frame>// → <canvasgroup BackgroundColor3={…} GroupTransparency={0.5}>…</canvasgroup>Vela builds the frame as a CanvasGroup. That has costs: it clips its children, it redraws when
any child changes, and a ref or IsA check sees a CanvasGroup.
isolate must be static. Under a variant or in a dynamic class it warns isolate-not-static. On
anything but a frame it warns isolate-needs-frame. Write a <canvasgroup> yourself there.
See also
- Theming: the color, radius and spacing scales these utilities read.
- Text and fonts: how
text-*tells color from size, alignment and wrapping. - Utilities reference: every family in full.
- Diagnostics: every code, and what triggers it.