Repository navigation
Conversation
Preflight sets `b, strong { font-weight: bolder }`, and `bolder` is not a
weight — it is a step relative to the parent. So the same tag renders as three
different things depending on what it sits in. Measured in example/ on 3.0.4:
<p> (400) strong renders 700
.light (300) strong renders 400 ← no emphasis at all
h1 / h2 (700) strong renders 900
The 400 case is the one that matters: inside light text a <strong> is
indistinguishable from the prose around it, which is the one thing the tag
exists to prevent.
Restore an absolute weight, the same fix and the same reasoning as the
`h1..h6 { font-bold }` rule this sits next to — preflight took something the
browser default gave, and it goes back explicitly. Element selectors only, for
that rule's reason: `.bold` is already the class for "make this bold" and
consumers use it deliberately.
Colour is deliberately not set. <strong> marks importance, not interactivity;
--secondary is what buttons and links are. A <strong> keeps the colour of the
text around it, including inside a link, where it keeps the link's.
After, in example/: 700 in all three contexts above, plus inside a link, inside
.bold, and for <b>; colour inherited in every case.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
A design question worth answering explicitly before this merges, raised by @dan on the consumer side: shouldn't It is a fair reading —
If the team prefers the other answer, the shape would be One real consumer impact, for the record: on the marketing site this rule bolds 22 testimonial lead sentences that were rendering at 400 inside a |
|
Update on the consumer side, so this PR's "Where this came from" section is not read as more settled than it is. The marketing site has landed its own pass (workadventure/website-migration#122), and it went a different way than that section describes: it fixed the blue-vs-bold split by deletion — dropping the blue rule and letting preflight's That does not weaken the case for this PR, but it changes what adopting it will do, and the DS reviewer should know:
Both are flagged on the site side (finding 144 in The |
What
b, strong { @apply font-bold }in@layer base, next to theh1–h6weight rule it mirrors. One line of CSS; the rest of the diff is the comment explaining it.Conventional-commit
feat:, so release-please cuts this as 3.1.0.Why
Preflight sets
b, strong { font-weight: bolder }, andbolderis not a weight — it is a step relative to the parent. The same tag therefore renders as three different things depending on what it sits in. Measured inexample/on 3.0.4, not inferred:<p>(400).light(300)<h1>/<h2>(700)The 400 row is the one that matters: inside light text a
<strong>is indistinguishable from the prose around it, which is the one thing the tag exists to prevent.How
Same fix, same reasoning, as the
h1..h6 { @apply font-bold }rule directly above it — preflight took something the browser default used to give, and it goes back explicitly. That rule's comment already tells this story for headings; this is the same story one element down.Two deliberate choices, both inherited from that rule:
.boldis already the class for "make this bold", and consumers apply it on purpose; bolding classes here would change their meaning.<strong>marks importance, not interactivity —--secondaryis what buttons and links are, and a reader who sees brand colour should be able to click it. So a<strong>takes the colour of the text around it, including inside a link, where it keeps the link's.Where this came from
The marketing site (
workadventure/website-migration) was carrying three different<strong>renderings, one per page family, each a faithful port of a different WordPress template — one of them blue and not bold. It has just been unified to bold-and-uncoloured with the design team (workadventure/website-migration#122), using a site-local rule that is really this one. It belongs here: the DS already asserts it piecemeal incomponents/features.css(.feature-content-title { strong, b { @apply font-bold } }), and@layer basealready styles bare elements (*,html, body,h1–h6).Once this ships, the site drops its local rule and depends on 3.1.0.
Verification
npm run build:exampleclean.h1,h2,h3,h4,h5,h6,b,strong{font-weight:700}— emitted after preflight'sb,strong{font-weight:bolder}in the same layer, so it wins on order at equal specificity. Net cost is essentially zero bytes.example/app before and after, across<p>,.light,.bold,<h1>,<h2>, inside a link, and for<b>: 700 in every case, colour inherited in every case.prose/component rule that draws its own<strong>is unaffected (this is why the site can keep@tailwindcss/typography's own bold treatment untouched).Possible follow-up, not in this PR
components/features.csshas.feature-content-title { strong, b { @apply font-bold } }, which this rule makes redundant — same value, later layer. Left alone deliberately to keep this diff to one behavioural change; happy to remove it here if you'd rather.🤖 Generated with Claude Code