Repository navigation
CHANGES:
Breaking changes
Tw.Var.ref_onlyand its type'a Tw.Var.ref_onlyare removed. Nothing
created such a variable; one that a utility reads with a fallback and
another sets is aVar.channel(#919).Build.conflict_orderis removed, andRule.outputsloses?order_tbl:
Rule.ordered_outputspairs each rule with the order of the utility that
built it, andBuild.selector_props_pairsreads those pairs (#920).Tw.Utility.base_of_strings,Tw.Spacing.to_length,
Tw.Spacing.margin_to_length,Tw.Spacing.margin_to_length_neg,
Tw.Utility.deduplicate,Tw.Property.sort_by_order,
Tw.Scheme.is_static_token,Tw.Scheme.is_hex_color,Tw.Color.round_n
andTw.Color.Tailwindare removed: nothing called them.Tw.Utility.base_of_classtakes the class
base_of_stringsassembled from its parts (#922, #970).Tw.Color.opacity_var_bare,Tw.Color.relative_color_supports,
Tw.Color.relative_alpha,Tw.Color.channel_style,Tw.Color.palette_hex,
Tw.Color.bracket_var_ref,Tw.Color.of_string_exn,
Tw.Color.theme_order_with_shade,Tw.Parse.fraction_percent,
Tw.Prose.to_css_rules,Tw.Prose.css_variables,
Tw.Spacing.named_spacing_binding,Tw.Theme.spacing_n_var,
Tw.Typography.font_sans_var,Tw.Typography.font_serif_var,
Tw.Typography.font_mono_var,Tw.Utility.base_to_style,
Tw.Var.property_infoandTw.Var.property_rule_of_metadataare no longer
exported: only their own module used them.Tw.Color.of_stringand
Tw.Parse.fraction_pctremain for callers ofof_string_exnand
fraction_percent(#923).Tw.Variant_parse.is_aria_shorthandis removed: every namedaria-
variant now reads the same way, andTw.Variant_parse.aria_attributegives
the attribute a spelling matches.Tw.Style.Group_ariaandPeer_ariahold
the spelling as written, brackets included, andTw.Style.Ariais the named
form (#946).
Utilities
- A negated bracket no typed reader takes compiles to
calc(<value> * -1)
with the value after any hint, as Tailwind writes it, where tw refused the
class:-z-[foo:2]isz-index: calc(2 * -1)and-indent-[foo]is
text-indent: calc(foo * -1). This holds for-z-,-order-,-indent-,
-outline-offset-,-underline-offset-,-hue-rotate-and
-backdrop-hue-rotate-(#950). mask-linear-[...]andmask-conic-[...], negated or not, refuse a bracket
that cannot stand in a declaration or opens with an empty hint, as Tailwind
does:-mask-conic-[}]raised out ofto_cssandmask-linear-[a;b]
compiled (#951).-col-[...],-col-start-[...],-col-end-[...],-row-[...],
-row-start-[...]and-row-end-[...]compile tocalc(<value> * -1)in
their longhand, as Tailwind writes them, where tw refused every negated
bracket on a grid line (#953).-bg-conic-[...]compiles asbg-conic-[...]does, unnegated, as Tailwind
writes it, and-bg-linear-[...]negates a value after anangle:hint.
-bg-linear-[...]refuses a bracket Tailwind infers no angle from, such as
var(--x),calc(45deg)or0(#954).space-x-[...]andspace-y-[...]take avar()and, negated, any length
orvar(), as Tailwind does:-space-x-[3px]writes
calc(calc(3px * -1) * var(--tw-space-x-reverse))where tw refused the
class (#952).- A zero
space-xorspace-ystep,space-y-0,-space-x-0or a bracket
such asspace-y-[0px], writes0for both margins, as Tailwind does,
where tw wrote acalc()that a token-stream--tw-space-*-reversecould
turn into a non-zero margin (#996). - A bracket opening with a data-type hint the family does not know writes only
the value after the hint, as Tailwind does:transition-[foo:color]sets
transition-property: color, notfoo:color. This holds fortransition-,
bg-linear-,bg-radial-,bg-conic-,scale-z-,contain-, the
mask-linear-,mask-conic-,mask-radial-andmask-radial-at-families
and thebrightness-,contrast-,grayscale-,invert-,saturate-,
sepia-andbackdrop-opacity-filters and theirbackdrop-forms;
contain-[...]writes any other value as written rather than as avar()
(#942). - A
shadow-,inset-shadow-ordrop-shadow-bracket no shadow reader
takes routes its colour through the colour channel the way Tailwind picks
it:shadow-[foo:red]writesvar(--tw-shadow-color,red), a layer of
lengths alone getscurrentcolorthat way,inset-shadow-[...]puts
insetbefore each layer anddrop-shadow-[...]writes onedrop-shadow()
per layer (#943). - A
!-prefixed utility that only the project's@thememakes valid, such as
!bg-brand, sorts with its family rather than after every other utility
(#920). - A bare opacity above 100, such as
opacity-110, compiles toopacity:1.1
as Tailwind writes it, where tw refused it, and the opacity utilities sort
by class name the way Tailwind's do,opacity-12.5beforeopacity-12.25
(#939). - A
--theme()reference with an alpha, such as
bg-[--theme(--color-red-500/25%)], compiles to thecolor-mix()of the
token at that alpha Tailwind writes, where tw refused it.theme()and
--theme()also read avar()alpha and a space after the slash (#940). col-[…],col-start-[…],col-end-[…],row-[…],row-start-[…]and
row-end-[…]write a bracket the grid-line grammar does not read, such as
col-[10px]orrow-end-[url(x.png)_center], into their longhand as
Tailwind does, where tw refused the class (#956).- The grid placement utilities name a bracket holding math as it was written:
col-[calc(1+2)]printed the selector.col-\[calc\(1_\+_2\)\], which no
markup carries (#957). mask-[…]reads only the math functions Tailwind knows as a position, so
mask-[abs(1px)]is amask-imageas it is in Tailwind (#958).font-[…],list-[…]andwill-change-[…]write a bracket their grammar
does not read, such aslist-[10px]orwill-change-[url(x.png)_center],
into their longhand as Tailwind does, where tw refused the class.
font-[…]chooses betweenfont-familyandfont-weightthe way Tailwind
does, sofont-[10px]andfont-[calc(1+2)]are weights and
font-[url(x.png)_center]is a family (#959).decoration-[…]writes a bracket that Tailwind does not read as a length or a
percentage intotext-decoration-color, and one holding math into
text-decoration-thickness, as Tailwind does:decoration-[foo],
decoration-[--c]anddecoration-[url(x.png)_center]were refused, and
decoration-[2]wrote an empty rule. A thickness takes no opacity modifier,
as in Tailwind (#960).text-shadow-[…]writes a bracket that Tailwind does not read as a colour
intotext-shadowas Tailwind does, opacity modifier included:
text-shadow-[foo],text-shadow-[10px]and
text-shadow-[shadow:notashadow]were refused. A data-type hint other than
color:makes the bracket a shadow, sotext-shadow-[bogus:0_0_2px_red]
reads as one (#961).- A bracket that opens with a
var()and goes on past it, such as
p-[var(--a)_1px]orfont-[var(--a),foo], is written as it stands, as
Tailwind does. tw read it as one custom property and wrote
padding: var(--var\(--a\)_1px);bg-[…],mask-[…]and
decoration-[…]also send it to their last resort, since Tailwind infers no
type from a value opening withvar()(#962). text-shadow-[…]picks the colour of a shadow no reader takes the way
Tailwind does and routes it through--tw-text-shadow-color, so
text-shadow-[0_1px_notacolour]andtext-shadow-[foo:red]compile where
tw refused them (#963).- A margin, gap, scroll-margin, sizing or
leadingscale of 2^53 or more,
such asm-9007199254740993, is refused, where it wrapped round to another
class (#902). - A negated zero transform such as
-translate-x-0,-rotate-0,-scale-x-0
or-skew-x-0keeps its sign in the selector, as Tailwind writes it, where
tw wrote.translate-x-0and the rule missed the element (#980). blur-nonewith no--blur-nonetoken registers the filter chain's
@propertyrules and initialises them in the properties layer, as Tailwind
andbackdrop-blur-nonedo. tw wrote neither (#981).backdrop-blur-<name>reads a project--backdrop-blur-<name>token, then
--blur-<name>, as Tailwind does, sobackdrop-blur-softunder
--blur-softcompiles where tw refused it (#982).backdrop-blur-<size>reads a project--backdrop-blur-<size>token for a
built-in size too, where tw bound--blur-<size>and ignored it (#985).translate-0.5and the bare form's other fractional steps compile, as
translate-x-0.5did, where tw refused them as unknown (#986).translate-0andtranslate-z-0write0px, andtranslate-1and
translate-z-1writevar(--spacing), as Tailwind andtranslate-x-*do,
where tw wrotecalc(var(--spacing) * n)(#983).font-[inherit]wrotefont-family: "inherit", a font named "inherit"; it
now writesfont-family: inherit, as Tailwind does. The same holds for
initial,unset,revertandrevert-layer(#988).rounded-fulland its side and corner forms wrote3.40282e38px; they now
writecalc(infinity * 1px), as Tailwind does.tw --minifystill writes
3.40282e38px, as Tailwind's minified CSS does (#989).content-["\201C"]wrote"\\201C", shown as the text\201C; it now
writes"\201C", shown as the quotation mark, as Tailwind does. Any CSS
escape in a quotedcontent-[...]bracket is kept the same way (#990).
Project stylesheets
- An entrypoint saved with CR LF line ends keeps its
@applybodies,
@source inlinelists and@themeblocks, which compiled to nothing
(#916). - On Windows, an
@sourceglob matches the files under its root and
@source nottakes its paths out, where both matched nothing (#916). - An
@utilitysorts by the earliest of its properties in Tailwind's
property order and skips a custom or unknown one, as Tailwind does. One
that wrote such a property first sorted after every other utility, and one
that wrotecolorbeforedisplaysorted with the colours (#938). - In inline mode, the default for
-s, a custom property an@utilitysets
is kept, as Tailwind keeps it, where it was resolved away:--xwent from
.foo{--x:1;color:red}and.bar{--y:1}disappeared (#941). - An
@source inlinebrace range ending near the largest integer stops,
where it counted on for ever (#902).
Command line
tw --diff --html PAGEexits 0 when the page renders the same under both
sheets, unless a listed difference is on a property that paints nothing,
such ascursoror a transition's timing (#918).- On Windows,
tw --diffandtw --tailwindrun the Tailwind CLI, which
failed for want of/dev/null(#995).
Variants
- An
aria-[...]ordata-[...]variant naming an attribute no selector can
hold, such asaria-[0.5ch]ordata-[a\b], is refused, where it was
accepted and emitted nothing or, underin-andnot-, raised (#925). not-data-*andnot-nth-*read their inner variant asdata-*and
nth-*do:not-nth-of-type-3is:not(:nth-of-type(3)), and
not-data-[0.5ch]is refused, where both raised. A barearia-*or
data-*name and agroup-not-[...]orpeer-not-[...]bracket that no
selector can hold are refused too, where they raised, and a bare
group-data-*name keeps its underscores,[data-a_b]for
group-data-a_b(#937).- A named
aria-variant matches any name as Tailwind does,aria-fooas
[aria-foo="true"]and undergroup-,peer-,in-,has-andnot-
too, and a bracketed one is always an attribute expression, so
aria-[busy]keeps its class name and matches presence. A namedaria-or
data-variant keeps its_:aria-_,group-data-_andhas-data-a_b
compile instead of being refused, emitting[data-]or raising, and a name
no attribute can hold, such asdata-a.b, is refused (#946). - An arbitrary selector variant with no
&takes any selector, as Tailwind
writes it into:is():[p_~_span]:underlineis:is(p~span)and
[.a,.b]:underlineis:is(.a,.b), undergroup-[...]andpeer-[...]
too, where every combinator and list was refused.[*]is:is(*), where
it compounded into a selector browsers drop (#947). - An
in-[...]bracket is read as a selector:in-[.a_.b]is
:where(:is(.a .b)), where it matched an ancestor of classa_.b, and
in-[[data-x]]is:where([data-x]), where it named an element. A bracket
with a leading combinator, such asin-[>p], is refused. Anot-[...]
bracket holding a complex selector or a list goes through:is(), as
:not(:is(p~span))(#948). - A
group-not-[...]orpeer-not-[...]bracket under an outernot-,
has-orin-keeps its class name and its negation:
not-group-not-[.foo]is:not(:is(:where(.group):not(.foo) *)), where
it was namednot-group-not-not-[.foo]and matched.foo(#949). - Two values of an
aria-,data-ornth-*variant sort by the value, as
Tailwind sorts them, whatever is stacked under either:
aria-checked:**:animate-nonenow precedesaria-disabled:animate-spin(#973). - Two
group-orpeer-variants on the same state sort by the name they
target, the unnamed one first, as Tailwind sorts them (#974). - A stack of two
data-values sorts by both, as Tailwind sorts it, where tw
keyed it by the inner value alone (#975).
OCaml API
Utility.unclaimedis the answer a handler'sof_classgives a class it
does not claim, shared by every handler in place of its own message (#921).Color.hex_to_oklch_cssandColor.to_oklch_cssraiseInvalid_argument
on a string that is not a hex colour instead of returning it unchanged
(#926).Tw.Parse.is_digittests for an ASCII digit (#936).Tw.noscriptis new. It applies styles under@media (scripting: none),
as thenoscript:class does (#991).