Download web/src/styles/wave53/ribbon-pop.css from fsanyoto/loopable: direct link, hf CLI and curl.
- Browser
- Download file 4.39 kB
-
https://huggingface.co/spaces/fsanyoto/loopable/resolve/main/web/src/styles/wave53/ribbon-pop.css
- Command line
-
hf download hf://spaces/fsanyoto/loopable/web/src/styles/wave53/ribbon-pop.css
-
curl -L -o ribbon-pop.css https://huggingface.co/spaces/fsanyoto/loopable/resolve/main/web/src/styles/wave53/ribbon-pop.css
4.39 kB
| /* wave 53 -- lane B (W53-T07, owner instruction 25). THE RIBBON POPOVER'S SURFACE, RESTATED FOR A | |
| PORTAL. | |
| ⭐⭐ WHY THIS FILE EXISTS AT ALL. Every `Ribbon.tsx` popover now renders through | |
| `customer-grid/OverlaySurface.tsx::AnchoredOverlay`, which is a body-level `position: fixed` | |
| node created by `createPortal`. It is therefore no longer a DOM descendant of | |
| `.sheet-ribbon-slot`, of `.sheet-ribbon-scroll` or of anything else in the ribbon, so ANY rule | |
| written as `#ancestor .child` stops matching the moment it is portalled -- silently, with no | |
| build error and no gate anywhere going red. The surface a menu paints (its background, its | |
| edge, its shadow) is exactly the thing that must never depend on where the node happens to sit, | |
| because a transparent menu over a grid canvas is unreadable and still looks correct in the DOM | |
| inspector ([[a-portal-overlay-carries-its-own-surface]]). | |
| ⛔ WHY NOT JUST EDIT `.sheet-ribbon-pop`. That rule lives in `styles/wave50/sheet.css`, which is | |
| OUTSIDE this ticket's file fence. The portalled element keeps that class (KeyTips reads it, and | |
| the child vocabulary below is shared with it), and this file adds a SECOND class that restates | |
| the whole surface on its own terms. Where the two disagree, this file is the one written for a | |
| portal. | |
| ⭐⭐ THE BORDER IS THE REAL BUG FIX HERE, AND IT PREDATES THIS TICKET. `wave50/sheet.css`'s | |
| `.sheet-ribbon-pop` declares `border: 1px solid var(--lp-line-strong)`, and `--lp-line-strong` | |
| IS NOT DECLARED ANYWHERE in `index.css`. A `var()` naming an undeclared custom property makes | |
| the whole declaration invalid at computed-value time, which resolves `border` to its initial | |
| value -- `border-style: none`. So the ribbon menus have been shipping with NO edge at all, only | |
| a shadow. `wave51/sheet-engine.css`'s own header records catching this exact ghost token on the | |
| scrollbar thumb in W51-T16; this is the second site. `--lp-line` is the declared hairline and is | |
| what every other quiet edge in the sheet chrome uses. | |
| Tokens only (`var(--lp-*)`), no literal hex, no literal font-size (DESIGN.md section 2). The | |
| shadow's `rgba()` is copied byte for byte from the rule it replaces -- shadows are permitted on | |
| overlays and ONLY on overlays (DESIGN.md section 4), and there is no shadow token to name. | |
| Imported directly by `sheet/Ribbon.tsx`, not through `index.css`'s `@import` chain, for the | |
| reason `styles/wave52/ribbon.css`'s own header sets out: `index.css` is shared across every | |
| lane and a line there is the trivial-but-collision-prone edit. A component-owned side-effect | |
| import is this repo's established way around it (`customer-grid/Toolbar.tsx` imports its own | |
| `./filters.css` the same way). */ | |
| .sheet-ribbon-pop-portal { | |
| /* ⛔ NO `position`, `left`, `top`, `max-width` OR `max-height` HERE. `AnchoredOverlay` writes | |
| all five as an INLINE style every time it measures, and an inline declaration wins over this | |
| file regardless of source order. Restating them would be dead code that reads as if it were | |
| load bearing. */ | |
| display: flex; | |
| flex-direction: column; | |
| gap: 1px; | |
| min-width: 168px; | |
| padding: 5px; | |
| /* The surface, self contained: nothing below depends on an ancestor in the ribbon. */ | |
| background: var(--lp-surface); | |
| border: 1px solid var(--lp-line); | |
| border-radius: var(--lp-r-md); | |
| box-shadow: 0 6px 18px rgba(25, 34, 46, 0.16); | |
| color: var(--lp-ink); | |
| /* A menu taller than the viewport gets a `max-height` from `AnchoredOverlay`'s collision | |
| arithmetic; without this it would be clipped by that height instead of scrolling inside it, | |
| which is the same class of defect this ticket was opened for. */ | |
| overflow-y: auto; | |
| } | |
| /* The swatch grid, the chip and the menu row are declared as PLAIN classes in | |
| `styles/wave50/sheet.css` (`.sheet-ribbon-item`, `.sheet-ribbon-swatches`, `.sheet-ribbon-row`, | |
| `.sheet-ribbon-step`, `.sheet-ribbon-count`), so they keep matching inside the portal and are | |
| deliberately not restated. The chip is the one exception: it names the same ghost token the | |
| popover's border did, so its edge is invisible for the same reason and is fixed here for the | |
| portalled case rather than left to look like a rendering accident. */ | |
| .sheet-ribbon-pop-portal .sheet-ribbon-chip { | |
| border: 1px solid var(--lp-line); | |
| } | |