feat(alert): per-type colour treatment for Info/Success/Warning/Danger - #199
Merged
Merged
Conversation
Add semantic `--color-{info,success,warning,danger}-{surface,line,ink}`
tokens under the @theme block in `assets/styles/app.css` and map the
Alert component's `type` prop to the matching class triple, replacing
the single neutral surface. Success leans emerald so it reads as a
status hue and not as a second brand-green accent. Rename the `type`
value from `error` to `danger` to match the design language and
update the nine existing callsites. ARIA behaviour is unchanged
(warning/danger assertive, info/success polite). Add
`AlertRenderTest` pinning role + class markers per type.
Fixes #196
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
martinyde
approved these changes
Jul 10, 2026
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.
Links to issues
Fixes #196
Leantime: https://leantime.itkdev.dk/dashboard/show#/tickets/showTicket/7675
Description
Completes the colour work deferred from #93. The shared
Alertcomponent now renders four visually distinct types instead of a
single neutral surface.
assets/styles/app.cssgains four semantic token triples under@theme—--color-{info,success,warning,danger}-{surface,line,ink}— each picked to pass WCAG AA against its own soft surface.
Success leans emerald so it reads as a status hue and not as a
second brand-green accent.
templates/components/Alert.html.twigmaps thetypeprop tothe matching class triple; the deferred-treatment comment is
dropped.
typevalue is renamed fromerrortodanger(no alias),and the nine existing
type="error"callsites are updated.warning/dangerstay assertive(
role="alert"),info/successstay polite (role="status").tests/Integration/Twig/Components/AlertRenderTest.phppinseach type's class triple + role.
Screenshot of the result
To be added — please eyeball each of the four types locally before
merging.
Checklist
Details - AI specificities
Goal
Give users an at-a-glance read on message severity. Today an error
and a success notice render identically, undercutting the feedback.
#93 named the four types but shipped only the ARIA-role split,
deferring the colour treatment pending semantic tokens.
Scope
@themeblock inassets/styles/app.css.templates/components/Alert.html.twig.typevalueerror→dangerand migrate the nineexisting callsites.
AlertRenderTestmirroring the pattern used forFilterPillRenderTest/FormButtonRenderTest.Non-goals
icons today and none were introduced. Purely colour treatment.
emitted — purely the visual treatment of the existing component.
Decisions
error→dangerwithout an alias. Cleaner API,matches the design language named in the issue, and the nine
callsites migrate in one sweep. Trade-off: any out-of-tree
templates referencing
type="error"(none exist in this repo)would need to be updated.
brand accent is
--color-primary: #478523(warm green-700).Using warm green for success would read as a second brand
accent, which the constraint in feat(components): per-type colour treatment for Alert (Info / Success / Warning / Danger) #196 explicitly rules out.
surface/line/inkconvention (
--color-surface-2,--color-line,--color-inkalready exist), giving
bg-*/border-*/text-*utilities thatread cleanly at the call site.
Verification
task coding-standards-check→ clean.task test→ 690 tests, 2044 assertions, all green./reset-password,/login,/admin/settings/site, and/admin/user/listto see danger,success, and info surfaces in context.
Links
typeprop; colourtreatment deferred).