Skip to content

Commit 04c832f

Browse files
committed
Add component CSS checklist to PARITY.md
1 parent ad8c856 commit 04c832f

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

PARITY.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,106 @@ The `renderers/visual-parity` directory contains side-by-side comparisons:
151151
1. Load the same fixture in both Lit and React
152152
2. Compare rendered output visually and via computed styles
153153
3. Use browser DevTools to verify CSS specificity matches
154+
155+
## Component CSS Checklist
156+
157+
Each Lit component with `static styles` needs a corresponding entry in `componentSpecificStyles`. Below is the complete list with implementation status:
158+
159+
### ✅ Implemented
160+
161+
| Component | Lit File | Styles |
162+
|-----------|----------|--------|
163+
| **Card** | `card.ts` | `:host`, `section`, `::slotted(*)` |
164+
| **Text** | `text.ts` | `:host`, `h1-h5` (uses `:where()`) |
165+
166+
### 🔄 Need a Second Pass
167+
168+
| Component | Lit File | Styles |
169+
|-----------|----------|--------|
170+
| **Divider** | `divider.ts` | `:host`, `hr` |
171+
| **TextField** | `text-field.ts` | `:host`, `input`, `label` |
172+
| **CheckBox** | `checkbox.ts` | `:host`, `input` |
173+
| **Slider** | `slider.ts` | `:host`, `input[type="range"]` |
174+
175+
### ❌ Not Yet Implemented
176+
177+
| Component | Lit File | Styles | Notes |
178+
|-----------|----------|--------|-------|
179+
| **Button** | `button.ts` | `:host` | Simple - just display/flex |
180+
| **Column** | `column.ts` | `:host`, `section`, attribute selectors | Uses `[alignment]` and `[distribution]` attribute selectors |
181+
| **Row** | `row.ts` | `:host`, `section`, attribute selectors | Uses `[alignment]` and `[distribution]` attribute selectors |
182+
| **Image** | `image.ts` | `:host`, `img` | Uses `--object-fit` CSS variable |
183+
| **Video** | `video.ts` | `:host`, `video` | Simple media styling |
184+
| **Audio** | `audio.ts` | `:host`, `audio` | Simple media styling |
185+
| **Modal** | `modal.ts` | `dialog`, nested selectors | Complex - has `#controls`, nested button styles |
186+
| **Tabs** | `tabs.ts` | `:host` | Simple - just display/flex |
187+
| **List** | `list.ts` | `:host`, `section`, `::slotted(*)` | Uses `[direction]` attribute selector |
188+
| **MultipleChoice** | `multiple-choice.ts` | `:host`, `select` | Form element styling |
189+
| **Icon** | `icon.ts` | `:host` | Simple - just display/flex |
190+
| **DateTimeInput** | `datetime-input.ts` | `:host`, `input` | Has specific input styling (border-radius, padding, border) |
191+
192+
### Special Cases
193+
194+
| Component | Notes |
195+
|-----------|-------|
196+
| **Surface** | Root component with different structure; doesn't use `structuralStyles` |
197+
| **Root** | Internal component, styles handled differently |
198+
199+
## Implementation Hints
200+
201+
### Attribute Selectors (Column, Row, List)
202+
203+
Lit uses `:host([attribute="value"])` for attribute-based styling. In React, use data attributes:
204+
205+
```tsx
206+
// React component
207+
<div className="a2ui-column" data-alignment={alignment} data-distribution={distribution}>
208+
```
209+
210+
```css
211+
/* componentSpecificStyles */
212+
.a2ui-surface .a2ui-column[data-alignment="center"] section {
213+
align-items: center;
214+
}
215+
```
216+
217+
### CSS Variables (Image)
218+
219+
Pass CSS variables via inline style:
220+
221+
```tsx
222+
// React component
223+
<div className="a2ui-image" style={{ '--object-fit': fit }}>
224+
```
225+
226+
```css
227+
/* componentSpecificStyles */
228+
.a2ui-surface .a2ui-image img {
229+
object-fit: var(--object-fit, fill);
230+
}
231+
```
232+
233+
### Nested Selectors (Modal)
234+
235+
For complex nested styles, maintain the hierarchy:
236+
237+
```css
238+
/* Lit */
239+
dialog section #controls button { ... }
240+
241+
/* React componentSpecificStyles */
242+
.a2ui-surface .a2ui-modal dialog section #controls button { ... }
243+
```
244+
245+
### Form Elements
246+
247+
Form inputs already have some shared styles. Component-specific overrides should be scoped:
248+
249+
```css
250+
/* DateTimeInput specific */
251+
.a2ui-surface .a2ui-datetime-input input {
252+
border-radius: 8px;
253+
padding: 8px;
254+
border: 1px solid #ccc;
255+
}
256+
```

0 commit comments

Comments
 (0)