Skip to content

Commit f51e282

Browse files
docs: updated the styling ADR to give more MXUI details and added a pr review claude skill
1 parent 5bbf71a commit f51e282

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

.claude/skills/adr-review/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: adr-review
3-
description: Review a pull/merge request's new code against the connect-widget Architecture Decision Records (ADRs). Use when asked to "ADR review", "review this PR against the ADRs", "check ADR compliance", or before approving a PR/MR in the connect-widget (GitHub) or the sibling GitLab repo that follows the same standards. Reviews styling (CSS Modules / MUI), testing (Vitest/MSW/Cypress), folder structure (screaming architecture), PR size, and undocumented architecture choices.
3+
description: Review a pull/merge request's new code against the connect-widget Architecture Decision Records (ADRs). Use when asked to "ADR review", "review this PR against the ADRs", "check ADR compliance", or before approving a PR/MR in the connect-widget (GitHub) or the sibling GitLab repo that follows the same standards. Reviews styling (prefer raw MXUI/MUI, theme variables, CSS Modules), testing (Vitest/MSW/Cypress), folder structure (screaming architecture), PR size, and undocumented architecture choices.
44
---
55

66
# ADR Review

.claude/skills/adr-review/reference/adr-checklist.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,27 @@ Cite the ADR number in every finding (e.g. `[ADR 0001 Styling]`).
1111

1212
## ADR 0001 — Styling our HTML
1313

14-
Decision: style with **CSS Modules**; use **MUI `Stack`** for spacing/layout.
14+
Decision: prefer **raw MXUI/MUI components**; custom styling is rare and must be
15+
designer-validated; when custom styling is warranted, style with **CSS Modules** and
16+
use **MUI `Stack`** for spacing/layout.
1517

1618
Check added/changed `.tsx`/`.jsx`/`.css` code:
1719

20+
- **Prefer raw MXUI/MUI components.** Reach for the design system's components as-is
21+
before writing any custom styling — they carry the design system's styling by
22+
default. Flag new custom-styled elements (CSS Modules, wrappers, overrides) that
23+
reimplement something an existing MXUI/MUI component already provides.
24+
- **Custom styling should be rare and designer-validated.** Custom styling should be
25+
the exception, not the norm, and should be validated with a designer before being
26+
implemented. If a design doesn't fit the design system, that deviation should be
27+
confirmed as intentional with a designer. When a PR adds non-trivial custom styling,
28+
flag it (usually "Consider"/"Should fix") with a note to confirm designer sign-off —
29+
especially when it visibly deviates from the design system.
30+
- **Prefer MUI theme variables over hard-coded values.** When a raw component can't be
31+
used, prefer MUI theme variables (e.g. `--mui-palette-*` CSS variables, visible in
32+
Chrome dev tools' Styles panel on a rendered MXUI component) over hard-coded colors,
33+
spacing, and other magic values. Flag hard-coded hex/rgb colors or pixel values that
34+
a theme variable would cover.
1835
- **CSS Modules required.** New stylesheets must be `*.module.css` and imported as a
1936
module (`import styles from './Foo.module.css'`). Flag new plain `.css`/global CSS
2037
files, or Tailwind / other global CSS-framework classes, or styled-components.

architectureDecisionRecords/0001Styling.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ We also need to work with both CSS modules and MXUI. MXUI uses [MUI](https://mui
1818

1919
## Decision
2020

21-
We will use CSS modules to style our html.
21+
We should use the raw MXUI and MUI components as much as possible. These components come with the design system's styling baked in, so leaning on them keeps us consistent by default.
22+
23+
Custom styling should be rare. Before implementing custom styling, validate it with a designer. If a design doesn't fit within the confines of the design system, confirm with the designer that the deviation from the design system was intentional.
24+
25+
If we can't use the raw MUI component, then we should use a MUI theme variable when possible. These theme variables can be viewed by looking in Chrome dev tools under the Styles panel where an MXUI component is being rendered.
26+
27+
When custom styling is warranted, we will use CSS modules to style our html.
2228

2329
When we need to add spacing between two elements, we should use a MUI [Stack](https://mui.com/material-ui/react-stack/) with a `spacing` prop.
2430

0 commit comments

Comments
 (0)