feat(udg): anchor + extent — a pull can occupy part of the element #154
No reviewers
Labels
No labels
build-dist
priority
P1
priority
P2
priority
P3
priority
P4
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Toilville/toilville-design!154
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/udg-press-placement"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Now that #153 has merged, this targets
maindirectly.Every pull covered its whole element, so
plate.ui.line-horizontal— a hand-drawn rule at 33.6:1, obviously drawn for a boundary — shipped as an orphan in #148: registered, emitting a handle, referenced by no press. I dropped it from the demo because the model could not hold it. That is the gap stating itself, anddocs/UDG_PRESS_AUTHORING.mdalready named the two missing concepts.Scope
extent: autoderives the band from the plate's own viewBox ratio, so the drawing's proportions hold at any width: 10.69px at 360 wide, 19.02 at 640, 30.42 at 1024 — measured, not predicted. The thickness nobody has to guess.Verified before building, in two engines
The whole design rests on CSS transferring an aspect ratio to an absolutely-positioned box with one
autoinset (CSS Position 3 §4.1). Firefox is the engine to distrust here — it is also the one with nomask-border— so I probed Chrome and Firefox before writing a line of generator code. Both report the same heights to two decimals. A percentage-padding contingency was probed alongside and also works, if an engine ever regresses.Three corrections to my own first design, caught before shipping
skin.css, not referenced as--plate-<id>-aspect.artifact.pyinlines plate handles with a regex matching onlyurl()declarations, so a non-url plate var would be undefined there —aspect-ratiowould fall back toautoand every band would be 0px tall in the design board alone. Silently plausible, and in only one of three consumers.inset/w/h/aspectare emitted for every pull, fill included, and every recipe reads them asvar(--pN-inset, 0). An undefined custom property is invalid-at-computed-value-time, which takes the property's initial value —autoforinset, collapsing the box. Aninset: 0in the shared rule does not save it: IACVT applies after the cascade has already picked a winner. Thatinset: 0is now gone from all three recipes; it read as a fallback and was not one.extentis a bare number, not a CSS length string."20px"invites"20 px", which computes invalid and silently collapses the pull.Seven guards, each for a case that currently renders something plausible
unknown plate (floods with raw pigment today, reachable by one typo) · unknown anchor · extent on a fill pull · extent as a string ·
extent: 0·extent: autoon a side anchor with a landscape plate (the band would be 33.6× the panel's height) ·fit: sliceon an anchored pull (mask-box-imageslices both axes, so a thin band is consumed by its two end slices and the middle never draws).No fourth field
registrationalready places the gap.ruled-panel-fixedlifts its rule 12px off the edge withregistration: [0, 12]alone — that is the proof, and it ships.Testing
just checkgreen, 4 presses · 255 tests · self-check reports 20 boxes, zero failures.getComputedStyle, not arithmetic.inset: 0 / auto / auto / auto— the two shipped presses are unchanged.The self-check earned its keep twice more, once flagging the single-pull presses' unused
::afteras a dropped mask (it now reads--pulls), and before that the substrate-only panel. Both times the check was wrong, not the code — but a check that cries wolf gets ignored, so both are now distinctions it knows.Impact Statement
Additive.
anchordefaults tofill, which is exactly today's behaviour; the two existing presses are unchanged apart from gaining five vars per pull. Two new presses ship, sodist/spelworkand the review artifact churn. Versions bumped inmeta.ymlandsync-manifest.yml.One thing this deliberately does not settle.
extent: autopreserves the drawing's proportions and lets the band's weight track the container; an explicitextentpreserves the weight and lets the proportions go. In a 1600px hero,autois a 47px slab. Both are defensible — it is the anisotropy problemfit: slicesolves for frames, wearing a different coat — so the review artifact shows them side by side and the call is left to design rather than baked into a default nobody chose.Untested engine: Safari. WebKit shipped abspos aspect-ratio transfer in the 271xxx changesets (→ Safari 15) and the spec is explicit, but I can only drive Chrome and Firefox headlessly here. Worth one human look before anyone relies on
extent: autoon an Apple surface.Reversibility: high. Remove
anchorfrom a pull and it is a fill pull again.Decision:
extentis a fixed number, notauto. One thickness for the whole system.autokeeps the drawing's proportions and lets the weight go. At 1024 that is a 30px band and at 1600 a 47px slab — past a certain width it has stopped being a rule and become a panel. A boundary should read as a boundary at every size, so the weight is the property worth holding.The cost is real and accepted: stretched horizontally, the drawn line flattens as the element widens. That is the right thing to lose. The hand-drawn character is a texture on a rule; it is not the rule.
One value, not a choice per use
The point of fixing it is that nobody picks a number at the call site. If each press names its own thickness, drawn rules end up at four different weights across the site and the system has bought inconsistency in exchange for control.
Use the value that already exists:
border.width-emphasis, 3px. It is the same role — the app'sborderThickcarries the same 3.0 with the comment "thick accent bar — quote stripe, visual dividers". A drawn rule and a plain one should sit at the same weight; that they are drawn is a texture difference, not a weight difference.The plate itself needs a second pass at this weight
Separate from the model: the drawn detail reads aggressive right now.
plate.ui.line-horizontalwas drawn at 33.6:1 for a band that scales, and a locked 3px band asks it to carry the same vertical variation in a fraction of the height. The wobble that looks like a hand at 30px looks like noise at 3.That is a change to the drawing, not to
anchor/extent. The model is right; the plate was drawn for the other answer.What this settles
extent: autostays in the model and stays guarded, but nothing ships on it. The untested-Safari note therefore stops being on the critical path — no shipping surface depends on abspos aspect-ratio transfer.The rest of the PR reads well. Probing two engines before writing generator code, and catching three of your own design errors on the grounds that each would have rendered something plausible, is the part worth keeping as a habit.
@peterswimm fillies up