|
12 | 12 | border-radius: var(--fds-accordion-border-radius);
|
13 | 13 | }
|
14 | 14 |
|
15 |
| - /* |
16 |
| - .expandIcon { |
| 15 | + .accordion__expand-icon { |
17 | 16 | border-radius: var(--fds-border_radius-interactive);
|
18 | 17 | }
|
19 | 18 |
|
20 |
| - .content { |
| 19 | + .accordion__content { |
21 | 20 | padding: var(--fds-spacing-5, 1rem);
|
22 | 21 | overflow: hidden;
|
23 | 22 | text-overflow: ellipsis;
|
24 | 23 | }
|
25 | 24 |
|
26 |
| - .header { |
| 25 | + .accordion__header { |
27 | 26 | margin: 0;
|
28 | 27 | }
|
29 |
| - */ |
30 | 28 |
|
31 | 29 | .accordion__button {
|
32 | 30 | width: 100%;
|
|
46 | 44 | border-radius: var(--fds-accordion-border-radius);
|
47 | 45 | }
|
48 | 46 |
|
49 |
| - /* |
50 |
| - .item:focus-within { |
| 47 | + |
| 48 | + .accordion__item:focus-within { |
51 | 49 | position: relative;
|
52 | 50 | }
|
53 | 51 |
|
54 |
| - .item:where(.open) .accordionButton:hover+* .content { |
| 52 | + /* |
| 53 | + * I Think this is unused? The button has no siblings. accordion content has no border |
| 54 | + .accordion__item:where(.accordion__content--open) .accordion__button:hover+* .accordion__content { |
55 | 55 | border-color: var(--fds-semantic-border-neutral-strong);
|
56 | 56 | }
|
| 57 | + */ |
57 | 58 |
|
58 |
| - .item:where(.open) .expandIcon { |
| 59 | + .accordion__item:where(.accordion__item--open) .accordion__expand-icon { |
59 | 60 | transform: rotateZ(180deg);
|
60 | 61 | }
|
61 | 62 |
|
62 |
| - .neutral, |
63 |
| - .neutral .accordionButton { |
| 63 | + .accordion--neutral, |
| 64 | + .accordion--neutral .accordion__button { |
64 | 65 | background-color: var(--fds-semantic-surface-neutral-default);
|
65 | 66 | }
|
66 | 67 |
|
67 |
| - .subtle, |
68 |
| - .subtle .accordionButton { |
| 68 | + .accordion--subtle, |
| 69 | + .accordion--subtle .accordion__button { |
69 | 70 | background-color: var(--fds-semantic-surface-neutral-subtle);
|
70 | 71 | }
|
71 | 72 |
|
72 |
| - .first, |
73 |
| - .first .accordionButton { |
| 73 | + .accordion--first, |
| 74 | + .accordion--first .accordion__button { |
74 | 75 | --fds-accordion-border-color: var(--fds-semantic-border-first-default);
|
75 | 76 |
|
76 | 77 | background: var(--fds-semantic-surface-first-light);
|
77 | 78 | }
|
78 | 79 |
|
79 |
| - .second, |
80 |
| - .second .accordionButton { |
| 80 | + |
| 81 | + .accordion--second, |
| 82 | + .accordion--second .accordion__button { |
81 | 83 | --fds-accordion-border-color: var(--fds-semantic-border-second-default);
|
82 | 84 |
|
83 | 85 | background: var(--fds-semantic-surface-second-light);
|
84 | 86 | }
|
85 | 87 |
|
86 |
| - .third, |
87 |
| - .third .accordionButton { |
| 88 | + |
| 89 | + .accordion--third, |
| 90 | + .accordion--third .accordion__button { |
88 | 91 | --fds-accordion-border-color: var(--fds-semantic-border-third-default);
|
89 | 92 |
|
90 | 93 | background: var(--fds-semantic-surface-third-light);
|
91 | 94 | }
|
92 | 95 |
|
93 |
| - .first .item:where(.open) .accordionButton, |
94 |
| - .second .item:where(.open) .accordionButton, |
95 |
| - .third .item:where(.open) .accordionButton { |
| 96 | + .accordion--first .accordion__item:where(.accordion__item--open) .accordion__button, |
| 97 | + .accordion--second .accordion__item:where(.accordion__item--open) .accordion__button, |
| 98 | + .accordion--third .accordion__item:where(.accordion__item--open) .accordion__button { |
96 | 99 | background-color: rgba(0 0 0 / 0.03);
|
97 | 100 | }
|
98 | 101 |
|
99 |
| - .neutral .item:where(.open) .accordionButton, |
100 |
| - .subtle .item:where(.open) .accordionButton { |
| 102 | + .accordion--neutral .accordion__item:where(.accordion__item--open) .accordion__button, |
| 103 | + .accordion--subtle .accordion__item:where(.accordion__item--open) .accordion__button { |
101 | 104 | background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
|
102 | 105 | }
|
103 | 106 |
|
104 |
| - .border .item:first-child .accordionButton { |
| 107 | + .accordion--border .accordion__item:first-child .accordion__button { |
105 | 108 | border-top: 0;
|
106 | 109 | }
|
107 | 110 |
|
108 |
| - .first .item:not(:first-child) .accordionButton, |
109 |
| - .second .item:not(:first-child) .accordionButton, |
110 |
| - .third .item:not(:first-child) .accordionButton { |
| 111 | + .accordion--first .accordion__item:not(:first-child) .accordion__button, |
| 112 | + .accordion--second .accordion__item:not(:first-child) .accordion__button, |
| 113 | + .accordion--third .accordion__item:not(:first-child) .accordion__button { |
111 | 114 | border-top: 1px solid var(--fds-semantic-surface-neutral-default);
|
112 | 115 | }
|
113 | 116 |
|
114 | 117 | @media (hover: hover) and (pointer: fine) {
|
115 |
| - .accordionButton:hover .expandIcon { |
| 118 | + .accordion__button:hover .accordion__expand-icon { |
116 | 119 | background-color: rgba(0 0 0 / 0.1);
|
117 | 120 | }
|
118 | 121 |
|
119 |
| - .neutral .accordionButton:hover, |
120 |
| - .subtle .accordionButton:hover { |
| 122 | + .accordion--neutral .accordion__button:hover, |
| 123 | + .accordion--subtle .accordion__button:hover { |
121 | 124 | background-color: var(--fds-semantic-surface-neutral-subtle-hover);
|
122 | 125 | }
|
123 | 126 |
|
124 |
| - .first .accordionButton:hover { |
| 127 | + .accordion--first .accordion__button:hover { |
125 | 128 | background-color: var(--fds-semantic-surface-first-light-hover);
|
126 | 129 | }
|
127 | 130 |
|
128 |
| - .second .accordionButton:hover { |
| 131 | + .accordion--second .accordion__button:hover { |
129 | 132 | background-color: var(--fds-semantic-surface-second-light-hover);
|
130 | 133 | }
|
131 | 134 |
|
132 |
| - .third .accordionButton:hover { |
| 135 | + .accordion--third .accordion__button:hover { |
133 | 136 | background-color: var(--fds-semantic-surface-third-light-hover);
|
134 | 137 | }
|
135 | 138 | }
|
136 |
| -
|
137 |
| - */ |
138 | 139 | }
|
0 commit comments