chore: version packages - #86
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/glaze@1.3.0
Minor Changes
#85
ff20d49Thanks @tenphi! - AddcontrastLevel— a manual contrast level that turns the two-tierhigh-contrast model into a
0–100slider. Set it globally viaglaze.configure(), or per theme / per token / throughextend():Level
0reproduces the normallight/darkoutput and level100thelightContrast/darkContrastoutput, bit for bit. Levels in between areresolved at that level, not interpolated after the fact: Glaze interpolates the
three things that make high contrast differ — authored
[normal, highContrast]pairs, the tone-window widening (light
[10,100] → [0,100], dark[15,95] → [0,100]), and theAA → AAA/ APCA+15 Lcescalation — and feedsthose through the ordinary resolve. A contrast floor is therefore genuinely
solved at every level (
contrast: 'AA'at level 50 solves for 5.75), and thefloor is met at every level.
While a level is set there is no separate high-contrast tier:
lightContrast/darkContrastmirror their normal counterparts, and a global level turnshigh-contrast output off outright so no exporter emits the tier.
modes.highContrastgoes inert rather than fighting it — it reads as "emit aseparate high-contrast set when contrast is automatic" — so a build config that
leaves
highContrast: trueset keeps working, silently, when a user switchestheir preference from auto to manual.
css()keeps its four-string shape withthe high-contrast strings repeating the normal declarations, so existing
@media (prefers-contrast: more)wiring keeps working untouched. A level set onone theme of a palette leaves its siblings' high-contrast tier alone.
A color never swaps sides of its base mid-slider.
autoFlip's tie-break —when both directions meet the floor, take the one nearer the authored tone —
depends on the target, so along a ramp it would let a color leap across its
base. The side is now decided once from the nearer endpoint and preferred
throughout that half of the ramp: a color whose two ends agree never changes
side, and one whose ends genuinely disagree changes exactly once, at level 50.
Flipping is only re-ordered, never disabled, so a side that cannot physically
reach the target still falls back. This is exposed as a new
preferInitialoption on
findToneForContrast.Un-interpolable tone pairs (
[50, 'max'],[50, '+20'],['max', 'min'])switch at level 50 rather than blending across kinds.
Also exports
resolveContrastForLevel(spec, level, polarity?).A
contrastpair may no longer switch metric.[4.5, { apca: 75 }]nowthrows a validation error: a WCAG ratio and an APCA Lc are different scales, so
no target exists between them and the two variants are incomparable even without
a manual level. Pair values inside one metric instead —
{ wcag: [4.5, 7] }or{ apca: [60, 90] }. Previously such a pair resolved silently.Nothing else changes by default:
contrastLeveldefaults to'auto', which istoday's behavior exactly, and no existing type, signature, or output shape moved.
As a bonus, a manual resolve runs two passes instead of four.