Repository navigation
Add a CSS engine to experiments/css - #17
Open
natemoo-re wants to merge 9 commits into
Open
natemoo-re wants to merge 9 commits into
natemoo-re wants to merge 9 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
experiments/css
- Refactor compute/computeTree to options bags (max-params rule) - Replace throw new Error with IrDecodeError/PrepareError and assert - Remove unused helpers/imports/vars; prefer-const in bundle-wasm - Run bsh format across experiments/css - Restore missing integrity hash for @clack/ui in pnpm-lock.yaml
natemoo-re
force-pushed
the
experiments/css
branch
from
October 22, 2026 02:37
c803087 to
c3bf5b9
Compare
…stitution `light-dark(a, b)` no longer folds to its light branch at compile time. Both branches are validated and canonicalized as standalone colors, the call is preserved through the IR, and the runtime resolves it at computed-value time against the environment's color scheme: after var() substitution (a custom property may carry the call verbatim into the using declaration) and before descendants inherit the value. A malformed call — anything other than exactly two colors — is invalid at computed-value time and drops the declaration, like a failed var() resolution. Resolution is scoped to the color properties the compiler canonicalizes via a shared `is_color_property` predicate in css-core. The compiler's sheet-level path rejects malformed calls with the same "invalid color value" diagnostic the plain color path reports. Also fix var() substitution to always re-serialize through the token writer: custom-property values arrive verbatim, and the old early return leaked uncanonicalized numbers (`oklch(70% 0.2 40)` stayed `0.2` where the conformance corpus pins `.2`). Drop the unused `Stylesheet::layer_rank` method. Rebuild the embedded wasm artifact; extend the compiler and runtime tests and the smoke test with light-dark coverage under both schemes.
natemoo-re
force-pushed
the
experiments/css
branch
from
October 22, 2026 03:06
385ffa7 to
25aa0d8
Compare
5 of 12 tasks
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.
Adds the Bombshell CSS engine into
experiments/css/and adds@bomb.sh/css.Walk a
@bomb.sh/domtree, snapshot it, and get computed styles per node with real multi-stylesheet aggregation and inline styles.Rust workspace
JS package (
@bomb.sh/css)compile(css)→ disposableSheet(compiles + prepares; throwsCompileErrorwith.diagnosticswhen no IR; warnings-only compiles succeed).Sheetcarriesir,diagnostics, lazily decodedversion/rulesEngine— multi-sheet host:addSheet/removeSheet/clear,compute/computeTree,diagnostics, disposablecompute/computeTree/release,decodeIr(sheet|bytes),NO_PARENTsrc/wasm.js— the runtime embedded: brotli+Z85-encoded optimized module (219 KB → 96 KB source) that decodes andWebAssembly.compiles itself on import; regenerable viascripts/bundle-wasm.mjsloadCssComponent/loadCssComponentFromModulefor hosts shipping their own artifact; the embedded artifact decodes vianode:zlib(Node-like runtimes)