chore: version packages - #272
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@tenphi/tasty@3.3.0
Minor Changes
#271
5184052Thanks @tenphi! - Colors are emitted as authored, and the--name-color-{colorSpace}channelcompanions are gone.
Two things existed only to serve the opacity suffix back when it needed numeric
channels to write an alpha into:
#nametoken declared a second variable holding its channels decomposed —--brand-color-oklch: 0.75 0.16 55— plus a matching@propertyrule, and acolorstyle emitted--current-color-{space}beside--current-color.colorSpace, so#brand: '#ff8800'declared--brand-color: oklch(0.75 0.16 55).Opacity now uses relative color syntax —
oklch(from var(--brand-color) l c h / .5)— which has the browser read the channels off whatever the value resolvesto. Neither is load-bearing any more, so both are removed and a color passes
through untouched:
--brand-color: #ff8800.configure({ colorSpace })is deprecated — still accepted, no longer has anyeffect, warns in development, and will be removed in the next major.
No public API changes: nothing exported moves and class name hashes are
identical. What changes is the emitted CSS.
If you relied on
colorSpacefor uniform output, author the token in the spaceyou want — the value is no longer rewritten. See
Color space.
What it buys:
mainandcore, ~2.6 kB offstatic,zeroandbabel-plugin— the whole sRGB round-trip and the LRU cache that memoizedit are gone.
style property per
#nameentry in thetokensprop.@propertyregistration less per color token, on the runtime, SSR, RSC andzero-runtime paths.
PropertyTypeResolver.scanDeclarations, so everyinjection does less work.
Also fixes
parseColor()not recognizing a CSS named color that starts withr,h,l,o,v,c, ort—red,hotpink,lime,orange,violet,coralandtealwere rejected (and warned about) whereblueandgreenwere accepted, purely because of the first-character dispatch. Everynamed color resolves now.
Patch Changes
#271
5184052Thanks @tenphi! -#currentresolves through--current-colorinstead of thecurrentcolorkeyword, which lets a token defined as
#currentbe faded on Safari 16.4 ratherthan 18.
Relative color syntax takes a concrete origin from Safari 16.4, but
oklch(from currentcolor …)needs Safari 18. A token defined as#currentusedto emit the bare keyword, so fading it —
{ '#ink': '#current', fill: '#ink.5' }— produced exactly that unsupported form.
#currentnow emitsvar(--current-color), so the origin is a real color wherever acolorstylepublished one.
Three things make the swap invisible everywhere else:
--current-coloris registered withinitial-value: currentcolor. Aregistered
<color>property keeps the keyword as its computed value andresolves it against each element's own color, so an unpublished
#currentisindistinguishable from the keyword rather than falling back to
transparent.colorstyle now publishes--current-colorfor every color, not onlya named token. A literal
color: 'red'has to displace an ancestor's tokencolor, or a descendant's
#currentwould read the ancestor's.#current.Nkeepscurrentcolorinside itscolor-mix(). The mix composes, soa nested fade must read the already-faded color that reaches it —
#current.4with
#current.18under it still lands at.072. It has worked since Safari16.2 regardless.
Still uncovered, and unchanged from before: a token defined as
#currentandfaded where no
colorstyle published the variable — the origin is the keywordagain, so that one case needs Safari 18.
Verified against Safari 16.5.1, 17.3 and 18.4, and the whole chain is pinned by
computed-style tests in a real engine.
#271
5184052Thanks @tenphi! - Warn when a color function's channel arrives on the percentage scale without its%.okhsl()/okhst()and anycreateColorFunc()plugin read a unitless channelas the factor it looks like, so
okhsl(280 .8 .52)andokhsl(280 80% 52%)arethe same color. Dropping the
%therefore lands80in a 0-1 slot, where itclamps to full saturation and renders as white — a plausible-looking color
rather than an obvious mistake.
A unitless channel above 1 cannot be a factor, so it now warns once per function
in development, naming the offending values.
1itself is a legitimate factorand stays silent, and the emitted color is unchanged.
Found while checking whether the producer/writer scale mismatch fixed in
glaze#94 applied here. It does not —
createColorFuncalready takes factors and scales to percentages on output, andevery other converter boundary (
hslStringToRgb,oklchStringToRgb,okhstToSrgb'sfromTone(t * 100)) was verified correct — but the silentclamp on misscaled input was the same footgun.