Repository navigation
v3.12.0
Minor Changes
-
#424
098a1d3Thanks @tenphi! -@tenphi/tasty/babel-pluginnow supports Babel 8. The optional peers@babel/core,@babel/helper-plugin-utilsand@babel/typesaccept^7.24.0 || ^8.0.0, and Babel 7 keeps working as before. Under Babel 8, negative numbers intastyStatic()styles, such aszIndex: -1, no longer fail the build. The plugin's published type no longer imports Babel's types, so it type-checks against Babel 7's@types/babel__coreand Babel 8's own types alike. -
#417
0ea0167Thanks @tenphi! - An opacity suffix now compiles tocolor-mix()instead of relative color syntax.#purple.5emitscolor-mix(in oklab, var(--purple-color) 50%, transparent)where it used to emitoklch(from var(--purple-color) l c h / .5).color-mix()is Baseline widely available (Chrome 111, Firefox 113, Safari 16.2). Relative color syntax is Baseline 2024 (Chrome 125, Firefox 128, Safari 18) and isn't widely available yet, so a project targeting widely available features can now use the suffix. The same goes for a faded replace token holdingcolor-mix()orlight-dark(), and for thecolor()helper.#current.Nalready compiled this way, and a token defined as#currentand then faded no longer needs Safari 18.An opaque token fades to the same color as before. Two things change:
- Alpha composes. The mix is premultiplied, so a token that is already translucent is faded further. A token holding
rgb(255 0 0 / .8)faded to.5is now alpha.4; before, it was.5. A replace token holding a literal channel color (replaceTokens: { '#overlay': 'rgba(0, 0, 0, .8)' }) is still faded in place, so its alpha is still replaced. - A
$propalpha must hold a number.#purple.$fadeemitscalc(var(--fade) * 100%), because a mix percentage can't be a<number>.$fade: '.5'works;$fade: '50%'no longer does. This is the rule#current.$fadealready had.
parseColor()reads the token name and the opacity back from the new form. - Alpha composes. The mix is premultiplied, so a token that is already translucent is faded further. A token holding
-
#416
75a2fc5Thanks @tenphi! -mergeStyles()and theStylestype are now exported from@tenphi/tasty/zero. Node build code can merge per-component overrides into source styles, with the same rules astasty(Base, { styles }), without loading React.
Patch Changes
-
#416
75a2fc5Thanks @tenphi! - A custom property name written out as CSS keeps its case:padding: 'var(--myGap)'emitsvar(--myGap)instead ofvar(--mygap), which named a different property.$myGapalready kept its case. -
#416
75a2fc5Thanks @tenphi! -falsenow writes nothing inpadding,margin,inset,scrollMarginandscrollPadding(and their per-side styles), inwidth,height,blockSizeandinlineSize(and theirmin/maxstyles), and inoutlineOffset, as it already did in every other style. This holds whetherfalseis set directly or under a state. Before,padding: { '': false, hovered: '2x' }wrote the default gap outsidehovered,width: falsewrotewidth: auto; min-width: initial; max-width: initial, andoutlineOffset: falsewroteoutline-offset: false.truestill means the default value.outlineOffset: true, which names no offset, is now ignored too.fontStyle: falsestill meansnormal. -
#416
75a2fc5Thanks @tenphi! - CSS system colors (Canvas,CanvasText,Highlight,ButtonText,GrayText,LinkText, …) and named colors are now colors wherever a style takes one.- A color token can hold one.
'#sys-canvas': 'Canvas'emits--sys-canvas-color: Canvasin styles,globalStylesandconfigure({ tokens })alike. Before, it warnedunable to parse colorand emitted nothing. borderandoutlinekeep a keyword color instead of replacing it withvar(--border-color)/var(--outline-color):border: '1bw Highlight'emits1px solid highlight. The same goes for named colors (border: '1bw red'), forshadownext toinset('inset 0 0 1x red'dropped the color), and forscrollbarandfade.- A reference whose fallback is a single color is a color, in either spelling:
'#accent': 'var(--brand, GrayText)',border: '1bw ($brand, Highlight)'. - A replace token can alias a keyword color: with
replaceTokens: { '#forced': 'Highlight' },fill: '#forced'emitshighlightinstead of#forced, and#forced.5fades it. A replace token aliasingcurrentColortakes an opacity suffix too, composing as#current.Ndoes.
Keyword colors are emitted lowercase inside a style, so
fill: 'Canvas'now emitscanvas; CSS matches them case-insensitively. The deprecated system colors (Menu,Window,ButtonHighlight, …) are not recognized. - A color token can hold one.
-
#416
75a2fc5Thanks @tenphi! -transition: 'none'turns transitions off, alone or under a state.transition: { '': 'opacity 80ms', '@reduced-motion': 'none' }now emitstransition: noneunder@reduced-motion. Before,nonewas read as a property name and emittednone var(--none-transition, var(--transition)), which the browser dropped, so the default transition kept running.