Add CSS font-palette longhand and @font-palette-values at-rule#220
Open
jhaygood86 wants to merge 1 commit into
Open
Add CSS font-palette longhand and @font-palette-values at-rule#220jhaygood86 wants to merge 1 commit into
jhaygood86 wants to merge 1 commit into
Conversation
Implements the parser/object-model half of CSS Fonts Module Level 4 font palette selection (https://www.w3.org/TR/css-fonts-4/#font-palette-values): - font-palette longhand (inherited), validated as normal | light | dark | <dashed-ident>; the authored text is preserved verbatim. - @font-palette-values at-rule, a named DeclarationRule modelled on @Property, capturing font-family / base-palette / override-colors descriptors raw. palette-mix() is intentionally deferred: it depends on color-space grammar not yet available in ExCSS, so the font-palette grammar accepts only the keyword and dashed-ident forms for now.
jhaygood86
marked this pull request as ready for review
July 24, 2026 20:01
jhaygood86
marked this pull request as draft
July 24, 2026 20:35
jhaygood86
marked this pull request as ready for review
July 24, 2026 20:35
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.
Summary
Adds parsing for CSS
font-paletteand the@font-palette-valuesat-rule (CSS Fonts 4):font-palettelonghand (inherited), acceptingnormal | light | dark | <dashed-ident>.@font-palette-values --name { … }at-rule (FontPaletteValuesRule/ publicIFontPaletteValuesRule), modeled on the existing@propertyrule, capturing thefont-family,base-palette, andoverride-colorsdescriptors (stored raw).Adds the
FontPalette/BasePalette/OverrideColorsproperty names, theFontPaletteValuesrule name/type, factory registration, and aStylesheetComposer.CreateFontPaletteValuesdispatch.Scope note:
palette-mix()is intentionally not included — it depends on the CSS Color 4/5<color-interpolation-method>grammar (a separate PR); thefont-paletteconverter accepts only keyword/<dashed-ident>values here. It can be added as a follow-up once the color-4/5 grammar lands.Tests
FontPaletteTests— 15 cases: keyword/dashed-ident acceptance, invalid-value dropping, round-trips,@font-palette-valuesname + descriptor capture, light/dark base-palette, exposure via the interface, and among-other-rules. Full suite green across all target frameworks.Ported from PeachPDF, which vendors ExCSS.