🍕 Subtle ambient highlight: corner accents in 'all' mode#14
Merged
Conversation
The previous "all" mode painted a 1px @ 18% blue outline around every
component on the page. Even at low opacity, full-perimeter outlines
accumulate visual mass at shared edges — three nested cards produce
three parallel lines within ~6px of each other — so the result still
read as "every component is highlighted" rather than "I can faintly
perceive the structure".
This commit replaces that rendering with four short L-shaped corner
accents at each corner of every component (8px arms, 1px wide, blue
@ 55%). Corners don't accumulate at shared edges, so nested layouts
stay visually quiet, while you can still tell at a glance which boxes
are Clay components.
Other changes:
- Hover (2px @ 70%) and selected (2px @ 100%) outlines are unchanged
and stay visually dominant — the corner ticks excluded themselves
via :not([hover]):not([selected]) so they fade out the moment you
start inspecting an element.
- The :not() exclusion also keeps the corner-tick ::before from
colliding with the selection label badge (also ::before), and the
annotation dot remains on ::after so it's independent.
- TOKENS.ambient.{tick, alpha} replace TOKENS.ambient.{width, alpha,
offset}; same intensity-slider story (CSS var multiplier).
- Three new contract tests assert the gating-by-mode and the :not()
exclusions so a future stylesheet edit that breaks the visual
handoff fails loudly.
Layout note: the corner-tick rule needs position: relative on the
host element to anchor the ::before. We omit !important so a host's
own positioning rule always wins (we then position against that
context, which is correct). The only failure mode is host=static +
absolute-positioned descendant pinning to a farther ancestor — opt-in
'all' mode, dial back to 'selection' if it bites.
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
You asked: "Is there a way to highlight a little all the components on the page in a non-visually disruptive way but then keep the rest of the hover behavior as is? I'm doing it on the selection-only mode but maybe we do that for the `all` mode?"
This PR redesigns what `all` mode draws.
Before: every component got a 1px @ 18% blue outline on its full perimeter. Even at low opacity, full perimeters accumulate at shared edges — three nested cards stacked three parallel lines within ~6px — so the page still read as "every component is highlighted".
After: every component gets four small L-shaped accents (8px arms, 1px wide, blue @ 55%) — one at each corner. Corners don't accumulate at shared edges, so nested layouts stay quiet, while you can still tell at a glance which boxes are Clay components.
Hover and selection are completely unchanged — they still draw the rich 2px outlines and the selection label badge. The corner ticks just drop out the moment you start inspecting (`:not([hover]):not([selected])`) so they never compete with the inspection signal.
Visual model
Why corners
Implementation
Layout caveat
The `::before` needs a positioning context. The rule sets `position: relative` (no `!important`) on each component, so:
This matches what we already do for `[data-clay-slip-selected]` and `[data-clay-slip-annotated]` (also `position: relative;` no important) — same risk profile, just on more elements when `all` is active.
Test plan
Made with Cursor