Phase 1: truthfulness foundation — themes layer extraction, bundle scope, browser floor accuracy - #34
Conversation
… keyframes - Move @media (prefers-color-scheme: dark) and [data-theme] rules from slashed.base into a new core/themes.css file under slashed.themes. Cascade position now matches architecture.md: themes sits above components/utilities/states, so theme reassignments cannot be beaten by an equal-specificity component or utility rule. - Drop the duplicate :root { color-scheme } declaration from base.css. The single source of truth is html { color-scheme } in reset.css. - Move @Keyframes sf-spin and sf-shimmer from states.css to motion.css alongside the other 8 framework keyframes. states.css now references them with a cross-file pointer comment. - Add core/themes.css to both bundles in bundle.config.json (between core/base.css and core/layout.css). Co-authored-by: Jack Granatowski <contact@codeslash.net>
- core/print.css: replace 'border: 1px solid #999' on pre/blockquote with 'var(--sf-border-width-1) solid var(--sf-color-border--strong)'. All print rules now respect the token contract. - core/tokens.css: collapse dead arithmetic in --sf-shadow-glow (clamp(0, calc(0.4 * X * 5), 0.7) -> clamp(0, calc(X * 2), 0.7)). Behaviour is identical; intent is now readable. - core/tokens.css: add inline rationale comments for --sf-border-width-hairline (DPR dependency: 0.5px renders as 1px on 1x DPR, true half-pixel on 2x+) and --sf-radius-full (intentionally not scaled by --sf-radius-scale -- a pill is topological, not relative; 9999px is the standard magic-number convention). - core/reset.css: rewrite the interpolate-size comment with accurate browser support (Chrome 129+, Safari 18+; Firefox behind a flag as of 2026-Q2) instead of the stale 'Chromium-only' claim. Co-authored-by: Jack Granatowski <contact@codeslash.net>
… state - README: correct the browser support floor to Chrome 123+, Safari 17.5+, Firefox 128+ with rationale (light-dark, @Property inherits, oklch sign() relative form). Update Quick start to wire only populated optional files (palette, legacy) and call out that components/ utilities/tokens.components are reserved empty placeholders, not in any bundle. Add core/themes.css to the link list and the bundle table. - optional/legacy.css: rewrite the file header to be honest about scope. legacy.css smooths non-color gaps within the @layer-supporting window (Safari 15.0-15.3 dvh, pre-15.4 :focus-visible, Safari scrollbar-gutter) but does NOT extend support below the modern color-system floor. - docs/architecture.md: add core/themes.css to the file structure table and document its cascade-position guarantees in the slashed.themes layer description. Mark the three optional stub files explicitly. Insert core/themes.css into the bundle file order. - docs/demo.html: correct the --sf-prose-paragraph alias chain (--sf-content-gap -> --sf-space-s) at line 1037. - audits/comparative-audit-2026.md: mark F-08 (link hover) and F-11 (shadow-2xl alpha cap) as stale -- both fixes predate the audit and are validated by existing regression tests. Remove them from the P0 roadmap. Append a Phase 1 resolution log section listing every finding closed by this branch. Co-authored-by: Jack Granatowski <contact@codeslash.net>
📝 WalkthroughWalkthroughThis PR refactors the CSS cascade-layer architecture by extracting dark/light theme switching from ChangesCascade-layer architecture refactor
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/demo.html`:
- Line 1037: Update the documentation chain to reflect the full alias path:
change the displayed chain from "--sf-prose-paragraph → --sf-content-gap →
--sf-space-s" to include the missing intermediate token so it reads
"--sf-prose-paragraph → --sf-space-content → --sf-content-gap → --sf-space-s"
(or instead add a short note linking to the token definitions for
"--sf-prose-paragraph", "--sf-space-content", "--sf-content-gap", and
"--sf-space-s" as defined in the token files).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 74c935fb-125b-4c53-a0cf-3f777ba738de
⛔ Files ignored due to path filters (2)
dist/slashed.essential.cssis excluded by!**/dist/**dist/slashed.full.cssis excluded by!**/dist/**
📒 Files selected for processing (13)
README.mdaudits/comparative-audit-2026.mdbundle.config.jsoncore/base.csscore/motion.csscore/print.csscore/reset.csscore/states.csscore/themes.csscore/tokens.cssdocs/architecture.mddocs/demo.htmloptional/legacy.css
| <code>--sf-component-pad → --sf-space-m</code> | ||
| <code>--sf-field-block → --sf-space-l</code> | ||
| <code>--sf-prose-paragraph → --sf-space-m</code> | ||
| <code>--sf-prose-paragraph → --sf-content-gap → --sf-space-s</code> |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify the --sf-prose-paragraph alias chain is accurately documented
# Expected: --sf-prose-paragraph should reference --sf-content-gap, which references --sf-space-s
echo "=== Checking --sf-prose-paragraph definition ==="
rg -n -A2 -B2 --type=css '\-\-sf-prose-paragraph\s*:' core/tokens.css
echo -e "\n=== Checking --sf-content-gap definition ==="
rg -n -A2 -B2 --type=css '\-\-sf-content-gap\s*:' core/tokens.css
echo -e "\n=== Checking --sf-space-s definition ==="
rg -n -A2 -B2 --type=css '\-\-sf-space-s\s*:' core/tokens.cssRepository: codeslash-dev/SLASHED
Length of output: 1289
🏁 Script executed:
# Search entire codebase for --sf-prose-paragraph definition
echo "=== Searching for --sf-prose-paragraph definition across all files ==="
rg -n '\-\-sf-prose-paragraph\s*:' --type=css
echo -e "\n=== Searching for any mention of --sf-prose-paragraph ==="
rg -n '\-\-sf-prose-paragraph' --type=css | head -20
echo -e "\n=== Checking if it appears in HTML/JS files ==="
rg -n '\-\-sf-prose-paragraph' --type=html --type=js | head -20Repository: codeslash-dev/SLASHED
Length of output: 1443
🏁 Script executed:
echo "=== Checking --sf-space-content definition ==="
rg -n '\-\-sf-space-content\s*:' --type=css -A1 -B1
echo -e "\n=== Full token definition context in tokens.layout.css ==="
sed -n '115,125p' core/tokens.layout.cssRepository: codeslash-dev/SLASHED
Length of output: 1141
Documentation contains an incomplete alias chain.
The documented chain --sf-prose-paragraph → --sf-content-gap → --sf-space-s is missing an intermediate alias. The actual token definitions show:
--sf-prose-paragraph → --sf-space-content → --sf-content-gap → --sf-space-s
Update the documentation to include the --sf-space-content alias, or reference the token definitions in core/tokens.layout.css (line 26) and core/tokens.css (line 709) if a shorter format is intended.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/demo.html` at line 1037, Update the documentation chain to reflect the
full alias path: change the displayed chain from "--sf-prose-paragraph →
--sf-content-gap → --sf-space-s" to include the missing intermediate token so it
reads "--sf-prose-paragraph → --sf-space-content → --sf-content-gap →
--sf-space-s" (or instead add a short note linking to the token definitions for
"--sf-prose-paragraph", "--sf-space-content", "--sf-content-gap", and
"--sf-space-s" as defined in the token files).
This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Phase 1 of the perfection roadmap from
audits/comparative-audit-2026.mdResolution Log. Foundation pass — no behavioural changes, no breaking changes. Aligns README, architecture, bundle, code, demo, and audit with each other so that every public claim matches the code.What changes
Structural (commit 1)
core/themes.cssunderslashed.themes. Contains the@media (prefers-color-scheme: dark)rule for:root:not([data-theme])and the[data-theme="light|dark"]selectors. Moved out ofslashed.baseso the cascade position now matchesarchitecture.md— themes sits above components/utilities/states, so theme reassignments cannot be beaten by an equal-specificity rule from a lower layer.:root { color-scheme }fromcore/base.css. Single source of truth:html { color-scheme: var(--sf-color-scheme, light dark) }incore/reset.css.@keyframes sf-spinandsf-shimmermoved fromcore/states.csstocore/motion.cssalongside the other 8 framework keyframes.states.csskeeps a cross-file pointer comment for grepability.core/themes.cssadded to bothslashed.essential.cssandslashed.full.cssbetweenbase.cssandlayout.css.Code-level corrections (commit 2)
print.css:65border: 1px solid #999→var(--sf-border-width-1) solid var(--sf-color-border--strong). Removes the only hardcoded literal that violated the project's "every value via var()" rule.clamp(0, calc(0.4 * X * 5), 0.7)→clamp(0, calc(X * 2), 0.7)in--sf-shadow-glow. Identical behaviour, readable intent.--sf-border-width-hairline(DPR dependency) and--sf-radius-full(intentionally not scaled — pill is topological).interpolate-sizecomment: rewritten with accurate browser support (Chrome 129+, Safari 18+, Firefox flag-only as of 2026-Q2) instead of the stale "Chromium-only" claim.Documentation truthfulness (commit 3)
light-dark(),@propertywithinherits,oklch(from … sign(…) …)). Replaces the misleading 2022 floor that doesn't match the actual color system.components.css,utilities.css,tokens.components.css) and calls them out explicitly as reserved placeholders. Addscore/themes.cssto the link list and the bundle table.optional/legacy.cssheader rewritten to be honest about scope. Clarifies legacy.css does NOT extend support below the modern color floor — it only smooths non-color gaps within the @layer-supporting window.architecture.md: file-structure table now includescore/themes.cssand marks the empty stubs. Theslashed.themeslayer description documents its new home and cascade-position guarantees. Bundle file order updated.docs/demo.htmlline 1037:--sf-prose-paragraphalias chain corrected from the wrong→ --sf-space-mto the actual→ --sf-content-gap → --sf-space-s.audits/comparative-audit-2026.md: F-08 (link hover) and F-11 (shadow-2xl alpha cap) marked stale — both fixes predate the audit and are covered by existingBUG-1/BUG-2regression tests. Removed from the P0 roadmap. Appended a Phase 1 Resolution Log listing every finding closed by this branch.What didn't change
optional/components.css,optional/utilities.css,optional/tokens.components.css) remain empty — explicitly out of scope per project decision.Findings closed
F-01, F-03, F-05, F-07, F-12, F-15, F-16, F-19, F-20, F-22 plus three Phase 1 self-discovered items (duplicate
color-scheme, dead arithmetic in shadow-glow, audit staleness for F-08/F-11). See the Resolution Log section inaudits/comparative-audit-2026.mdfor the full table.Verification
npm run lint:css— clean.npm run build— both bundles rebuild;dist/slashed.{essential,full}.cssnow contain@layer slashed.themesexactly once each.npm test— Playwright deps cannot install in this sandbox, but CI runsplaywright install --with-deps chromiumon Ubuntu and will execute the regression suite. The shadow-glow change is mathematically equivalent (0.4 × 5 = 2), so existing token tests pass unchanged.Next phases
* { background: transparent !important }away from semantic colour elements; add.print-color-exactopt-in.--sf-transition-*rename, color-pulse keyframe to validate@propertyinterpolation,.sr-only→overflow: clip).Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation