Skip to content

Extract viewport breakpoint utilities to opt-in file#28

Merged
codeslash-net merged 4 commits intomainfrom
claude/complete-variables-tokens-utilities-JiRPS
May 6, 2026
Merged

Extract viewport breakpoint utilities to opt-in file#28
codeslash-net merged 4 commits intomainfrom
claude/complete-variables-tokens-utilities-JiRPS

Conversation

@codeslash-net
Copy link
Copy Markdown
Owner

@codeslash-net codeslash-net commented May 6, 2026

Summary

Extracts the sm: / md: / lg: / xl: viewport-breakpoint utility classes from slashed-utilities.css into a new opt-in file slashed-utilities-viewport.css. After this release, slashed-full.css contains zero viewport-size @media rules — only feature and preference queries remain in the essential bundle.

Projects using container-query utilities (cq-sm: / cq-md: / cq-lg: / cq-xl:) and fluid tokens do not need to load the new file. Projects requiring custom breakpoints now only need to copy and modify slashed-utilities-viewport.css (four find-replace passes on em values) rather than touching the entire framework.

Also converts .alternate layout primitive from @media to @container queries, making it responsive to its own container width instead of the viewport.

Changes

  • New file: css/slashed-utilities-viewport.css (436 lines)

    • Contains all sm: / md: / lg: / xl: responsive utility classes
    • Appends into @layer slashed.utilities (layer order already established by slashed-full.css)
    • Includes customization instructions for breakpoint modification
  • Modified: css/slashed-utilities.css and css/slashed-full.css

    • Removed ~400 lines of viewport @media blocks
    • Updated documentation to clarify viewport utilities are opt-in
    • Container-query utilities (cq-*:) remain included
  • Modified: css/slashed-core.css

    • .alternate layout primitive: changed from @media (min-width: 48em) to @container (min-width: 48em)
    • Added container-type: inline-size to .alternate base rule
  • Updated: Version bumped to 0.6.6.0 across all files

  • Updated: CHANGELOG.md, docs/UTILITIES.md, docs/INSTALLATION.md, and other documentation

Checklist

  • slashed-full.css regenerated (bin/build-bundle.sh)
  • CHANGELOG.md entry added
  • ROADMAP.md updated
  • cheatsheet.html and docs updated

https://claude.ai/code/session_01HXBTBxk2YTCvs62tE3Qm28

Summary by CodeRabbit

New Features

  • Introduced an optional viewport utilities file with responsive breakpoints (sm, md, lg, xl) available for separate loading

Chores

  • Version bumped to 0.6.6.0 across all assets
  • Reorganized responsive utilities structure for modular file organization

Documentation

  • Updated installation and utilities guides to reflect new responsive utilities structure and optional file loading

claude added 2 commits May 6, 2026 10:12
…@container

- New css/slashed-utilities-viewport.css: sm:/md:/lg:/xl: viewport @media
  utility prefix classes extracted from slashed-utilities.css. Opt-in, not
  included in slashed-full.css. Load after slashed-full.css when needed.
  To customise breakpoints, copy this one file and find-replace the four
  em values — no other framework file needs touching.

- slashed-utilities.css: sm:/md:/lg:/xl: blocks removed (~400 lines).
  Pointer comment replaces them. cq-* container-query utilities and all
  feature/preference @media variants (dark:/light:/print:/motion-*) remain.
  Header comment updated to document the split.

- slashed-core.css: .alternate now uses @container (min-width: 48em) instead
  of @media, with container-type: inline-size added to .alternate itself.
  Consistent with every other layout primitive in the file. slashed-full.css
  now contains zero viewport-size @media rules.

- build-bundle.sh: mention slashed-utilities-viewport.css in the bundle header.
- cheatsheet.html: responsive section updated to document cq-* as primary path
  and sm:/md: as opt-in escape hatch via the new file.

https://claude.ai/code/session_01HXBTBxk2YTCvs62tE3Qm28
…ewport split

- docs/UTILITIES.md: rewrite responsive variants section — cq-* as preferred
  path, slashed-utilities-viewport.css as opt-in, updated breakpoint
  customisation instructions (one file, four find-replace passes).
- docs/INSTALLATION.md: add slashed-utilities-viewport.css to file structure
  table with correct size and description; update slashed-full.css byte count.
- cheatsheet.html: fix .hidden, .order-*, and other stale references that
  still described sm:/md: as part of the main bundle.

https://claude.ai/code/session_01HXBTBxk2YTCvs62tE3Qm28
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@codeslash-net has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 17 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 93f8cafc-b778-465a-a7ad-f53b9f971edf

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7a82a and 7e1f7f5.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • ROADMAP.md
  • css/slashed-full.css
  • css/tokens-default.css
  • docs/INSTALLATION.md
📝 Walkthrough

Walkthrough

This release extracts viewport breakpoint utilities into an opt-in stylesheet and migrates the .alternate layout primitive from viewport media queries to container queries. The bundle now excludes viewport-specific rules by default; viewport utilities are available separately via slashed-utilities-viewport.css. Version bumped to 0.6.6.0 across all files and documentation.

Changes

Responsive Utilities Restructuring

Layer / File(s) Summary
New Viewport Utilities Asset
css/slashed-utilities-viewport.css
New opt-in stylesheet introduces viewport breakpoint utilities (sm:/md:/lg:/xl:) across four breakpoints (sm, md, lg, xl) with media queries and comprehensive display, grid, spacing, alignment, and ordering utilities.
Core Layout Migration
css/slashed-core.css
.alternate layout updated from @media (min-width: 48em) to container-query approach: adds container-type: inline-size and wraps grid rules in @container (min-width: 48em).
Main Utilities Restructuring
css/slashed-utilities.css
Viewport breakpoint utilities removed; replaced with notice that they live in opt-in slashed-utilities-viewport.css. Container-query utilities (cq-*) retained as the preferred responsive path.
Bundle & Full CSS Updates
css/slashed-full.css, bin/build-bundle.sh
Full bundle header notes viewport utilities as opt-in; .alternate layout updated to container queries; build script header indicates viewport utilities excluded (opt-in).
Documentation & Release Notes
CHANGELOG.md, docs/INSTALLATION.md, docs/UTILITIES.md, cheatsheet.html, docs/README.md
Release notes document viewport extraction and opt-in loading. Installation docs enumerate new modular assets. Utilities guide updated with container-query and viewport usage. Cheatsheet adds ps-* spacing tokens, .hidden display utility, and updated responsive guidance. All files updated with v0.6.6.0.
Version Bumps
CLAUDE.md, CONTRIBUTING.md, ROADMAP.md, css/slashed-animations.css, css/slashed-components.css, css/slashed-experimental.css, css/slashed-utilities-visual.css, css/tokens-default.css, css/tokens-legacy.css
Version string updated from v0.6.5.0 to v0.6.6.0 in headers across all CSS files and supporting documentation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • codeslash-net/SLASHED#55: Directly addresses the same viewport-to-container-query migration, moving breakpoint rules and updating layout primitives to use @container.
  • codeslash-net/SLASHED#25: Related through shared responsive utilities and container-query/viewport breakpoint logic in slashed-utilities.css and slashed-full.css.

Poem

🐰 Hop, skip, and a viewport leap!
Containers now guard what breakpoints reap,
With queries stacked in just the right way,
Our layouts shine in 0.6.6.0's display!

🚥 Pre-merge checks | ✅ 8
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Extract viewport breakpoint utilities to opt-in file' directly and clearly describes the primary change: viewport breakpoint utilities are extracted from the main utilities file into a new separate, opt-in CSS file (slashed-utilities-viewport.css).
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.
Version Consistency ✅ Passed All 18 files containing version strings consistently declare 0.6.6.0. No stale versions found. package.json (private dev package) has no version field, which is appropriate.
Changelog Coverage ✅ Passed CHANGELOG.md updated with substantive v0.6.6.0 entry documenting viewport utilities extraction, bundle changes, and .alternate layout conversion with usage guidance.
Roadmap Planned Section Hygiene ✅ Passed The PR's implemented work (viewport utilities extraction and container-query migration) was not listed in any "Pending" sections. All 9 existing pending items remain unimplemented and unchanged.

✏️ 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/complete-variables-tokens-utilities-JiRPS

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
ROADMAP.md (1)

216-225: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Refresh breakpoint-scope wording in roadmap notes.

This section still scopes hardcoded sm/md/lg/xl breakpoints to slashed-utilities.css, but those viewport prefixes now reside in slashed-utilities-viewport.css.

🤖 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 `@ROADMAP.md` around lines 216 - 225, Update the roadmap note to reflect that
the hardcoded `sm/md/lg/xl` viewport prefixes are not in `slashed-utilities.css`
anymore but now live in `slashed-utilities-viewport.css`; change the sentence
that currently scopes those breakpoints to `slashed-utilities.css` so it instead
references `slashed-utilities-viewport.css`, keep the rest of the note about
`@custom-media` and the scope reduction intact, and ensure the scope-note line
referencing `slashed-core.css` and `@container` queries is left unchanged.
CLAUDE.md (1)

60-60: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Adjust breakpoint gotcha to the new file layout.

Line 60 still says the four breakpoints live only in slashed-utilities.css; it should now reference slashed-utilities-viewport.css for sm:/md:/lg:/xl: utilities.

🤖 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 `@CLAUDE.md` at line 60, Update the documentation sentence that currently
states the four breakpoints live only in slashed-utilities.css to reflect the
new layout: mention that the sm:/ md:/ lg:/ xl: breakpoint utilities now live in
slashed-utilities-viewport.css (while noting that layout primitives in
slashed-core.css using `@container` remain unaffected); replace the reference to
slashed-utilities.css with slashed-utilities-viewport.css and keep the same
breakpoint values (sm: 30em / md: 48em / lg: 64em / xl: 80em).
docs/INSTALLATION.md (1)

82-82: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix stale version in the pinning guidance example.

Line 82 still uses @0.6.5.0; it should match the current release shown above (@0.6.6.0) to avoid copy/paste drift.

🤖 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/INSTALLATION.md` at line 82, Update the stale version string in the
installation pinning example: replace the outdated token "@0.6.5.0" with the
current release "@0.6.6.0" in the INSTALLATION.md example so the copy/paste
guidance matches the release noted above.
CONTRIBUTING.md (1)

104-105: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update breakpoint-location gotcha to match the new viewport split.

Line 104 currently says breakpoints live only in slashed-utilities.css, but viewport breakpoint utilities now live in slashed-utilities-viewport.css. This can misdirect maintainers editing responsive utilities.

🤖 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 `@CONTRIBUTING.md` around lines 104 - 105, Update the "breakpoints are
hardcoded" note to reflect the new split: change the statement that viewport
breakpoint utilities live only in `slashed-utilities.css` to say viewport
breakpoint utilities now live in `slashed-utilities-viewport.css` (while
retaining that layout primitives in `slashed-core.css` use `@container` queries
and are unaffected); make sure to mention the specific breakpoint names
`sm/md/lg/xl` and their em values remain defined in the viewport utilities file
so maintainers know which file to edit.
🧹 Nitpick comments (2)
css/slashed-utilities-viewport.css (1)

37-436: ⚡ Quick win

Align breakpoint source-of-truth with repo guideline (or update the guideline in the same change).
This file hardcodes 30em/48em/64em/80em, but the current utilities guideline still states those values live only in slashed-utilities.css. Please resolve that contract mismatch to prevent future drift.

As per coding guidelines: “**/*utilities*.css: Breakpoints are hardcoded only in slashed-utilities.css; the four values … live in that file only.”

🤖 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 `@css/slashed-utilities-viewport.css` around lines 37 - 436, This file
duplicates the breakpoint literals in the media queries (`@media` (min-width:
30em), (min-width: 48em), (min-width: 64em), (min-width: 80em)), violating the
guideline that breakpoints must be defined only in slashed-utilities.css; fix by
removing the hardcoded em values here and referencing the canonical breakpoints
(either via the CSS custom properties or by moving the `@media` rules into the
single source-of-truth in slashed-utilities.css), or alternatively update the
guideline in the same PR if you intend to change where breakpoints live; ensure
the unique media queries in slashed-utilities-viewport.css (the four `@media`
blocks) are replaced to consume the centralized breakpoint variables or
relocated to slashed-utilities.css so the repo retains one true definition.
docs/INSTALLATION.md (1)

244-249: ⚡ Quick win

Consider adding an explicit opt-in note for viewport utilities in modular loading.

The modular snippet is valid, but a short adjacent note for slashed-utilities-viewport.css (when sm:/md:/lg:/xl: classes are needed) would prevent integration confusion.

🤖 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/INSTALLATION.md` around lines 244 - 249, Add a short opt-in note next to
the modular CSS list explaining that responsive viewport utilities require
adding slashed-utilities-viewport.css; mention the specific file name
"slashed-utilities-viewport.css" and call out the responsive prefixes (sm:/ md:/
lg:/ xl:) so integrators know to include that stylesheet when they rely on
viewport utility classes alongside slashed/css/tokens-default.css,
slashed/css/slashed-core.css, slashed/css/slashed-components.css, and
slashed/css/slashed-utilities.css.
🤖 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 `@CHANGELOG.md`:
- Around line 15-26: Add a dedicated "### Breaking" section to this release
entry and list the removal of viewport breakpoint utilities from
slashed-full.css (the sm:/ md:/ lg:/ xl: utility prefixes) as a breaking change;
mention that these classes are now in the new opt-in file
slashed-utilities-viewport.css and note the `.alternate` layout primitive change
from `@media` to `@container` and that slashed-full.css no longer contains
zero-width `@media` viewport rules so consumers who only load the bundle will be
affected.
- Around line 32-45: The changelog currently contradicts itself by referencing
container-query prefixes `cq-sm:`/`cq-md:`/`cq-lg:`/`cq-xl:` in the first
paragraph but later stating retained utilities are `cq-xs:` through `cq-lg:`;
pick one canonical range and make both references consistent (either change the
first paragraph to use `cq-xs:` through `cq-lg:` or change the later sentence to
include `cq-xl:`), updating both the inline example list and the “retained
utilities” sentence so all mentions of `cq-*` prefixes (`cq-xs:`, `cq-sm:`,
`cq-md:`, `cq-lg:`, `cq-xl:`) match exactly.

---

Outside diff comments:
In `@CLAUDE.md`:
- Line 60: Update the documentation sentence that currently states the four
breakpoints live only in slashed-utilities.css to reflect the new layout:
mention that the sm:/ md:/ lg:/ xl: breakpoint utilities now live in
slashed-utilities-viewport.css (while noting that layout primitives in
slashed-core.css using `@container` remain unaffected); replace the reference to
slashed-utilities.css with slashed-utilities-viewport.css and keep the same
breakpoint values (sm: 30em / md: 48em / lg: 64em / xl: 80em).

In `@CONTRIBUTING.md`:
- Around line 104-105: Update the "breakpoints are hardcoded" note to reflect
the new split: change the statement that viewport breakpoint utilities live only
in `slashed-utilities.css` to say viewport breakpoint utilities now live in
`slashed-utilities-viewport.css` (while retaining that layout primitives in
`slashed-core.css` use `@container` queries and are unaffected); make sure to
mention the specific breakpoint names `sm/md/lg/xl` and their em values remain
defined in the viewport utilities file so maintainers know which file to edit.

In `@docs/INSTALLATION.md`:
- Line 82: Update the stale version string in the installation pinning example:
replace the outdated token "@0.6.5.0" with the current release "@0.6.6.0" in the
INSTALLATION.md example so the copy/paste guidance matches the release noted
above.

In `@ROADMAP.md`:
- Around line 216-225: Update the roadmap note to reflect that the hardcoded
`sm/md/lg/xl` viewport prefixes are not in `slashed-utilities.css` anymore but
now live in `slashed-utilities-viewport.css`; change the sentence that currently
scopes those breakpoints to `slashed-utilities.css` so it instead references
`slashed-utilities-viewport.css`, keep the rest of the note about
`@custom-media` and the scope reduction intact, and ensure the scope-note line
referencing `slashed-core.css` and `@container` queries is left unchanged.

---

Nitpick comments:
In `@css/slashed-utilities-viewport.css`:
- Around line 37-436: This file duplicates the breakpoint literals in the media
queries (`@media` (min-width: 30em), (min-width: 48em), (min-width: 64em),
(min-width: 80em)), violating the guideline that breakpoints must be defined
only in slashed-utilities.css; fix by removing the hardcoded em values here and
referencing the canonical breakpoints (either via the CSS custom properties or
by moving the `@media` rules into the single source-of-truth in
slashed-utilities.css), or alternatively update the guideline in the same PR if
you intend to change where breakpoints live; ensure the unique media queries in
slashed-utilities-viewport.css (the four `@media` blocks) are replaced to consume
the centralized breakpoint variables or relocated to slashed-utilities.css so
the repo retains one true definition.

In `@docs/INSTALLATION.md`:
- Around line 244-249: Add a short opt-in note next to the modular CSS list
explaining that responsive viewport utilities require adding
slashed-utilities-viewport.css; mention the specific file name
"slashed-utilities-viewport.css" and call out the responsive prefixes (sm:/ md:/
lg:/ xl:) so integrators know to include that stylesheet when they rely on
viewport utility classes alongside slashed/css/tokens-default.css,
slashed/css/slashed-core.css, slashed/css/slashed-components.css, and
slashed/css/slashed-utilities.css.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 43191376-e726-44f2-a262-bfcbdb867319

📥 Commits

Reviewing files that changed from the base of the PR and between b54c99f and 7e7a82a.

📒 Files selected for processing (19)
  • CHANGELOG.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • README.md
  • ROADMAP.md
  • bin/build-bundle.sh
  • cheatsheet.html
  • css/slashed-animations.css
  • css/slashed-components.css
  • css/slashed-core.css
  • css/slashed-experimental.css
  • css/slashed-full.css
  • css/slashed-utilities-viewport.css
  • css/slashed-utilities-visual.css
  • css/slashed-utilities.css
  • css/tokens-default.css
  • css/tokens-legacy.css
  • docs/INSTALLATION.md
  • docs/UTILITIES.md

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md Outdated
claude added 2 commits May 6, 2026 10:34
- CHANGELOG: add ### Breaking section documenting sm:/md:/lg:/xl: removal
  from slashed-full.css; fix cq-xl: typo → cq-xs: in Added section
- CLAUDE.md: update stale breakpoint gotcha to reference
  slashed-utilities-viewport.css (not slashed-utilities.css)
- CONTRIBUTING.md: same gotcha update with find-replace workaround note
- INSTALLATION.md: bump @0.6.5.0 → @0.6.6.0 in pinning prose; add
  viewport utilities opt-in comment to modular loading section
- ROADMAP.md: update @Custom-Media scope note to reference
  slashed-utilities-viewport.css and 0.6.6.0 context

https://claude.ai/code/session_01HXBTBxk2YTCvs62tE3Qm28
Default value stats are noise once the token is overridden. Non-obvious
WCAG traps (--warning, disabled, decorative) retain their comments.

https://claude.ai/code/session_01HXBTBxk2YTCvs62tE3Qm28
@codeslash-net
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codeslash-net codeslash-net merged commit ee025f6 into main May 6, 2026
5 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