css_ast: Build out substitution function architecture - #1308
Merged
keithamus merged 1 commit intoJul 25, 2026
Conversation
keithamus
enabled auto-merge (squash)
July 24, 2026 22:24
keithamus
force-pushed
the
css-ast-build-out-substitution-function-architecture
branch
from
July 25, 2026 08:53
c86afb2 to
65a5068
Compare
This PR has been months in the making. It builds out the architecture for all substitution functions, such as math functions (calc/max/etc), var(), env(), and if() functions and the likes. These functions are generic, over a type, so they can correctly resolve to types during parse time. Each "slot" (aka a specific value in a Style Value, such as a length or a keyword). They've been enabled for a few types, just to see how they'll interoperate, but subsequent PRs will enable for a lot more.
keithamus
force-pushed
the
css-ast-build-out-substitution-function-architecture
branch
from
July 25, 2026 09:13
65a5068 to
adfc225
Compare
✅ CI passed
|
keithamus
deleted the
css-ast-build-out-substitution-function-architecture
branch
July 25, 2026 09:25
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 25, 2026
## [0.0.28] - 2026-07-25 ### Other Changes - Chore(deps): update dependencies (patch) (#1300) ([#1300](#1300)) ### Css_ast - csskit_derives: Add peek(skip) attribute (#1266) ([#1266](#1266)) - Regenerate css_ast/src/values from csswg drafts (#1267) ([#1267](#1267)) - css_parse/csskit_derives: Add semantic_eq(skip) to derive(SemanticEq) (#1272) ([#1272](#1272)) - css_ast: Implement various shape functions for clip-path, etc (#1275) ([#1275](#1275)) - css_ast: Use blocks for Container & Style at rules (#1276) ([#1276](#1276)) - css_ast: Add more -moz-meter-* pseudo elements/classes (#1277) ([#1277](#1277)) - css_ast: Refactor and improve `@supports` parsing (#1278) ([#1278](#1278)) - css_ast: Implement fill & stroke (#1279) ([#1279](#1279)) - css_ast: Implement webkit-text-stroek (#1280) ([#1280](#1280)) - css_ast Implement grid functions, track, line, etc (#1281) ([#1281](#1281)) - css_ast/css_parse: Implement ToNormalisedValue trait (#1284) ([#1284](#1284)) - Regenerate css_ast/src/values from csswg drafts (#1285) ([#1285](#1285)) - Regenerate css_ast/src/values from csswg drafts (#1294) ([#1294](#1294)) - csskit_derives: Allow multiple fields to delegate metadata (#1295) ([#1295](#1295)) - css_parse: Reimplement computed value declaration peeking/parsing in DeclarationValue (#1298) ([#1298](#1298)) - css_parse: Refactor BumpBox into generic Arena allocating Box. (#1304) ([#1304](#1304)) - css_parse: Implement an Arena allocated Vec. (#1306) ([#1306](#1306)) - css_ast: Build out substitution function architecture (#1308) ([#1308](#1308)) - css_ast: Use Value/CalcableValue in most manual types (#1309) ([#1309](#1309)) ### Css_feature_data - Regenerate css_ast/src/values from csswg drafts (#1299) ([#1299](#1299)) ### Css_lexer - css_lexer/csskit: Implement LineIndex, precomputing line offsets (#1264) ([#1264](#1264)) - css_lexer: Use a boxed slice in LineIndex, dropping Bumpalo's Vec. (#1305) ([#1305](#1305)) - css_lexer: Implement fearless_simd paths for scanning (#1307) ([#1307](#1307)) ### Css_parse - fuzz: new parser findings 2026-07-13 (#1288) ([#1288](#1288)) - css_parse: Drop CursorSource trait (#1296) ([#1296](#1296)) - css_parse: Drop PreludeList, DeclarationRuleList (#1297) ([#1297](#1297)) ### Csskit - chore(deps): update dependencies (patch) (#1268) ([#1268](#1268)) ### Csskit_derives - csskit_derives: Ensure atom checks properly peek (#1282) ([#1282](#1282)) ### Csskit_spec_generator - csskit_spec_generator: Ensure property atoms includes the extra properties (#1283) ([#1283](#1283)) ### Csskit_vscode - chore(deps): update dependency @types/node to v24.13.2 (#1269) ([#1269](#1269)) - chore(deps): update dependency @types/vscode to v1.125.0 (#1270) ([#1270](#1270)) - chore(deps): update dependency typescript to v7 (#1273) ([#1273](#1273)) - chore(deps): update dependencies (patch) (#1286) ([#1286](#1286)) - chore(deps): update dependency oxlint to v1.69.0 (#1303) ([#1303](#1303)) [forcebuild]
Merged
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 25, 2026
## [0.0.28] - 2026-07-25 ### Other Changes - Chore(deps): update dependencies (patch) (#1300) ([#1300](#1300)) ### Css_ast - csskit_derives: Add peek(skip) attribute (#1266) ([#1266](#1266)) - Regenerate css_ast/src/values from csswg drafts (#1267) ([#1267](#1267)) - css_parse/csskit_derives: Add semantic_eq(skip) to derive(SemanticEq) (#1272) ([#1272](#1272)) - css_ast: Implement various shape functions for clip-path, etc (#1275) ([#1275](#1275)) - css_ast: Use blocks for Container & Style at rules (#1276) ([#1276](#1276)) - css_ast: Add more -moz-meter-* pseudo elements/classes (#1277) ([#1277](#1277)) - css_ast: Refactor and improve `@supports` parsing (#1278) ([#1278](#1278)) - css_ast: Implement fill & stroke (#1279) ([#1279](#1279)) - css_ast: Implement webkit-text-stroek (#1280) ([#1280](#1280)) - css_ast Implement grid functions, track, line, etc (#1281) ([#1281](#1281)) - css_ast/css_parse: Implement ToNormalisedValue trait (#1284) ([#1284](#1284)) - Regenerate css_ast/src/values from csswg drafts (#1285) ([#1285](#1285)) - Regenerate css_ast/src/values from csswg drafts (#1294) ([#1294](#1294)) - csskit_derives: Allow multiple fields to delegate metadata (#1295) ([#1295](#1295)) - css_parse: Reimplement computed value declaration peeking/parsing in DeclarationValue (#1298) ([#1298](#1298)) - css_parse: Refactor BumpBox into generic Arena allocating Box. (#1304) ([#1304](#1304)) - css_parse: Implement an Arena allocated Vec. (#1306) ([#1306](#1306)) - css_ast: Build out substitution function architecture (#1308) ([#1308](#1308)) - css_ast: Use Value/CalcableValue in most manual types (#1309) ([#1309](#1309)) ### Css_feature_data - Regenerate css_ast/src/values from csswg drafts (#1299) ([#1299](#1299)) ### Css_lexer - css_lexer/csskit: Implement LineIndex, precomputing line offsets (#1264) ([#1264](#1264)) - css_lexer: Use a boxed slice in LineIndex, dropping Bumpalo's Vec. (#1305) ([#1305](#1305)) - css_lexer: Implement fearless_simd paths for scanning (#1307) ([#1307](#1307)) ### Css_parse - fuzz: new parser findings 2026-07-13 (#1288) ([#1288](#1288)) - css_parse: Drop CursorSource trait (#1296) ([#1296](#1296)) - css_parse: Drop PreludeList, DeclarationRuleList (#1297) ([#1297](#1297)) ### Csskit - chore(deps): update dependencies (patch) (#1268) ([#1268](#1268)) ### Csskit_derives - csskit_derives: Ensure atom checks properly peek (#1282) ([#1282](#1282)) ### Csskit_spec_generator - csskit_spec_generator: Ensure property atoms includes the extra properties (#1283) ([#1283](#1283)) ### Csskit_vscode - chore(deps): update dependency @types/node to v24.13.2 (#1269) ([#1269](#1269)) - chore(deps): update dependency @types/vscode to v1.125.0 (#1270) ([#1270](#1270)) - chore(deps): update dependency typescript to v7 (#1273) ([#1273](#1273)) - chore(deps): update dependencies (patch) (#1286) ([#1286](#1286)) - chore(deps): update dependency oxlint to v1.69.0 (#1303) ([#1303](#1303))
keithamus
added a commit
that referenced
this pull request
Jul 25, 2026
## [0.0.28] - 2026-07-25 ### Other Changes - Chore(deps): update dependencies (patch) (#1300) ([#1300](#1300)) ### Css_ast - csskit_derives: Add peek(skip) attribute (#1266) ([#1266](#1266)) - Regenerate css_ast/src/values from csswg drafts (#1267) ([#1267](#1267)) - css_parse/csskit_derives: Add semantic_eq(skip) to derive(SemanticEq) (#1272) ([#1272](#1272)) - css_ast: Implement various shape functions for clip-path, etc (#1275) ([#1275](#1275)) - css_ast: Use blocks for Container & Style at rules (#1276) ([#1276](#1276)) - css_ast: Add more -moz-meter-* pseudo elements/classes (#1277) ([#1277](#1277)) - css_ast: Refactor and improve `@supports` parsing (#1278) ([#1278](#1278)) - css_ast: Implement fill & stroke (#1279) ([#1279](#1279)) - css_ast: Implement webkit-text-stroek (#1280) ([#1280](#1280)) - css_ast Implement grid functions, track, line, etc (#1281) ([#1281](#1281)) - css_ast/css_parse: Implement ToNormalisedValue trait (#1284) ([#1284](#1284)) - Regenerate css_ast/src/values from csswg drafts (#1285) ([#1285](#1285)) - Regenerate css_ast/src/values from csswg drafts (#1294) ([#1294](#1294)) - csskit_derives: Allow multiple fields to delegate metadata (#1295) ([#1295](#1295)) - css_parse: Reimplement computed value declaration peeking/parsing in DeclarationValue (#1298) ([#1298](#1298)) - css_parse: Refactor BumpBox into generic Arena allocating Box. (#1304) ([#1304](#1304)) - css_parse: Implement an Arena allocated Vec. (#1306) ([#1306](#1306)) - css_ast: Build out substitution function architecture (#1308) ([#1308](#1308)) - css_ast: Use Value/CalcableValue in most manual types (#1309) ([#1309](#1309)) ### Css_feature_data - Regenerate css_ast/src/values from csswg drafts (#1299) ([#1299](#1299)) ### Css_lexer - css_lexer/csskit: Implement LineIndex, precomputing line offsets (#1264) ([#1264](#1264)) - css_lexer: Use a boxed slice in LineIndex, dropping Bumpalo's Vec. (#1305) ([#1305](#1305)) - css_lexer: Implement fearless_simd paths for scanning (#1307) ([#1307](#1307)) ### Css_parse - fuzz: new parser findings 2026-07-13 (#1288) ([#1288](#1288)) - css_parse: Drop CursorSource trait (#1296) ([#1296](#1296)) - css_parse: Drop PreludeList, DeclarationRuleList (#1297) ([#1297](#1297)) ### Csskit - chore(deps): update dependencies (patch) (#1268) ([#1268](#1268)) ### Csskit_derives - csskit_derives: Ensure atom checks properly peek (#1282) ([#1282](#1282)) ### Csskit_spec_generator - csskit_spec_generator: Ensure property atoms includes the extra properties (#1283) ([#1283](#1283)) ### Csskit_vscode - chore(deps): update dependency @types/node to v24.13.2 (#1269) ([#1269](#1269)) - chore(deps): update dependency @types/vscode to v1.125.0 (#1270) ([#1270](#1270)) - chore(deps): update dependency typescript to v7 (#1273) ([#1273](#1273)) - chore(deps): update dependencies (patch) (#1286) ([#1286](#1286)) - chore(deps): update dependency oxlint to v1.69.0 (#1303) ([#1303](#1303))
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 has been months in the making. It builds out the architecture for all substitution functions, such as math functions (calc/max/etc), var(), env(), and if() functions and the likes.
These functions are generic, over a type, so they can correctly resolve to types during parse time. Each "slot" (aka a specific value in a Style Value, such as a length or a keyword).
They've been enabled for a few types, just to see how they'll interoperate, but subsequent PRs will enable for a lot more.