mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
ui: larger tags, tighter rows
A tag's word was 78% of the size of the body text beside it, which is right
for a label -- an annotation on something else, like the count next to a
tab's name -- and wrong for a tag, which is the whole content of its chip
and the thing a wall of them is scanned for. On the dashboard, where the
tags are the page, it read as a footnote. Now 87.5%.
The point grew with it, because it has to: its diagonal is the body's
height, or its two edges meet the body short of the corners and it reads as
a notch stuck on the side. 21px a side for the 30.2px body. That is also
the one length here that went UP -- the margin reserving room for the point
was a third of a pixel short of the larger one, which is enough to clip
against the tag before it.
Padding is unchanged. The gaps are two defects rather than a design:
- The link wrapper carried 0.3em either side, from when these were
Semantic labels with no margin of their own. A tag already reserves
the room its point needs, so that was 0.3em twice on top of it: two
tags 34.7px apart where the point needs 18.4px. Now 25.3px, leaving
about 7px of visible space.
- TagsLinkGroup spread its props down to every chip, so the dashboard's
marginTop -- meant to space the row below its heading -- landed on all
34 tags. That is not a margin above the row; it is 7.7px added between
every wrapped row of it. Row gaps 18.5px -> 12px.
Tests first: both margins fail on the real values (0.3em on the link,
0.5em on the chip), and the size is asserted as a ratio to body text so it
cannot be satisfied by the interface scale, which raised tag and prose
together and left the tag exactly as small next to it.
Verified in all four themes, including night, where the point is two
strokes rather than a solid diamond and so shows a corner mismatch plainly.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6297507859
commit
14e32db961
4 changed files with 133 additions and 13 deletions
|
|
@ -784,8 +784,9 @@ html[data-theme="amber"] .wrolpi-path-input-control:focus-within {
|
|||
* A tag is a label with a physical shape: a pointed left edge and an eyelet, like a tag
|
||||
* tied to a garment. The point is a square rotated 45 degrees behind the left edge -- its
|
||||
* right half sits under the body in the same color and merges, leaving the left half
|
||||
* showing as the point. At 20px a side its diagonal is 28px, which is the body's height,
|
||||
* so the two edges of the point meet the body exactly at its corners.
|
||||
* showing as the point. At 21px a side its diagonal is 29.7px, within half a pixel of the
|
||||
* body's 30.2px height, so the two edges of the point meet the body at its corners. (Design
|
||||
* px throughout: the interface scale multiplies both, so the match holds at any size.)
|
||||
*
|
||||
* The eyelet is drawn in `currentColor`, so it reads as a hole punched through the tag on
|
||||
* any surface, filled or outlined, without needing to know what is behind it.
|
||||
|
|
@ -794,14 +795,24 @@ html[data-theme="amber"] .wrolpi-path-input-control:focus-within {
|
|||
.wrolpi-tag {
|
||||
position: relative;
|
||||
/*
|
||||
* Room for the point, which is drawn outside the body: half its diagonal (14.1px) plus
|
||||
* the 1px it is nudged left, rounded up.
|
||||
* Larger than a plain label, which is the one place the two part company. A label
|
||||
* annotates something else -- the count beside a tab's name, the page number in the CBZ
|
||||
* viewer -- and wants to sit under the text it belongs to. A tag is the whole content of
|
||||
* its chip and the thing a wall of them is scanned for, so at 78% of body text it read as
|
||||
* a footnote on the dashboard, where the tags are the page.
|
||||
*/
|
||||
margin-left: 1rem;
|
||||
font-size: 0.875rem;
|
||||
/*
|
||||
* Room for the point, which is drawn outside the body: half its diagonal (14.85px), plus
|
||||
* the 1px it is nudged left, plus the 1px border it is positioned inside of, rounded up.
|
||||
* This is the one length here that grew: 16px covered the smaller point, and the larger
|
||||
* one overhung it by a third of a pixel, which is enough to clip against the tag before it.
|
||||
*/
|
||||
margin-left: 1.0625rem;
|
||||
/* Tags wrap, and a wrapped row was sitting on the row above it. */
|
||||
margin-bottom: 0.3125rem;
|
||||
/*
|
||||
* The point is centred on the left edge, so its inner half covers the body's first 10px
|
||||
* The point is centred on the left edge, so its inner half covers the body's first 10.5px
|
||||
* -- and a positioned pseudo-element paints above the parent's text, not behind it, so
|
||||
* without this the first letter is hidden under the point. Semantic's tag label carried
|
||||
* the same asymmetry (`padding-left: 1.5em`) for the same reason.
|
||||
|
|
@ -814,8 +825,13 @@ html[data-theme="amber"] .wrolpi-path-input-control:focus-within {
|
|||
position: absolute;
|
||||
top: 50%;
|
||||
right: 100%;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
/*
|
||||
* Tied to the body's height, not chosen: the diagonal has to equal it or the point's two
|
||||
* edges meet the body short of its corners. So this grew with the font -- 21px a side for
|
||||
* the 30.2px body, where 20px served the 28.2px body the tag had at 12.5px text.
|
||||
*/
|
||||
width: 1.3125rem;
|
||||
height: 1.3125rem;
|
||||
/*
|
||||
* Nudged 1px left of where `right: 100%` puts it. That property positions against the
|
||||
* containing block's *padding* box, and the body carries a 1px border, so a square centred
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue