Skip to content

fix: Bricks swatch coverage + lightweight CSS normalize - #191

Merged
jackgranatowski merged 8 commits into
mainfrom
claude/color-swatches-ui-variables-lrdQ2
Jun 2, 2026
Merged

fix: Bricks swatch coverage + lightweight CSS normalize#191
jackgranatowski merged 8 commits into
mainfrom
claude/color-swatches-ui-variables-lrdQ2

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Bricks variable-picker swatches

  • Add hex entries for all 11 --sf-color-{family}-light source tokens — the resolver read them as inputs but never wrote them to the hex map, leaving checkerboard swatches
  • Add --sf-color-{success,warning,error,info,danger}-strong tokens which were not generated at all
  • Add --sf-color-selection-text and --sf-color-mark-text (both inherit in CSS → approximate with dark-text constant)
  • Exclude --sf-color-scheme from get_color_variables() — it holds the string light dark, not a colour value, and leaked into the picker via the prefix-only filter

CSS reset → lightweight normalize (core/reset.css)

The previous reset used * { margin: 0; padding: 0 }, stripped list markers globally, forced display: block on all media, and changed form-element font inheritance site-wide. Any third-party UI (page builder chrome, plugins) that relied on UA defaults for properties it did not explicitly redeclare was silently broken — requiring element-specific patches rather than good architecture.

core/reset.css is now a true normalize: box-sizing: border-box, HTML baselines (text-size-adjust, color-scheme, scroll-padding-top, scrollbar-gutter, hanging-punctuation, interpolate-size), body min dimensions, and genuine browser bug fixes only (button text-transform: none, search display: block, table border-collapse, [hidden], dialog/popover, fieldset min-width, [inert]).

What moved to core/base.css

Elements SLASHED explicitly styles now carry their own margin/padding resets: body { margin: 0 }, h1–h6 { margin: 0 }, p { margin: 0 }. Form-element normalization (font: inherit, cursor: pointer, touch-action, textarea resize) and media display: block rules move here too — still in @layer slashed.base (beatable by any unlayered CSS), but no longer zeroing properties of elements we don't own.

svg { fill: currentcolor } removed from base.css

The global rule was redundant — .sf-icon already sets fill: currentcolor explicitly. Globally it silently broke stroke-based icon sets, multi-colour logos, and any third-party SVG that did not carry its own fill declaration.

Test plan

  • Bricks editor → colour picker → SLASHED variables: all --sf-color-{family}-light tokens show a filled swatch
  • --sf-color-{success,warning,error,info,danger}-strong show correct darker swatches
  • --sf-color-scheme no longer appears in the colour variables list
  • WP admin bar renders correctly (spacing, icons, dropdowns) with no element-specific CSS patch in the plugin
  • Stroke-based SVG icons render correctly (no unwanted fill applied)
  • Page layout unchanged — headings, paragraphs, body still have correct margins via base.css explicit declarations

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu


Generated by Claude Code

Summary by CodeRabbit

  • Refactor

    • Simplified and modularized the global reset/baseline layers for easier composition and maintainability.
  • Style

    • Normalized typography spacing and adjusted header/anchor scroll offsets for consistent positioning.
    • Standardized form controls for consistent appearance, touch behavior, and cursor handling.
    • Improved media, embedded content responsiveness and table sizing.
    • Prose blockquotes now render in italic.
  • Accessibility

    • Adjusted touch-target sizing for form controls.
  • Documentation

    • Updated token reference to reflect the header height change.

claude added 3 commits June 1, 2026 17:12
SLASHED's reset (@layer slashed.reset) zeroes UA defaults that the WP
admin bar relies on but doesn't explicitly redeclare in its own CSS.
Author layers beat the UA in the cascade, so the admin bar icons
(SVG display:block), spacing (margin/padding), box model, and button
font-family were all being affected by the reset.

Adds unlayered inline CSS (unlayered author > layered author in the
cascade) using `revert` on the impacted properties. `revert` defers each
property to the user/UA stylesheet value, making the SLASHED reset a
no-op inside #wpadminbar without touching the reset itself.

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
…ormalize

The old reset zeroed margin/padding on *, stripped list markers, forced
display:block on all media, and changed form-element font inheritance
globally. This created cascade conflicts with any third-party UI
(WP admin bar, builder chrome, plugins) that relied on UA defaults for
properties it did not explicitly redeclare -- requiring element-specific
patches rather than good architecture.

New approach:

core/reset.css — true normalize only
  Retains: box-sizing:border-box on *, html baselines (text-size-adjust,
  color-scheme, scroll-padding-top, scrollbar-gutter, hanging-punctuation,
  interpolate-size), body min-height/min-inline-size, and genuine bug
  fixes (button text-transform:none, search display:block, table
  border-collapse, [hidden], dialog/popover, fieldset min-width:0,
  [inert] cursor).
  Removes: * margin/padding zero, ul/ol list-style:none,
  img/svg display:block, iframe border:none, button/input font:inherit,
  touch-action, fieldset border/padding, legend padding.

core/base.css — absorbs the opinionated rules it needs
  body, h1-h6, p now carry explicit margin:0 (UA 8px body margin and
  heading/paragraph margin-block are removed where we own those
  elements). Form-element normalization (font:inherit, cursor:pointer,
  touch-action, textarea resize:vertical) moves here. Media
  display:block and iframe border:none move here with a comment
  explaining why they are base-layer rather than reset-layer concerns.

plugins/SLASHED-for-WP/class-core-enqueue.php
  Reverts the #wpadminbar element-specific patch -- no longer needed
  because the reset no longer touches the properties that caused the
  conflict. The right fix was the architecture, not the bandage.

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
The rule was redundant — .sf-icon already sets fill: currentcolor
explicitly (core/layout.css:271). Globally it caused silent breakage
for stroke-based icon sets, multi-colour logos, and third-party SVGs
(WP admin bar Dashicons, builder chrome icons) that did not declare
their own fill. Removing it keeps the same principle as the reset
refactor: don't assert global opinions; let components own their needs.

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jackgranatowski, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 48 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f8773913-c444-47e2-b1a5-5197932482e6

📥 Commits

Reviewing files that changed from the base of the PR and between b316aeb and d97119a.

📒 Files selected for processing (4)
  • core/base.css
  • core/reset.css
  • core/tokens.css
  • docs/tokens.md
📝 Walkthrough

Walkthrough

Lighten reset.css into a lightweight normalize; add explicit typography margins and form-control inheritance in base.css; make media elements block-level responsive; update prose blockquote/table sizing in macros; change header token from 8rem to 0px affecting scroll/sticky offsets.

Changes

CSS Normalization Restructuring

Layer / File(s) Summary
Reset baseline and targeted normalize
core/reset.css
Reset.css header and box-sizing baseline updated; universal * , *::before, *::after no longer resets margin/padding; broad element-reset replaced by targeted normalizations (button/search/summary/table/[hidden]/dialog/[popover]/fieldset).
Typography margins and cleanup
core/base.css
Add margin: 0 to body, h1h6, and p; update headings' and :target scroll-margin-top to use var(--sf-header-height, 0px); remove legacy font-style lines and prior width: 100% table override.
Media element display and sizing
core/base.css
Set img, picture, video, canvas to display:block with max-inline-size:100% and block-size:auto; set iframe, embed, object to block with responsive sizing and border:none; remove svg { fill: currentcolor }.
Form controls and touch-target adjustments
core/base.css, core/accessibility.css
button, input, select, textarea inherit font/color/spacing-related props; button { cursor: pointer }; apply touch-action: manipulation to interactive controls; restrict textarea to resize: vertical; coarse-pointer selectors updated to size checkboxes/radios.
Prose blockquote and table sizing
core/macros.css
.sf-prose blockquote set to font-style: italic; .sf-prose table adds width: 100% while keeping max-width: 100% and horizontal overflow handling.
Header token and docs update
core/tokens.css, docs/tokens.md
--sf-header-height changed from 8rem to 0px, affecting derived --sf-sticky-offset and the scroll-margin-top used by headings and :target.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 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 references both main changes: Bricks swatch coverage and CSS normalize updates, accurately summarizing the PR's dual objectives.
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 claude/color-swatches-ui-variables-lrdQ2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

🧹 Nitpick comments (1)
core/base.css (1)

154-159: ⚡ Quick win

Use logical properties for consistency.

Lines 148-152 use logical properties (max-inline-size, block-size) for img/picture/video/canvas, but these iframe/embed/object rules use physical properties (max-width, height). The rest of the file consistently uses logical properties (e.g., border-block-start at line 163, border-block-end at line 248).

♻️ Align with logical property usage
 iframe, embed, object {
   display:   block;
-  max-width: 100%;
-  height:    auto;
+  max-inline-size: 100%;
+  block-size:      auto;
   border:    none;
 }
🤖 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 `@core/base.css` around lines 154 - 159, The iframe/embed/object CSS rule uses
physical properties (max-width, height) while the rest of the file uses logical
properties; update the iframe, embed, object selector to use max-inline-size
instead of max-width and block-size instead of height (leave display: block and
border: none as-is) so the rule aligns with the logical-property convention used
elsewhere.
🤖 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 `@core/reset.css`:
- Around line 77-83: The rule targeting dialog and [popover] currently strips UA
visuals by setting background:none and border:none, which is an opinionated
reset rather than a lightweight normalize; either update the comment to state
this is an intentional, opinionated component reset (so keep dialog, [popover]
with padding:0, border:none, background:none and change the comment to mention
"opinionated reset" or "component reset"), or change the CSS to preserve visible
defaults for normalization (remove background:none and border:none or set them
to initial/transparent-preserving values) so dialog and [popover] remain
visible; locate the selector block for dialog and [popover] to apply the chosen
fix and adjust the comment accordingly.

---

Nitpick comments:
In `@core/base.css`:
- Around line 154-159: The iframe/embed/object CSS rule uses physical properties
(max-width, height) while the rest of the file uses logical properties; update
the iframe, embed, object selector to use max-inline-size instead of max-width
and block-size instead of height (leave display: block and border: none as-is)
so the rule aligns with the logical-property convention used elsewhere.
🪄 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: 0a4a4fcd-8083-4590-88ba-251bae43eaf0

📥 Commits

Reviewing files that changed from the base of the PR and between 8dbcc48 and 82a4655.

📒 Files selected for processing (2)
  • core/base.css
  • core/reset.css

Comment thread core/reset.css Outdated
claude added 2 commits June 1, 2026 19:05
address/cite/dfn/var { font-style: normal }
  Removes semantic italic from HTML elements whose UA italic is
  intentional — <cite> marks titles of works, <dfn> marks
  definitions, <var> marks code variables. Stripping it globally
  removes a visual semantic cue sighted users rely on (WCAG 1.3.3).

blockquote { font-style: italic }
  Global italic is a readability hazard for users with dyslexia and
  applied unconditionally to third-party plugin content and builder
  widgets. The rule moves to .sf-prose blockquote in macros.css where
  it is intentional. The border-start treatment remains global.

body { font-synthesis: none }
  When a font is loaded as Regular-only (common with custom web fonts)
  this silently renders <strong> and <em> identically to normal text,
  failing WCAG 1.4.1 / 1.3.1 for users who rely on bold/italic to
  distinguish emphasis. Removed; browsers will synthesise bold/italic
  when variants are absent, which is the safer universal default.

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
- reset.css: dialog/[popover] background: none → Canvas so bare dialogs
  adapt to color-scheme and forced-colors instead of being transparent
- reset.css + base.css: scroll-padding-top / scroll-margin-top fallbacks
  changed from 8rem to 0px — sites without a sticky header no longer get
  a 128px anchor offset out of the box
- tokens.css: --sf-header-height default 8rem → 0px for the same reason
- base.css: removed width:100% from global table rule — full-width is
  now scoped to .sf-prose table (macros.css) where it belongs

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu

@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 `@core/tokens.css`:
- Line 1151: Update the public docs and release notes to reflect the new default
of --sf-header-height: 0px by changing the documented default in docs/tokens.md
to 0px (and update related mentions of --sf-sticky-offset and
scroll-margin-top/scroll-padding-top fallbacks), add a clear breaking-change
entry in CHANGELOG.md and a migration note in docs/migration.md explaining that
sites with fixed/sticky headers must explicitly set --sf-header-height to their
header height (and provide a brief example and guidance), and flag this as a
potential major-version impact so maintainers can reassess bumping the version.
🪄 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: ba57178a-ec57-43c8-81cd-40f0726ba997

📥 Commits

Reviewing files that changed from the base of the PR and between 82a4655 and 62b7d3e.

📒 Files selected for processing (4)
  • core/base.css
  • core/macros.css
  • core/reset.css
  • core/tokens.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/reset.css

Comment thread core/tokens.css Outdated
Layout & a11y
---------------------------------------------------------- */
--sf-header-height: 8rem;
--sf-header-height: 0px;

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 | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for CHANGELOG, migration docs, or breaking change notices

echo "==> Searching for CHANGELOG or migration documentation"
fd -t f -i 'changelog|migrat|upgrade|breaking' --max-depth 3

echo ""
echo "==> Checking for header-height mentions in docs"
rg -i 'header-height' -g '*.md' -C2

Repository: codeslash-dev/SLASHED

Length of output: 886


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "==> Locate occurrences of --sf-header-height in repo"
rg -n --hidden --no-ignore-vcs --stats --fixed-strings "--sf-header-height" .

echo "==> Check what docs/tokens.md says around --sf-header-height"
rg -n --fixed-strings "--sf-header-height" docs/tokens.md -C3

echo "==> Look for breaking-change/migration references to sf-header-height in CHANGELOG and docs/migration"
for f in CHANGELOG.md docs/migration.md; do
  echo ""
  echo "---- $f (sf-header-height/header-height keywords) ----"
  rg -n -i -C2 "sf-header-height|header-height" "$f" || true
done

echo "==> Search CHANGELOG/migration for explicit token default value mentions"
for f in CHANGELOG.md docs/migration.md; do
  echo ""
  echo "---- $f (8rem vs 0px mentions) ----"
  rg -n -i -C1 "8rem|0px" "$f" || true
done

Repository: codeslash-dev/SLASHED

Length of output: 557


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "==> Occurrences of --sf-header-height in repo"
rg -n --hidden --no-ignore-vcs --fixed-strings -- --sf-header-height .

echo ""
echo "==> docs/tokens.md around --sf-header-height"
rg -n --fixed-strings -- --sf-header-height docs/tokens.md -C3

echo ""
echo "==> CHANGELOG.md and docs/migration.md for header-height / sf-header-height"
for f in CHANGELOG.md docs/migration.md; do
  echo ""
  echo "---- $f ----"
  rg -n -i -C2 -- "sf-header-height|header-height" "$f" || true
done

echo ""
echo "==> CHANGELOG.md and docs/migration.md for 8rem vs 0px mentions"
for f in CHANGELOG.md docs/migration.md; do
  echo ""
  echo "---- $f ----"
  rg -n -i -C1 -- "8rem|0px" "$f" || true
done

echo ""
echo "==> core/tokens.css around the modified token (near line 1151)"
sed -n '1140,1165p' core/tokens.css

Repository: codeslash-dev/SLASHED

Length of output: 25914


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "==> core/tokens.css around modified token"
sed -n '1120,1175p' core/tokens.css

echo ""
echo "==> docs/tokens.md around --sf-header-height entry"
sed -n '450,490p' docs/tokens.md

echo ""
echo "==> docs/migration.md and CHANGELOG.md for sf-header-height/header-height + 8rem/0px"
for f in CHANGELOG.md docs/migration.md; do
  echo "---- $f (keywords) ----"
  rg -n -i -C2 -- 'sf-header-height|header-height' "$f" || true
  echo "---- $f (8rem/0px mentions) ----"
  rg -n -i -C1 -- '8rem|0px' "$f" || true
done

echo ""
echo "==> docs/registry.json token entry (default/value references if any)"
rg -n --fixed-strings -- "--sf-header-height" docs/registry.json -C2

Repository: codeslash-dev/SLASHED

Length of output: 5572


Major breaking change: --sf-header-height default is now 0px (was 8rem)

  • core/tokens.css now sets --sf-header-height: 0px, which also changes --sf-sticky-offset and the scroll-margin-top/scroll-padding-top fallbacks for fixed/sticky headers and :target anchor behavior.
  • docs/tokens.md still documents --sf-header-height as 8rem, so the public token docs are out of sync with the actual default.
  • No migration/breaking-change notes found in CHANGELOG.md or docs/migration.md for sf-header-height/header-height or the 8rem0px default change.

Fix: Update docs/tokens.md to 0px and add explicit migration/changelog documentation telling users (fixed/sticky header sites) to set --sf-header-height to their header height; re-assess major version bump.

🤖 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 `@core/tokens.css` at line 1151, Update the public docs and release notes to
reflect the new default of --sf-header-height: 0px by changing the documented
default in docs/tokens.md to 0px (and update related mentions of
--sf-sticky-offset and scroll-margin-top/scroll-padding-top fallbacks), add a
clear breaking-change entry in CHANGELOG.md and a migration note in
docs/migration.md explaining that sites with fixed/sticky headers must
explicitly set --sf-header-height to their header height (and provide a brief
example and guidance), and flag this as a potential major-version impact so
maintainers can reassess bumping the version.

claude added 3 commits June 1, 2026 20:57
Remove the blanket `a { display: inline-block; min-size }` rule — forcing
inline-block on every anchor breaks flex/grid layouts and stretches inline
text links, which is worse than having no touch-target floor.
Navigational links already meet target size from their container.

Add input[type="checkbox"] and input[type="radio"] — these are the most
commonly under-sized touch targets and were previously missing. No display
change needed for replaced elements; min-block/inline-size expands the
hit area without affecting surrounding layout.

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
- base.css: align iframe/embed/object with the logical-property convention
  used throughout the file — max-width/height → max-inline-size/block-size
- docs/tokens.md: regenerate to reflect --sf-header-height default change
  (8rem → 0px), fixing the 'Verify generated docs' CI failure

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
0px caused anchor scroll targets to land behind sticky headers on the
majority of sites that use SLASHED with page builders. 5rem (80px) covers
most sticky nav heights without over-compensating on headerless pages.

Also removes the now-unnecessary stylelint-disable comments that were
needed for the zero-unit 0px fallback values.

https://claude.ai/code/session_01JLvpeyEzNZtgc7TVjVMhzu
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