Skip to content

feat(LINCHPIN-5639): Add a settings card, place notices and rename the stylesheet - #14

Merged
aaronware merged 2 commits into
mainfrom
issue/LINCHPIN-5639-consumer-fixes
Sep 22, 2026
Merged

aaronware merged 2 commits into
mainfrom
issue/LINCHPIN-5639-consumer-fixes

Conversation

@aaronware

Copy link
Copy Markdown
Contributor

Everything here came out of adopting this package in psst, the first real consumer. Task: Standard admin component library: linchpin/ui.

The packaging fix, which every consumer needs

The compiled stylesheet moves to build-style/chrome.css. @wordpress/scripts routes any module whose file is named style.css into a separate style-<entry>.css — the mechanism that separates a block's front-end styles from its editor ones — so a library stylesheet with that name never reaches the bundle the plugin enqueues, and the screen loads with no chrome on it.

Because the rule matches the file rather than the specifier, import '@linchpinagency/ui/style.css' still works. No consumer changes an import or configures webpack. Verified end to end: packed this branch, installed the tarball into psst, deleted psst's workaround, built — one admin.css with the chrome in it.

New

  • <SettingsCard> — the section shape every plugin was still building by hand out of a Card, a CardHeader holding a heading and a sentence, and a CardBody. The screen story in this repo was a third copy of it. Takes title, description, headingLevel, actions; renders no header without one, and no body without children.

Fixed

  • lp-admin__notices is placed by the chrome rather than left to each consumer. Core's .components-snackbar-list is a full-width, click-through strip, so the strip is pinned and the snackbars centred inside it — centring the strip itself slides its whole width off to the left, which is where psst's snackbars ended up.
  • The layout's middle column is a <div>, so it stops nesting a second main landmark inside the one wp-admin already opens as <div id="wpbody" role="main">.
  • The danger zone takes the strong error stroke at 2px on all four sides. At 1px in the ordinary error colour it read as a card with a faintly pink header rather than the one section that can destroy something.
  • The danger zone's standing warning is no longer announced on mount. Notice speaks its children, and an error status speaks them assertively, so it interrupted a screen reader on every page load to read a sentence already on screen.

Checks

lint:js, lint:css, build and verify:esm pass. 89 tests, 6 new — covering the card, the landmark and the silent warning. The announcement test fails without its fix; I checked.

Storybook has a new Chrome/Settings card story, and the screen story now uses the component instead of hand-rolling one. Worth a look there before merging: I verified the danger-zone border in psst rather than in Storybook.

…e stylesheet

Everything here came out of adopting this package in psst, the first consumer.

SettingsCard is the section shape every plugin was still building by hand out
of a Card, a CardHeader holding a heading and a sentence, and a CardBody. The
screen story in this repo was a third copy of it.

The compiled stylesheet moves to build-style/chrome.css. wp-scripts routes any
module whose file is named style.css into a separate style-<entry>.css, so a
library stylesheet with that name never reaches the bundle the plugin enqueues
and the screen loads unstyled. The ./style.css specifier still resolves, so no
consumer has to change an import or configure webpack.

Also fixed:

- lp-admin__notices is placed by the chrome rather than left to each consumer,
  and the snackbars are centred in core's full width strip instead of the strip
  being centred and dragged off screen
- the layout's middle column is a div, so it stops nesting a second main
  landmark inside the one wp-admin already opens
- the danger zone takes the strong error stroke at 2px on all four sides
- the danger zone's standing warning is no longer announced on mount, since it
  describes a risk rather than reporting an event
…me stays gone

The published surface check still looked for build-style/style.css, which the
rename in this branch removed, so the job failed on an artifact that is not
supposed to exist any more.

The second assertion is the one worth keeping: that filename is exactly what
wp-scripts splits out of a consuming plugin's bundle, so a future change that
reintroduces it should fail here rather than in whichever plugin loads the
screen unstyled next.
@aaronware
aaronware merged commit 9e54579 into main Sep 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant