Skip to content

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 22 Aug 18:02
· 167 commits to master since this release

Cirth v0.12.0

Cirth v0.12.0 makes the 44px touch target a property of the components
rather than an outcome of the type scale, gives textarea a default worth
having, and fixes three bugs shipped with the popover and modal work in
0.11.0.

A minor, not a patch: nothing was removed or renamed, and every change here
is the framework doing what it already claimed to do — but two of them
alter how markup that already exists will render, and the version number is
the only warning most people get.

Before you upgrade

  • A textarea without rows gets taller. Four rows instead of the
    browser's two — 122px where it used to be 70px at the default type scale.
    Pages with a comment box or a message field get longer. To keep the old
    height, say so in the markup: <textarea rows="2">. An explicit rows
    always wins, and always did.
  • Controls stop shrinking when you change their font size. Buttons,
    select and textarea now hold a 44px minimum height regardless of the
    type set on them, so a button styled at 0.875rem grows from 40.75px to
    44px. If you were relying on a smaller control, set min-block-size on
    it — or put it in a nav, where the floor is 24px by design.

Changed

  • A textarea opens four rows tall instead of two. Two rows shows a
    line and a half of a paragraph, so a control meant for prose opened as a
    box you immediately scroll inside. The four rows are measured in lh, so
    they stay four rows of that textarea's own text if you change its font
    size, rather than four rows of the default scale. An explicit rows
    attribute takes over completely: that is you declaring the height in the
    markup, and the default only fills in where you have not.

Fixed

  • The 44px target size is now a floor, not a coincidence. A control's
    height was padding plus line-height, which adds up to 44px at the default
    type scale and stops the moment anyone sets a different font-size — a
    button at 0.875rem came out at 40.75px, a select at 41px. Buttons,
    select and textarea each carry a min-block-size measured from
    --cirth-size-4 rather than from their own text, so the guarantee
    belongs to the component instead of to the type scale.

    Controls inside a nav opt down rather than out. A navigation row is
    compact by design, so it restates the floor at 24px — WCAG 2.5.8 Target
    Size (Minimum), the AA threshold — where 44px is 2.5.5's AAA one.

    [type="file"]::file-selector-button is exempt outright: it is a part of
    the input rather than a target of its own, and the input is already 44px
    tall.

  • A modal's close button is a 44px target instead of a 16px one. It is
    drawn as a 1rem icon and had 1rem of hit area to go with it, on the
    control people reach for in a hurry. The icon is unchanged and nothing
    around it moves — the box grows, background-size keeps the glyph at
    1rem, and negative margins take the extra back out of the layout.

  • An open, non-modal <dialog> no longer locks the page. The scroll
    lock added in 0.11.0 was keyed on html:has(dialog[open]), which is true
    of a dialog rendered inline as ordinary content — so a page showing one
    as an example could not be scrolled. It is now html:has(dialog:modal):
    only a dialog opened with showModal(), the one that actually covers the
    page, locks it.

  • A popover stays centred when your CSS touches its margins. The
    browser centres a popover with margin: auto on all four sides, so a
    rule like .container > :last-child { margin-bottom: 0 } left the other
    sides to absorb the free space and slid the panel to the bottom of the
    screen. The open panel declares inset: 0; margin: auto itself now.
    Anchor positioning still wins: position-area takes precedence, so
    nothing needs undoing first.

Full Changelog: v0.11.0...v0.12.0