Commit 84906f3
authored
fix!: convert Field, Switch, Radio, Checkbox BEM classes to flat class names (#5115)
* fix!: convert Field BEM classes to flat class names
Renames BEM element classes to flat names scoped by CSS nesting:
- eds-field__label → label
- eds-field__indicator → indicator
- eds-field__description → description
- eds-field__helper-message → helper-message
Also restructures field.css to nest inner element selectors inside
.eds-field using CSS nesting.
BREAKING CHANGE: consumers targeting these class names directly in their
own CSS must update to the new flat names.
* fix!: convert Switch BEM classes to flat class names
Renames BEM element classes to flat names scoped by CSS nesting:
- eds-switch__control → control
- eds-switch__input → input
- eds-switch__track → track
- eds-switch__handle → handle
Also restructures switch.css to use full CSS nesting, moves the
checked/disabled handle state rules up to the .eds-switch scope
(cleaner than the previous inside-out nesting), and replaces the
cross-component .eds-field__label selector with the native label
element to remove the coupling to Field's internal class names.
BREAKING CHANGE: consumers targeting these class names directly in their
own CSS must update to the new flat names.
* fix!: convert Radio BEM classes to flat class names
Renames BEM element/modifier classes to flat names:
- eds-radio__icon-wrapper → icon-wrapper
- eds-radio__input → input
- eds-radio__icon → icon
- eds-radio__icon--checked → icon-checked
- eds-radio__icon--unchecked → icon-unchecked
- eds-radio--standalone (class modifier) → data-standalone attribute
Also restructures radio.css with full CSS nesting, removes the
unused classNames helper from Radio.tsx, and replaces the
cross-component .eds-field__label selector with the native label
element to decouple from Field's internal class names.
BREAKING CHANGE: consumers targeting these class names directly in their
own CSS must update to the new flat names.
* fix!: convert Checkbox BEM classes to flat class names
Renames BEM element/modifier classes to flat names:
- eds-checkbox__icon-wrapper → icon-wrapper
- eds-checkbox__input → input
- eds-checkbox__icon → icon
- eds-checkbox__icon--checked → icon-checked
- eds-checkbox__icon--unchecked → icon-unchecked
- eds-checkbox__icon--indeterminate → icon-indeterminate
- eds-checkbox--standalone (class modifier) → data-standalone attribute
Also restructures checkbox.css with full CSS nesting, removes the
unused classNames helper from Checkbox.tsx, and replaces the
cross-component .eds-field__label selector with the native label
element to decouple from Field's internal class names.
BREAKING CHANGE: consumers targeting these class names directly in their
own CSS must update to the new flat names.
* fix: update TextField snapshot after Field class name changes1 parent cf43288 commit 84906f3
15 files changed
Lines changed: 457 additions & 440 deletions
File tree
- packages/eds-core-react/src/components/next
- Checkbox
- __snapshots__
- Field
- Radio
- __snapshots__
- Switch
- __snapshots__
- TextField/__snapshots__
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
| |||
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
47 | | - | |
| 44 | + | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 50 | + | |
| 51 | + | |
59 | 52 | | |
60 | 53 | | |
61 | 54 | | |
62 | | - | |
| 55 | + | |
63 | 56 | | |
64 | 57 | | |
65 | 58 | | |
66 | 59 | | |
67 | | - | |
| 60 | + | |
68 | 61 | | |
69 | 62 | | |
70 | 63 | | |
| |||
96 | 89 | | |
97 | 90 | | |
98 | 91 | | |
99 | | - | |
| 92 | + | |
| 93 | + | |
100 | 94 | | |
101 | 95 | | |
102 | 96 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
0 commit comments