|
14 | 14 | // 1. Change the font styles in all browsers
|
15 | 15 | // 2. Remove the margin on controls in Safari
|
16 | 16 | // 3. Show the overflow in Edge
|
17 |
| - button { |
| 17 | + #{$parent-selector} button { |
18 | 18 | margin: 0; // 2
|
19 | 19 | overflow: visible; // 3
|
20 | 20 | font-family: inherit; // 1
|
21 | 21 | text-transform: none; // 1
|
22 | 22 | }
|
23 | 23 |
|
24 | 24 | // Correct the inability to style buttons in iOS and Safari
|
25 |
| - button, |
26 |
| - [type="submit"], |
27 |
| - [type="reset"], |
28 |
| - [type="button"] { |
| 25 | + #{$parent-selector} button, |
| 26 | + #{$parent-selector} [type="submit"], |
| 27 | + #{$parent-selector} [type="reset"], |
| 28 | + #{$parent-selector} [type="button"] { |
29 | 29 | -webkit-appearance: button;
|
30 | 30 | }
|
31 | 31 |
|
32 | 32 | // Pico
|
33 | 33 | // ––––––––––––––––––––
|
34 | 34 |
|
35 |
| - button, |
36 |
| - [type="submit"], |
37 |
| - [type="reset"], |
38 |
| - [type="button"], |
39 |
| - [type="file"]::file-selector-button, |
40 |
| - [role="button"] { |
| 35 | + #{$parent-selector} button, |
| 36 | + #{$parent-selector} [type="submit"], |
| 37 | + #{$parent-selector} [type="reset"], |
| 38 | + #{$parent-selector} [type="button"], |
| 39 | + #{$parent-selector} [type="file"]::file-selector-button, |
| 40 | + #{$parent-selector} [role="button"] { |
41 | 41 | #{$css-var-prefix}background-color: var(#{$css-var-prefix}primary-background);
|
42 | 42 | #{$css-var-prefix}border-color: var(#{$css-var-prefix}primary-border);
|
43 | 43 | #{$css-var-prefix}color: var(#{$css-var-prefix}primary-inverse);
|
|
85 | 85 | }
|
86 | 86 | }
|
87 | 87 |
|
88 |
| - [type="submit"], |
89 |
| - [type="reset"], |
90 |
| - [type="button"] { |
| 88 | + #{$parent-selector} [type="submit"], |
| 89 | + #{$parent-selector} [type="reset"], |
| 90 | + #{$parent-selector} [type="button"] { |
91 | 91 | margin-bottom: var(#{$css-var-prefix}spacing);
|
92 | 92 | }
|
93 | 93 |
|
94 | 94 | // .secondary, .contrast & .outline
|
95 | 95 | @if $enable-classes {
|
96 | 96 | // Secondary
|
97 |
| - :is(button, [type="submit"], [type="button"], [role="button"]).secondary, |
98 |
| - [type="reset"], |
99 |
| - [type="file"]::file-selector-button { |
| 97 | + #{$parent-selector} :is(button, [type="submit"], [type="button"], [role="button"]).secondary, |
| 98 | + #{$parent-selector} [type="reset"], |
| 99 | + #{$parent-selector} [type="file"]::file-selector-button { |
100 | 100 | #{$css-var-prefix}background-color: var(#{$css-var-prefix}secondary-background);
|
101 | 101 | #{$css-var-prefix}border-color: var(#{$css-var-prefix}secondary-border);
|
102 | 102 | #{$css-var-prefix}color: var(#{$css-var-prefix}secondary-inverse);
|
|
117 | 117 | }
|
118 | 118 |
|
119 | 119 | // Contrast
|
120 |
| - :is(button, [type="submit"], [type="button"], [role="button"]).contrast { |
| 120 | + #{$parent-selector} :is(button, [type="submit"], [type="button"], [role="button"]).contrast { |
121 | 121 | #{$css-var-prefix}background-color: var(#{$css-var-prefix}contrast-background);
|
122 | 122 | #{$css-var-prefix}border-color: var(#{$css-var-prefix}contrast-border);
|
123 | 123 | #{$css-var-prefix}color: var(#{$css-var-prefix}contrast-inverse);
|
|
137 | 137 | }
|
138 | 138 |
|
139 | 139 | // Outline (primary)
|
140 |
| - :is(button, [type="submit"], [type="button"], [role="button"]).outline, |
| 140 | + #{$parent-selector} :is(button, [type="submit"], [type="button"], [role="button"]).outline, |
141 | 141 | [type="reset"].outline {
|
142 | 142 | #{$css-var-prefix}background-color: transparent;
|
143 | 143 | #{$css-var-prefix}color: var(#{$css-var-prefix}primary);
|
|
151 | 151 | }
|
152 | 152 |
|
153 | 153 | // Outline (secondary)
|
154 |
| - :is(button, [type="submit"], [type="button"], [role="button"]).outline.secondary, |
| 154 | + #{$parent-selector} |
| 155 | + :is(button, [type="submit"], [type="button"], [role="button"]).outline.secondary, |
155 | 156 | [type="reset"].outline {
|
156 | 157 | #{$css-var-prefix}color: var(#{$css-var-prefix}secondary);
|
157 | 158 | #{$css-var-prefix}border-color: var(#{$css-var-prefix}secondary);
|
|
163 | 164 | }
|
164 | 165 |
|
165 | 166 | // Outline (contrast)
|
166 |
| - :is(button, [type="submit"], [type="button"], [role="button"]).outline.contrast { |
| 167 | + #{$parent-selector} |
| 168 | + :is(button, [type="submit"], [type="button"], [role="button"]).outline.contrast { |
167 | 169 | #{$css-var-prefix}color: var(#{$css-var-prefix}contrast);
|
168 | 170 | #{$css-var-prefix}border-color: var(#{$css-var-prefix}contrast);
|
169 | 171 |
|
|
174 | 176 | }
|
175 | 177 | } @else {
|
176 | 178 | // Secondary button without .class
|
177 |
| - [type="reset"], |
178 |
| - [type="file"]::file-selector-button { |
| 179 | + #{$parent-selector} [type="reset"], |
| 180 | + #{$parent-selector} [type="file"]::file-selector-button { |
179 | 181 | #{$css-var-prefix}background-color: var(#{$css-var-prefix}secondary-background);
|
180 | 182 | #{$css-var-prefix}border-color: var(#{$css-var-prefix}secondary-border);
|
181 | 183 | #{$css-var-prefix}color: var(#{$css-var-prefix}secondary-inverse);
|
|
196 | 198 | }
|
197 | 199 |
|
198 | 200 | // Button [disabled]
|
199 |
| - :where(button, [type="submit"], [type="reset"], [type="button"], [role="button"])[disabled], |
200 |
| - :where(fieldset[disabled]) |
| 201 | + #{$parent-selector} |
| 202 | + :where(button, [type="submit"], [type="reset"], [type="button"], [role="button"])[disabled], |
| 203 | + #{$parent-selector} |
| 204 | + :where(fieldset[disabled]) |
201 | 205 | :is(button, [type="submit"], [type="button"], [type="reset"], [role="button"]) {
|
202 | 206 | opacity: 0.5;
|
203 | 207 | pointer-events: none;
|
|
0 commit comments