From 44447a1dce679e72727abbde4a7678ccdb4a8450 Mon Sep 17 00:00:00 2001 From: adamXbot <111877622+adamXbot@users.noreply.github.com> Date: Sun, 1 Nov 2026 00:55:09 +1100 Subject: [PATCH] Colour the pick card's report so it is easier to read The pick card's report was one colour, so property names, values and the classes in each selector ran together. The report is now split into tokens and each kind keeps its own colour: labels are dimmed, property names, values and classes are coloured apart, and attribute tests and pseudo-classes in rule selectors stand out. Layer notes and counts are dimmed and set in italics. Style values line up in a column, and a value that wraps stays under it. Colour values, including the oklch and oklab that Tailwind uses, get a swatch over a checkerboard, so translucent colours show as such; screen readers skip it. Each time-machine terminal has its own palette: DOS colours in 1999, dark ink on white in the 2003 Mac Terminal, and xterm colours in 2002. Every token colour meets 4.5:1 on its console. The plain-text report keeps the CLI's wording apart from the aligned values. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- app/components/pick-card.tsx | 67 +++++++++++-- app/easter-eggs.css | 14 +++ lib/pick-report.ts | 151 ++++++++++++++++++++++++------ tests/browser/logo-picker.spec.ts | 29 +++++- tests/easter-eggs.test.mjs | 23 ++++- 6 files changed, 248 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index b94e069..b317b55 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ The root layout loads Simple Analytics for page views. A delegated click listene - `/important` is a seven-round specificity boss battle with hints, explanations, actual isolated CSS previews, scoring and replay. A quiet `{ !important }` footer link and an exact `!important` search lead to it. The examples cover matching, unlayered author declarations; the page links to MDN for the wider cascade and stays out of the sitemap. - Search `c0ffee` or `#c0ffee` for a short, replayable coffee party. The non-modal message can be dismissed, and reduced-motion visitors get a still celebration. Ordinary search results remain available. - The favicon sleeps when the tab is hidden and restores the original icons on return, including icons replaced during navigation. It uses a local SVG. -- Drag the fxcss logo in the header or footer out past its edge and it becomes `fxcss pick` for the site. Until the pointer leaves the logo the press stays a click, however much it wobbles, so a shaky click still goes home. Once lifted, whatever it is over gets the picker's pink outline, with the element's classes labelled underneath (above, near the bottom of the window). It labels the nearest element that has a class. When some of an element's classes come from the site's own stylesheet rather than Tailwind's utility layer, only those are shown; utility-only lists are shortened. Release it over an element to pick it, as a click does in `fxcss pick`: a terminal-style card beside the element prints the CLI's report for it, with its tag and selector, classes (the site's own first), box, notable computed styles and the rules on the site that match it, with rules naming one of its classes listed first and Tailwind's layered rules marked by layer. The card copies the selector and links to the `fxcss pick` documentation. It looks like the terminal of the current time-machine stop: an MS-DOS Prompt in 1999, Terminal on Mac OS X in 2003, and an xterm in 2002. The report itself follows the page, so it lists the time machine's `html[data-retro]` rules when they apply. It is a non-modal dialog that takes focus; Escape or its close button returns focus to the logo, and a press elsewhere or leaving the page closes it. Carry the logo back onto itself, release it outside the page, or press Escape during the drag, and nothing is picked or followed. Either way the logo returns; reduced-motion visitors skip the flight and the card's fade. Dropping it activates nothing underneath, and a click without a drag still goes home. Mouse and pen only, so touch scrolling and taps behave as before. +- Drag the fxcss logo in the header or footer out past its edge and it becomes `fxcss pick` for the site. Until the pointer leaves the logo the press stays a click, however much it wobbles, so a shaky click still goes home. Once lifted, whatever it is over gets the picker's pink outline, with the element's classes labelled underneath (above, near the bottom of the window). It labels the nearest element that has a class. When some of an element's classes come from the site's own stylesheet rather than Tailwind's utility layer, only those are shown; utility-only lists are shortened. Release it over an element to pick it, as a click does in `fxcss pick`: a terminal-style card beside the element prints the CLI's report for it, with its tag and selector, classes (the site's own first), box, notable computed styles and the rules on the site that match it, with rules naming one of its classes listed first and Tailwind's layered rules marked by layer. Each part of the report has its own colour (labels, property names, values, classes, attribute tests and pseudo-classes), colour values get a swatch, and style values line up in a column; every colour meets 4.5:1 in each terminal. The card copies the selector and links to the `fxcss pick` documentation. It looks like the terminal of the current time-machine stop: an MS-DOS Prompt in 1999, Terminal on Mac OS X in 2003, and an xterm in 2002. The report itself follows the page, so it lists the time machine's `html[data-retro]` rules when they apply. It is a non-modal dialog that takes focus; Escape or its close button returns focus to the logo, and a press elsewhere or leaving the page closes it. Carry the logo back onto itself, release it outside the page, or press Escape during the drag, and nothing is picked or followed. Either way the logo returns; reduced-motion visitors skip the flight and the card's fade. Dropping it activates nothing underneath, and a click without a drag still goes home. Mouse and pen only, so touch scrolling and taps behave as before. ## Screenshot evidence diff --git a/app/components/pick-card.tsx b/app/components/pick-card.tsx index 6bc7321..7593764 100644 --- a/app/components/pick-card.tsx +++ b/app/components/pick-card.tsx @@ -12,7 +12,11 @@ import { import { createPortal } from 'react-dom'; import { Check, Copy, X } from 'lucide-react'; import { labelPosition } from '../../lib/logo-picker'; -import { reportLines, type PickReport } from '../../lib/pick-report'; +import { + reportTokens, + type PickReport, + type Token, +} from '../../lib/pick-report'; /** * What a dropped logo picked, printed the way `fxcss pick` prints a click. @@ -34,7 +38,7 @@ export function PickCard({ const [status, setStatus] = useState(''); const statusTimer = useRef>(undefined); const close = useEffectEvent(onClose); - const [header, ...details] = reportLines(report); + const [header, ...details] = reportTokens(report); // Beside the element, as the label was, and still beside it after scrolling. useLayoutEffect(() => { @@ -127,10 +131,24 @@ export function PickCard({
         {/* One block per line, so a wrapped rule hangs under its own start. */}
-        {header}
-        {details.map((line, index) => (
-          {line}
-        ))}
+        
+          
+        
+        {details.map((line, index) => {
+          const hang = valueColumn(line);
+          return (
+            
+              
+            
+          );
+        })}