v2.7.0
Minor Changes
-
#220
e9d04acThanks @tenphi! - Add the_fallback floor key and equalize selector specificity with:where().A standalone
_key in a style value map defines a map-wide fallback floor: its
value always applies and is never turned off by higher-priority states,
which simply layer over it via the cascade. This fixes the CSS
three-valued-logic hole where a negated@supports(...)/ container-query
default branch silently never applies (e.g.scroll-stateis supported but a
specificscroll-state(...)query is unknown), leaving no rule active._is
standalone-only — it cannot be combined with state logic (_ & hoveredis
ignored with a dev warning) — and it can coexist with the bare''default
(''is the negated default,_is the always-on floor).To make the additive cascade predictable, every stateful selector Tasty
generates (modifiers, pseudo-classes,:is()/:not()groups, and
@root/@parentcontext) is now wrapped in:where(...)so it carries zero
specificity. The only specificity anchors are the doubled component class
(.tXX.tXX) and sub-element[data-element]attributes; overlapping rules
resolve purely by source order, which Tasty now emits ascending by priority
(@starting-stylelast).Note: state selectors drop from e.g.
0,3,0to the class baseline0,2,0
specificity. This is intentional — the doubled class remains the floor — but may
affect overrides from external CSS that relied on state-selector specificity.
Patch Changes
-
#220
3c11119Thanks @tenphi! - Auto-correct and warn on misplaced or redundant default states in style maps.The bare default state (
'') is the lowest-priority state and must be the first
key in a state map. When it is authored after other states, Tasty now moves it
to the front and emits aMISPLACED_DEFAULT_STATEdev warning — previously it
silently overrode every state above it because aTRUEcondition is never
negated.Defining both a
_fallback floor and a bare''default with no other states
is redundant: the''default would always be superseded by the floor. Tasty
now keeps the_value, drops the''default, and emits a
REDUNDANT_DEFAULT_STATEdev warning. When other states exist,_and''
coexist (one is the always-on floor, the other the negated default).