Skip to content

Commit 74edb51

Browse files
committed
Fix Tabs visual parity by removing aggressive global CSS reset
Remove `margin: 0; padding: 0` from the global `*` selector in visual parity test pages. This reset was causing asymmetry between Shadow DOM (Lit) and Light DOM (React) - Lit buttons kept browser defaults due to Shadow DOM encapsulation while React buttons were reset to 0 padding. Keeping only `box-sizing: border-box` which is useful and doesn't cause parity issues. Update PARITY.md to reflect current component status.
1 parent e2dd7bc commit 74edb51

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

PARITY.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -156,38 +156,43 @@ The `renderers/visual-parity` directory contains side-by-side comparisons:
156156

157157
Each Lit component with `static styles` needs a corresponding entry in `componentSpecificStyles`. Below is the complete list with implementation status:
158158

159-
### ✅ Implemented
159+
### ✅ Implemented (0% pixel diff in visual parity tests)
160160

161-
| Component | Lit File | Styles |
162-
|-----------|----------|--------|
163-
| **Card** | `card.ts` | `:host`, `section`, `::slotted(*)` |
164-
| **Text** | `text.ts` | `:host`, `h1-h5` (uses `:where()`) |
161+
| Component | Lit File | Styles | Notes |
162+
|-----------|----------|--------|-------|
163+
| **Card** | `card.ts` | `:host`, `section`, `::slotted(*)` | Uses `> section` child combinator |
164+
| **Text** | `text.ts` | `:host`, `h1-h5` (uses `:where()`) | Paragraph margin reset added |
165+
| **Divider** | `divider.ts` | `:host`, `hr` | Added margin to match browser default |
166+
| **TextField** | `text-field.ts` | `:host`, `input`, `label`, `textarea` | Multiline support added |
167+
| **Button** | `button.ts` | `:host` | Simple display/flex |
168+
| **Icon** | `icon.ts` | `:host` | Simple display/flex |
169+
| **Column** | `column.ts` | `:host`, `section`, attribute selectors | Uses `data-alignment` and `data-distribution` |
170+
| **Row** | `row.ts` | `:host`, `section`, attribute selectors | Uses `data-alignment` and `data-distribution` |
171+
| **Tabs** | `tabs.ts` | `:host` | Fixed by removing global `margin/padding` reset from test pages |
172+
173+
### 🔄 Need Investigation (size mismatch or >1% pixel diff)
174+
175+
| Component | Lit File | Styles | Issue |
176+
|-----------|----------|--------|-------|
177+
| **Slider** | `slider.ts` | `:host`, `input[type="range"]` | Size mismatch between renderers (100% diff) |
178+
| **CheckBox** | `checkbox.ts` | `:host`, `input` | Lit bug: doesn't render checked state correctly (2.57% diff) |
179+
| **DateTimeInput** | `datetime-input.ts` | `:host`, `input` | 7-10% diff on date/time, size mismatch on combined |
180+
| **List** | `list.ts` | `:host`, `section`, `::slotted(*)` | Basic fixtures OK, but `listWithCards` has 2.39% diff |
181+
| **Image** | `image.ts` | `:host`, `img` | Test fixtures timeout - cannot verify parity |
182+
| **Video** | `video.ts` | `:host`, `video` | No test fixtures - cannot verify parity |
183+
| **Audio** | `audio.ts` | `:host`, `audio` | No test fixtures - cannot verify parity |
165184

166-
### 🔄 Need a Second Pass
185+
### ⚠️ Known Implementation Differences
167186

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"]` |
187+
| Component | Lit File | Styles | Notes |
188+
|-----------|----------|--------|-------|
189+
| **MultipleChoice** | `multiple-choice.ts` | `:host`, `select` | React uses radio/checkbox inputs, Lit uses `<select>` dropdown. Skipped in visual parity tests. |
174190

175191
### ❌ Not Yet Implemented
176192

177193
| Component | Lit File | Styles | Notes |
178194
|-----------|----------|--------|-------|
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) |
195+
| **Modal** | `modal.ts` | `dialog`, nested selectors | Complex - has `#controls`, nested button styles. No CSS in `componentSpecificStyles` yet. |
191196

192197
### Special Cases
193198

renderers/visual-parity/lit/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@
133133
}
134134

135135
* {
136-
margin: 0;
137-
padding: 0;
138136
box-sizing: border-box;
139137
}
140138

renderers/visual-parity/react/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@
133133
}
134134

135135
* {
136-
margin: 0;
137-
padding: 0;
138136
box-sizing: border-box;
139137
}
140138

0 commit comments

Comments
 (0)