Skip to content

Phase 1: truthfulness foundation — themes layer extraction, bundle scope, browser floor accuracy - #34

Merged
jackgranatowski merged 3 commits into
mainfrom
chore/phase-1-truthfulness
May 20, 2026
Merged

Phase 1: truthfulness foundation — themes layer extraction, bundle scope, browser floor accuracy#34
jackgranatowski merged 3 commits into
mainfrom
chore/phase-1-truthfulness

Conversation

@kiro-agent

@kiro-agent kiro-agent Bot commented May 20, 2026

Copy link
Copy Markdown

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.md Resolution 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)

  • New core/themes.css under slashed.themes. Contains the @media (prefers-color-scheme: dark) rule for :root:not([data-theme]) and the [data-theme="light|dark"] selectors. Moved out of slashed.base so the cascade position now matches architecture.md — themes sits above components/utilities/states, so theme reassignments cannot be beaten by an equal-specificity rule from a lower layer.
  • Removed duplicate :root { color-scheme } from core/base.css. Single source of truth: html { color-scheme: var(--sf-color-scheme, light dark) } in core/reset.css.
  • Consolidated keyframes: @keyframes sf-spin and sf-shimmer moved from core/states.css to core/motion.css alongside the other 8 framework keyframes. states.css keeps a cross-file pointer comment for grepability.
  • Bundles updated: core/themes.css added to both slashed.essential.css and slashed.full.css between base.css and layout.css.

Code-level corrections (commit 2)

  • Print border: print.css:65 border: 1px solid #999var(--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.
  • Shadow glow: collapsed clamp(0, calc(0.4 * X * 5), 0.7)clamp(0, calc(X * 2), 0.7) in --sf-shadow-glow. Identical behaviour, readable intent.
  • Token rationale comments: added inline docs for --sf-border-width-hairline (DPR dependency) and --sf-radius-full (intentionally not scaled — pill is topological).
  • interpolate-size comment: 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)

  • README browser floor corrected to Chrome 123+ / Safari 17.5+ / Firefox 128+ with rationale (light-dark(), @property with inherits, oklch(from … sign(…) …)). Replaces the misleading 2022 floor that doesn't match the actual color system.
  • README Quick start: drops links to the three empty stub files (components.css, utilities.css, tokens.components.css) and calls them out explicitly as reserved placeholders. Adds core/themes.css to the link list and the bundle table.
  • optional/legacy.css header 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 includes core/themes.css and marks the empty stubs. The slashed.themes layer description documents its new home and cascade-position guarantees. Bundle file order updated.
  • docs/demo.html line 1037: --sf-prose-paragraph alias chain corrected from the wrong → --sf-space-m to 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 existing BUG-1/BUG-2 regression tests. Removed from the P0 roadmap. Appended a Phase 1 Resolution Log listing every finding closed by this branch.

What didn't change

  • No tokens were re-typed or re-valued (Phase 2 will adjust default tertiary/neutral lightness).
  • No selectors were renamed or removed.
  • No public CSS classes have new behaviour.
  • The empty stub files (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 in audits/comparative-audit-2026.md for the full table.

Verification

  • npm run lint:css — clean.
  • npm run build — both bundles rebuild; dist/slashed.{essential,full}.css now contain @layer slashed.themes exactly once each.
  • npm test — Playwright deps cannot install in this sandbox, but CI runs playwright install --with-deps chromium on 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

  • Phase 2 — Contrast discipline: lower default tertiary/neutral lightness for AA Normal, widen text-inverse clamp, increase visited-link hue shift.
  • Phase 3 — Print hygiene: scope * { background: transparent !important } away from semantic colour elements; add .print-color-exact opt-in.
  • Phase 4 — Named container queries.
  • Phase 5 — Motion API polish (--sf-transition-* rename, color-pulse keyframe to validate @property interpolation, .sr-onlyoverflow: clip).
  • Phase 6 — Demo coverage and regression tests for layer ordering, print color preservation, selector-inventory completeness.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added new animation keyframes for rotation and shimmer effects.
  • Bug Fixes

    • Updated shadow token calculation for improved rendering.
  • Documentation

    • Clarified browser support floor: Chrome 123+, Safari 17.5+, Firefox 128+.
    • Updated bundle contents and quick-start wiring documentation.
    • Refined architecture and theme layer documentation.
    • Enhanced spacing token information in demo.
    • Improved legacy stylesheet guidance on coverage scope.

Review Change Stack

kiro-agent and others added 3 commits May 20, 2026 23:13
… 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>
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR refactors the CSS cascade-layer architecture by extracting dark/light theme switching from core/base.css into a new dedicated core/themes.css layer, relocates animation keyframes from core/states.css to core/motion.css, updates token derivations and print styling, and synchronizes documentation, bundling, and audit records to reflect the new structure and a documented browser support floor.

Changes

Cascade-layer architecture refactor

Layer / File(s) Summary
Theme layer extraction
core/themes.css, core/base.css, bundle.config.json, README.md, docs/architecture.md
New core/themes.css layer defines color-scheme and --sf-is-dark via OS preference and data-theme attributes. Removes theme logic from core/base.css. Adds to both CSS bundles. Updates README quick start to load themes before layout and documents bundle contents. Expands architecture docs to cover new themes layer positioning and selector routing.
Animation layer reorganization
core/motion.css, core/states.css
Relocates @keyframes sf-spin and sf-shimmer from states to motion layer. Removes keyframe definitions from states and adds explanatory comment. Updates motion layer documentation to clarify that keyframes are inert until referenced by state classes.
Token derivations and styling
core/tokens.css, core/print.css, core/reset.css, docs/demo.html
Updates --sf-shadow-glow opacity calculation; refreshes documentation for --sf-border-width-hairline and --sf-radius-full tokens. Tokenizes core/print.css borders with design tokens. Documents @supports (interpolate-size) progressive enhancement. Updates docs/demo.html spacing alias chain for --sf-prose-paragraph.
Documentation, browser support, and audit
README.md, optional/legacy.css, audits/comparative-audit-2026.md
Sets explicit browser support floor (Chrome 123+, Safari 17.5+, Firefox 128+) and clarifies that optional/legacy.css fills property-level gaps only within that window. Rewrites legacy.css scope documentation. Marks audit findings F-08 and F-11 as resolved/stale, removes them from P0 roadmap, and adds Resolution Log documenting Phase 1 fixes and remaining open items.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#11: Both PRs modify core/states.css and core/motion.css keyframe definitions; main PR relocates sf-spin/sf-shimmer keyframes from states to motion, while PR #11 originally added them to states.
  • codeslash-dev/SLASHED#7: Both PRs directly handle dark/light theming logic in core/base.css and theme selector behavior; main PR extracts this into core/themes.css, refactoring what PR #7 originally established.
  • codeslash-dev/SLASHED#13: Both PRs modify core/tokens.css, specifically the --sf-shadow-glow token's opacity calculation and documentation comments.

Suggested reviewers

  • jackgranatowski
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the three main structural/documentation objectives of the changeset: extracting the themes layer, defining bundle scope, and correcting browser support documentation floor accuracy.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/phase-1-truthfulness

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e0b2bb7 and 8b2b923.

⛔ Files ignored due to path filters (2)
  • dist/slashed.essential.css is excluded by !**/dist/**
  • dist/slashed.full.css is excluded by !**/dist/**
📒 Files selected for processing (13)
  • README.md
  • audits/comparative-audit-2026.md
  • bundle.config.json
  • core/base.css
  • core/motion.css
  • core/print.css
  • core/reset.css
  • core/states.css
  • core/themes.css
  • core/tokens.css
  • docs/architecture.md
  • docs/demo.html
  • optional/legacy.css

Comment thread docs/demo.html
<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>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 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.css

Repository: 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 -20

Repository: 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.css

Repository: 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).

@jackgranatowski
jackgranatowski merged commit 940615f into main May 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants