Repository navigation
[6.x] Cover cards: fixed fills so text and controls pass contrast over any image - #20152
Merged
Merged
Conversation
… image from causing a contrast failure
…story versus an edge case, prevent edge cases from showing up in published docs
Contributor
Author
|
@copilot resolve the merge conflicts in this pull request |
…e/cover-cards-a11y # Conflicts: # packages/craftcms-ui/src/components/card/Card.mdx # packages/craftcms-ui/src/components/card/card.styles.ts # packages/craftcms-ui/src/components/card/card.ts Co-authored-by: gcamacho079 <17525979+gcamacho079@users.noreply.github.com>
Resolved and pushed in cf708fd by merging |
📚 Storybook previews@craftcms/ui — open Storybook Changed components: resources/js — open Storybook No changed components detected in this Storybook. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cover cards picked their bar, backing, and scrim strength from the image's luminance, so any error in the luminance became a contrast failure. They now use fixed fills that pass over any pixel, and the luminance only picks white or black ink.
Agent rules: what counts as a story or an edge case (
craftcms-ui.md), independent test oracles (.ai/guidelines/craft.md), and contrast verification against rendered pixels (a11y.instructions.md).Before and after
Compared with #20148 at the point this branch left it (
1a60141d79). Each image follows your GitHub theme, light or dark.Edge case stories
Edge cases now have their own folder in Storybook, beside the component, instead of mixing with the API stories or living only in tests:
<component>.edge-cases.stories.ts, titledComponents/<Name>/Edge Cases, so they nest under the component in the sidebar.!autodocs, soCard.mdxand its API examples stay focused.packages/craftcms-ui/test/cover-fixtures.ts), so reviewers see exactly what the pixel tests measure. The story shows the case; the browser test verifies it.CoverHardImages) and sized so the whole case is visible. For example, Many Attributes uses 600px-wide cards so nothing is clipped at 4:3.The convention is codified in
.ai/rules/craftcms-ui.md.docs-references.test.tsnow skips*.edge-cases.stories.tswhen checking an MDX page's story references, since a component folder can now hold two stories files.Evidence
Before: generated images uploaded in the CP and measured with CCA:
After: browser and unit tests:
Assistive technology testing
Not yet tested:
Known gaps
headerslot doesn't get the bar.Merge Danger
Door: two-way
Styles, tests, and stories only. No stored data or API changes, so it reverts cleanly.
Blast Radius: visual
Every cover card gets heavier fills: label bars go from as little as 15% to 52–60%, and light images get a stronger scrim. Header controls are always backed. Agent rules change for future UI work.