1
1
import { ThemingParameters } from '@ui5/webcomponents-react-base' ;
2
2
3
- const createInvertedValueStateStyles = ( baseColor : string ) => ( {
4
- textShadow : ThemingParameters . sapContent_ContrastTextShadow ,
3
+ const createInvertedValueStateStyles = ( baseColor : string , lightColor = false ) => ( {
4
+ textShadow : lightColor ? ThemingParameters . sapContent_TextShadow : ThemingParameters . sapContent_ContrastTextShadow ,
5
5
background : ThemingParameters [ `${ baseColor } _Background` ] ,
6
6
color : ThemingParameters [ `${ baseColor } _TextColor` ] ,
7
+ border : `0.0625rem solid ${ ThemingParameters [ `${ baseColor } _BorderColor` ] } ` ,
7
8
'& [ui5-icon]' : {
8
9
color : ThemingParameters [ `${ baseColor } _TextColor` ]
9
10
} ,
10
11
'&$active:hover' : {
11
12
background : ThemingParameters [ `${ baseColor } _Hover_Background` ] ,
12
13
color : ThemingParameters [ `${ baseColor } _Hover_TextColor` ] ,
14
+ border : `0.0625rem solid ${ ThemingParameters [ `${ baseColor } _Hover_BorderColor` ] } ` ,
13
15
'& [ui5-icon]' : {
14
16
color : ThemingParameters [ `${ baseColor } _Hover_TextColor` ]
15
17
}
16
18
} ,
17
19
'&$active:active' : {
20
+ textShadow : ThemingParameters . sapContent_TextShadow ,
18
21
background : ThemingParameters [ `${ baseColor } _Active_Background` ] ,
19
- color : ThemingParameters [ `${ baseColor } _Active_TextColor` ] ,
20
- '& [ui5-icon]' : {
21
- color : ThemingParameters [ `${ baseColor } _Active_TextColor` ]
22
- }
22
+ border : `0.0625rem solid ${ ThemingParameters [ `${ baseColor } _Active_BorderColor` ] } `
23
23
}
24
24
} ) ;
25
25
26
26
const createInvertedIndicationStyles = ( baseColor : string ) => ( {
27
27
textShadow : ThemingParameters . sapContent_ContrastTextShadow ,
28
28
color : ThemingParameters [ `${ baseColor } _TextColor` ] ,
29
- backgroundColor : ThemingParameters [ `${ baseColor } ` ] ,
29
+ backgroundColor : ThemingParameters [ `${ baseColor } _Background` ] ,
30
+ border : `0.0625rem solid ${ ThemingParameters [ `${ baseColor } _BorderColor` ] } ` ,
30
31
'& [ui5-icon]' : {
31
32
color : ThemingParameters [ `${ baseColor } _TextColor` ]
32
33
} ,
33
34
'&$active:hover' : {
34
35
background : ThemingParameters [ `${ baseColor } _Hover_Background` ]
35
36
} ,
36
37
'&$active:active' : {
37
- background : ThemingParameters [ `${ baseColor } _Active_Background` ]
38
+ textShadow : ThemingParameters . sapContent_TextShadow ,
39
+ background : ThemingParameters [ `${ baseColor } _Active_Background` ] ,
40
+ border : `0.0625rem solid ${ ThemingParameters [ `${ baseColor } _Active_BorderColor` ] } ` ,
41
+ color : ThemingParameters [ `${ baseColor } _Active_TextColor` ] ,
42
+ '& [ui5-icon]' : {
43
+ color : ThemingParameters [ `${ baseColor } _Active_TextColor` ]
44
+ }
38
45
}
39
46
} ) ;
40
47
@@ -82,10 +89,10 @@ const styles = {
82
89
lineHeight : '1rem' ,
83
90
verticalAlign : 'top' ,
84
91
paddingInlineEnd : '0.25rem' ,
85
-
86
92
'&[data-icon-only="true"]' : {
87
93
paddingInlineEnd : 0
88
- }
94
+ } ,
95
+ textShadow : ThemingParameters . sapContent_TextShadow
89
96
} ,
90
97
91
98
text : {
@@ -195,25 +202,81 @@ const styles = {
195
202
borderRadius : ThemingParameters . sapButton_BorderCornerRadius ,
196
203
fontFamily : ThemingParameters . sapFontBoldFamily ,
197
204
fontSize : ThemingParameters . sapFontSmallSize ,
198
- '& [ui5-icon]' : {
199
- paddingBlockStart : '0.125rem' ,
205
+ '& $icon' : {
206
+ verticalAlign : 'text-bottom'
207
+ } ,
208
+ '& [ui5-icon], $icon:not([data-icon-only="true"])' : {
200
209
width : ThemingParameters . sapFontSmallSize ,
201
210
height : ThemingParameters . sapFontSmallSize
202
211
} ,
203
212
'&[data-icon-only="true"]' : {
204
213
display : 'flex' ,
205
214
alignItems : 'center' ,
206
215
justifyContent : 'center' ,
207
- padding : '0.1875rem 0.313rem'
216
+ padding : '0.1875rem 0.313rem' ,
217
+ width : '1rem' ,
218
+ height : '1rem' ,
219
+ '& [ui5-icon]' : {
220
+ width : '1rem' ,
221
+ height : '1rem'
222
+ }
208
223
} ,
209
224
'$active&:focus' : {
210
225
outline : `${ ThemingParameters . sapContent_FocusColor } ${ ThemingParameters . sapContent_FocusStyle } ${ ThemingParameters . sapContent_FocusWidth } `
211
226
} ,
212
- '&$error' : createInvertedValueStateStyles ( 'sapButton_Negative' ) ,
213
- '&$warning' : createInvertedValueStateStyles ( 'sapButton_Critical' ) ,
214
- '&$success' : createInvertedValueStateStyles ( 'sapButton_Success' ) ,
215
- '&$information' : createInvertedValueStateStyles ( 'sapButton_Information' ) ,
216
- '&$none' : createInvertedValueStateStyles ( 'sapButton_Neutral' ) ,
227
+ '&$error' : {
228
+ ...createInvertedValueStateStyles ( 'sapButton_Negative' ) ,
229
+ '&$active:active' : {
230
+ ...createInvertedValueStateStyles ( 'sapButton_Negative' , true ) [ '&$active:active' ] ,
231
+ color : ThemingParameters . sapButton_Reject_Selected_TextColor ,
232
+ '& [ui5-icon]' : {
233
+ color : ThemingParameters . sapButton_Reject_Selected_TextColor
234
+ }
235
+ }
236
+ } ,
237
+ '&$warning' : {
238
+ ...createInvertedValueStateStyles ( 'sapButton_Critical' ) ,
239
+ '&$active:active' : {
240
+ ...createInvertedValueStateStyles ( 'sapButton_Critical' , true ) [ '&$active:active' ] ,
241
+ color : ThemingParameters . sapButton_Attention_Selected_TextColor ,
242
+ '& [ui5-icon]' : {
243
+ color : ThemingParameters . sapButton_Attention_Selected_TextColor
244
+ }
245
+ }
246
+ } ,
247
+ '&$success' : {
248
+ ...createInvertedValueStateStyles ( 'sapButton_Success' ) ,
249
+ '&$active:active' : {
250
+ ...createInvertedValueStateStyles ( 'sapButton_Success' , true ) [ '&$active:active' ] ,
251
+ color : ThemingParameters . sapButton_Accept_Selected_TextColor ,
252
+ '& [ui5-icon]' : {
253
+ color : ThemingParameters . sapButton_Accept_Selected_TextColor
254
+ }
255
+ }
256
+ } ,
257
+ '&$information' : {
258
+ ...createInvertedValueStateStyles ( 'sapButton_Information' , true ) ,
259
+ '&$active:active' : {
260
+ ...createInvertedValueStateStyles ( 'sapButton_Information' , true ) [ '&$active:active' ] ,
261
+ color : ThemingParameters . sapButton_Selected_TextColor ,
262
+ '& [ui5-icon]' : {
263
+ color : ThemingParameters . sapButton_Selected_TextColor
264
+ }
265
+ }
266
+ } ,
267
+ '&$none' : {
268
+ ...createInvertedValueStateStyles ( 'sapButton_Neutral' , true ) ,
269
+ background : ThemingParameters . sapNeutralBackground ,
270
+ color : ThemingParameters . sapTextColor ,
271
+ border : ThemingParameters . sapNeutralBorderColor ,
272
+ '&$active:active' : {
273
+ ...createInvertedValueStateStyles ( 'sapButton_Neutral' , true ) [ '&$active:active' ] ,
274
+ color : ThemingParameters . sapButton_Active_TextColor ,
275
+ '& [ui5-icon]' : {
276
+ color : ThemingParameters . sapButton_Active_TextColor
277
+ }
278
+ }
279
+ } ,
217
280
'&$indication01' : createInvertedIndicationStyles ( 'sapIndicationColor_1' ) ,
218
281
'&$indication02' : createInvertedIndicationStyles ( 'sapIndicationColor_2' ) ,
219
282
'&$indication03' : createInvertedIndicationStyles ( 'sapIndicationColor_3' ) ,
@@ -222,6 +285,43 @@ const styles = {
222
285
'&$indication06' : createInvertedIndicationStyles ( 'sapIndicationColor_6' ) ,
223
286
'&$indication07' : createInvertedIndicationStyles ( 'sapIndicationColor_7' ) ,
224
287
'&$indication08' : createInvertedIndicationStyles ( 'sapIndicationColor_8' )
288
+ } ,
289
+ large : {
290
+ fontSize : '1.5rem' ,
291
+ fontFamily : ThemingParameters . sapFontLightFamily ,
292
+ '& [ui5-icon], $icon' : {
293
+ height : '1.5rem' ,
294
+ width : '1.5rem'
295
+ } ,
296
+ '& $icon' : {
297
+ verticalAlign : 'middle'
298
+ } ,
299
+ '& $text' : {
300
+ lineHeight : 'normal' ,
301
+ verticalAlign : 'middle'
302
+ } ,
303
+ '&$inverted' : {
304
+ fontSize : '1.25rem' ,
305
+ fontFamily : ThemingParameters . sapFontSemiboldDuplexFamily ,
306
+ padding : '0.125rem 0.25rem' ,
307
+ '& [ui5-icon], $icon' : {
308
+ height : '1.25rem' ,
309
+ width : '1.25rem'
310
+ } ,
311
+ '&[data-icon-only="true"]' : {
312
+ padding : '0 0.25rem' ,
313
+ minWidth : '1.75rem' ,
314
+ height : 'auto'
315
+ } ,
316
+ '& [data-icon-only="true"]' : {
317
+ height : '1.5rem' ,
318
+ width : '1.5rem' ,
319
+ '& [ui5-icon]' : {
320
+ height : '1.5rem' ,
321
+ width : '1.5rem'
322
+ }
323
+ }
324
+ }
225
325
}
226
326
} ;
227
327
0 commit comments