@@ -25,7 +25,6 @@ governing permissions and limitations under the License.
25
25
--spectrum-button-focus-indicator-color : var (--spectrum-focus-indicator-color );
26
26
}
27
27
28
-
29
28
.spectrum-Button--sizeS {
30
29
--spectrum-button-min-width : calc (var (--spectrum-component-height-75 ) * var (--spectrum-button-minimum-width-multiplier ));
31
30
@@ -40,6 +39,7 @@ governing permissions and limitations under the License.
40
39
--spectrum-button-padding-label-to-icon : var (--spectrum-text-to-visual-75 );
41
40
--spectrum-button-top-to-text : var (--spectrum-button-top-to-text-small );
42
41
--spectrum-button-bottom-to-text : var (--spectrum-button-bottom-to-text-small );
42
+ --spectrum-button-top-to-icon : var (--spectrum-component-top-to-workflow-icon-75 );
43
43
}
44
44
45
45
.spectrum-Button--sizeM {
@@ -56,6 +56,7 @@ governing permissions and limitations under the License.
56
56
--spectrum-button-padding-label-to-icon : var (--spectrum-text-to-visual-100 );
57
57
--spectrum-button-top-to-text : var (--spectrum-button-top-to-text-medium );
58
58
--spectrum-button-bottom-to-text : var (--spectrum-button-bottom-to-text-medium );
59
+ --spectrum-button-top-to-icon : var (--spectrum-component-top-to-workflow-icon-100 );
59
60
}
60
61
61
62
.spectrum-Button--sizeL {
@@ -72,6 +73,7 @@ governing permissions and limitations under the License.
72
73
--spectrum-button-padding-label-to-icon : var (--spectrum-text-to-visual-200 );
73
74
--spectrum-button-top-to-text : var (--spectrum-button-top-to-text-large );
74
75
--spectrum-button-bottom-to-text : var (--spectrum-button-bottom-to-text-large );
76
+ --spectrum-button-top-to-icon : var (--spectrum-component-top-to-workflow-icon-200 );
75
77
}
76
78
77
79
.spectrum-Button--sizeXL {
@@ -88,7 +90,7 @@ governing permissions and limitations under the License.
88
90
--spectrum-button-padding-label-to-icon : var (--spectrum-text-to-visual-300 );
89
91
--spectrum-button-top-to-text : var (--spectrum-button-top-to-text-extra-large );
90
92
--spectrum-button-bottom-to-text : var (--spectrum-button-bottom-to-text-extra-large );
91
-
93
+ --spectrum-button-top-to-icon : var ( --spectrum-component-top-to-workflow-icon-300 );
92
94
}
93
95
94
96
.spectrum-Button {
@@ -121,12 +123,17 @@ governing permissions and limitations under the License.
121
123
}
122
124
123
125
.spectrum-Icon {
126
+ margin-block-start : max (0px ,
127
+ var (--mod-button-top-to-icon , var (--spectrum-button-top-to-icon )) -
128
+ var (--mod-button-border-width , var (--spectrum-button-border-width ))
129
+ );
124
130
margin-inline-start : calc (
125
131
var (--mod-button-edge-to-visual , var (--spectrum-button-edge-to-visual )) -
126
132
var (--mod-button-edge-to-text , var (--spectrum-button-edge-to-text ))
127
133
);
128
134
color : inherit;
129
135
flex-shrink : 0 ;
136
+ align-self : flex-start;
130
137
}
131
138
132
139
/* correct focus indicator radius for t-shirt sizing */
@@ -140,7 +147,9 @@ governing permissions and limitations under the License.
140
147
border-radius : 50% ;
141
148
142
149
.spectrum-Icon {
150
+ align-self : center;
143
151
margin-inline-start : 0 ;
152
+ margin-block-start : 0 ;
144
153
}
145
154
146
155
& ::after {
@@ -159,6 +168,11 @@ a.spectrum-Button {
159
168
padding-block-end : calc (var (--mod-button-bottom-to-text , var (--spectrum-button-bottom-to-text )) - var (--mod-button-border-width , var (--spectrum-button-border-width )));
160
169
line-height : var (--mod-button-line-height , var (--spectrum-button-line-height ));
161
170
align-self : start;
171
+ text-align : var (--mod-button-text-align , center);
172
+ }
173
+
174
+ .spectrum-Button .spectrum-Icon + .spectrum-Button-label {
175
+ text-align : var (--mod-button-text-align-with-icon , start);
162
176
}
163
177
164
178
.spectrum-Button {
@@ -170,26 +184,22 @@ a.spectrum-Button {
170
184
}
171
185
}
172
186
173
- /* special cases for focus-ring */
187
+ /* Special cases for focus indicator */
174
188
.spectrum-Button {
175
189
transition : border-color var (--mod-button-animation-duration , var (--spectrum-button-animation-duration )) ease-in-out;
176
190
177
191
& ::after {
178
192
position : absolute;
179
193
inset : 0 ;
180
-
181
194
margin : calc ((var (--mod-button-focus-ring-gap , var (--spectrum-button-focus-ring-gap )) + var (--mod-button-border-width , var (--spectrum-button-border-width ))) * -1 );
182
-
183
195
border-radius : var (--mod-button-focus-ring-border-radius , var (--spectrum-button-focus-ring-border-radius ));
184
-
185
196
transition : box-shadow var (--mod-button-animation-duration , var (--spectrum-button-animation-duration )) ease-in-out;
186
-
187
197
pointer-events : none;
188
198
content : '' ;
189
199
}
190
200
191
201
& : focus-visible {
192
- /* kill the default ring */
202
+ /* Remove the default focus outline */
193
203
box-shadow : none;
194
204
outline : none;
195
205
@@ -202,7 +212,6 @@ a.spectrum-Button {
202
212
203
213
/* Core Token Theming */
204
214
/* former skin.css, applied / copied from actionbutton/index.css */
205
-
206
215
.spectrum-Button {
207
216
@inherit : %spectrum- BaseButto n;
208
217
@@ -236,7 +245,16 @@ a.spectrum-Button {
236
245
}
237
246
}
238
247
239
- /* windows high contrast mode over-writes for accent variant */
248
+ /* Static color variants */
249
+ .spectrum-Button--staticWhite {
250
+ --spectrum-button-focus-indicator-color : var (--mod-static-black-focus-indicator-color , var (--spectrum-static-black-focus-indicator-color ));
251
+ }
252
+
253
+ .spectrum-Button--staticBlack {
254
+ --spectrum-button-focus-indicator-color : var (--mod-static-black-focus-indicator-color , var (--spectrum-static-black-focus-indicator-color ));
255
+ }
256
+
257
+ /* Windows High Contrast Mode */
240
258
@media (forced-colors : active) {
241
259
.spectrum-Button {
242
260
--highcontrast-button-content-color-disabled : GrayText;
@@ -267,12 +285,3 @@ a.spectrum-Button {
267
285
}
268
286
}
269
287
}
270
-
271
- /* static variants */
272
- .spectrum-Button--staticWhite {
273
- --spectrum-button-focus-indicator-color : var (--mod-static-black-focus-indicator-color , var (--spectrum-static-black-focus-indicator-color ));
274
- }
275
-
276
- .spectrum-Button--staticBlack {
277
- --spectrum-button-focus-indicator-color : var (--mod-static-black-focus-indicator-color , var (--spectrum-static-black-focus-indicator-color ));
278
- }
0 commit comments