Skip to content

v0.7.0 — Shared-State `:is()` Factoring (Review Specificity)

Latest

Choose a tag to compare

@github-actions github-actions released this 18 Sep 03:55

What's new

Review required: :is() can raise specificity

:is() is not a comma list. Each selector in a, button { } keeps its own specificity. :is(a, button) uses max(a, button).

/* 0.6.1 — no plan (missing pattern) */
a:hover,
button:hover,
[role="button"]:hover,
.clickable:hover {
  cursor: pointer;
}

/* 0.7.0 — applied on refactor */
:is(a, button, [role="button"], .clickable):hover {
  cursor: pointer;
}
Branch Before After :is()
a:hover, button:hover (0, 1, 1) (0, 2, 0)
[role="button"]:hover, .clickable:hover (0, 2, 0) (0, 2, 0)

a:hover / button:hover get class-level weight. That can change which rule wins. Read the unified diff before you keep the file.

Still REVIEW (not auto-applied):

  • :is() that includes an ID (for example :is(.alpha, #hero) .title)
  • modernize-where — :where() zeros specificity to (0, 0, 0)

Use --allow-review only if you intend those.

Use :is(), not ::is(). ::is is invalid CSS.

Bugfix: shared-state :is() was missing

modernize-is already knew same-base different states:

.button:hover, .button:focus → .button:is(:hover, :focus) (same spec → SAFE in 0.6.1)

It did not know different bases with the same state (a:hover, button:hover). That produced no plan. That hole is filled. Still 28 rules; this is not a 29th rule.

Bugfix: identical-body merge is a comma list, not :is()

::selection { background: Highlight !important; color: HighlightText !important; }
.button--primary { background: Highlight !important; color: HighlightText !important; }

becomes:

::selection,
.button--primary {
  background: Highlight !important;
  color: HighlightText !important;
}

This is merge-identical-rule-bodies. A comma list does not change each selector’s specificity. 0.6.1 marked mixed-spec merges REVIEW as if they were :is(), so the TUI never applied them. They are SAFE now.

Do not write :is(::selection, .button--primary). Pseudo-elements cannot go in :is() / :where() / :not().

Official multi-platform binaries

Platform Architecture Archive
Windows Intel / AMD x64 cssforge-v0.7.0-windows-x64.zip
Windows Snapdragon / ARM64 cssforge-v0.7.0-windows-arm64.zip
Linux Intel / AMD x64 cssforge-v0.7.0-linux-x64.tar.gz
Linux Snapdragon / ARM64 cssforge-v0.7.0-linux-arm64.tar.gz
macOS Apple Silicon M-Series cssforge-v0.7.0-macos-arm64.tar.gz

Installation

Cargo

cargo install cssforge --version 0.7.0

Linux

tar -xvf cssforge-v0.7.0-linux-x64.tar.gz
cp cssforge-v0.7.0-linux-x64/cssforge ~/.local/bin/
chmod +x ~/.local/bin/cssforge
cssforge --version

Checksums

SHA256 checksums are included with the release in SHA256SUMS.txt.

sha256sum -c SHA256SUMS.txt

Verification

This release was verified with:

cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
cargo build --release --workspace