The styling ladder
tw="..."for anything the Tailwind subset covers: layout, spacing, type scale, radii, shadows. Shortest and most reviewable, and models emit it natively.- sx props for what tw cannot express: partial sides, gradients, computed
values, theme tokens.
pad={{t: 64}},grad={[160, '#111', '#333']},size={47}. raw="..."last, and only for genuinely non-atomic CSS: nested selectors (& em {...}), pseudo-classes, filters, absolute-position offsets.- Explicit sx props win over tw on conflict; do not set both for the same property.
The tw subset
Desktop-first, mirroring sx: base = desktop,max-lg: = tablet, max-md: =
mobile. Spacing scale is n x 4px (p-6 = 24px). Arbitrary values work:
p-[96px], w-[50%], text-[15px], bg-[#0A2230], max-w-[960px].
- Palette names (
bg-blue-500): use a literal or a theme token. hover:and other state prefixes: state styling goes throughraw="&:hover {...}".- Mobile-first prefixes (
md:,lg:): the subset is desktop-first; usemax-lg:andmax-md:.
sx props
The full key list is on the API card. The rules that matter:Sizes and units
w h maxw minh gap size radius pad m: a bare number means px, or pass a unit
string with px, %, em, rem, vw, vh, or ch. Units are honored
(maxw="88vw" really is 88vw). w and h also take 'hug' and 'auto'.
Anything else, including calc(), clamp(), keywords, and two-value gap,
throws at build time. Put those in raw=.
pad and m also take [v, h], [t, r, b, l], a partial {t, r, b, l}
object, and '0 auto' strings.
Alignment
align and justify are validated against Elementor’s enums at build time:
justify:center,start,end,flex-start,flex-end,space-between,space-around,space-evenly,stretch. The shorthands'between','around','evenly'auto-map.align: the same minus thespace-*values, plusself-startandself-end. There is no baseline; useflex-end.dirtakes'row'or'column'('col'throws).
Color and background
colorandbgtake hex values, not gradient strings.gradtakes an array:grad={[135, '#0ff', '#f0f']}as angle, from, to. A CSS gradient string throws. Freeform gradients go inraw="background-image: ...;".bgImagetakes a URL or an attachment id;bgOptstakes{color, size: 'cover', position: 'center center', repeat: 'no-repeat', attachment}.
Typography
size weight font lh ls ta cover the type system. Bare-number lh (up to 4)
and ls are read as em, so ls={-1} collapses a headline to unreadable.
Explicit units are honored: lh="150%", ls="2px".
Responsive
tablet={{...}} and mobile={{...}} take the same sx keys as breakpoint
overrides:
raw: the escape hatch
raw="" takes CSS declarations (auto-terminated) and supports nested selectors
and pseudo-classes:
display: grid loses to Elementor’s atomic flex CSS
printed later in the body. Set display and grid props via sx (atomic), and
keep only the extras (auto-rows, dense, bleed) in raw.
Semantic class names: cls and gcls
cls="name"labels the element’s deduped shared class, so the Elementor Class Manager showscardinstead ofc-1x9fq2. Give any pattern used three or more times acls(lint:unnamed-shared-class).gcls="name"attaches an arbitrary extra class you style yourself (in raw or an html carrier).
Next
Components
What you can put these styles on.
API card
The complete sx key list on one page.