1
1
import { ThemingParameters } from '@ui5/webcomponents-react-base' ;
2
2
3
3
const createInvertedValueStateStyles = ( baseColor : string ) => ( {
4
+ textShadow : ThemingParameters . sapContent_ContrastTextShadow ,
4
5
background : ThemingParameters [ `${ baseColor } _Background` ] ,
5
6
color : ThemingParameters [ `${ baseColor } _TextColor` ] ,
6
7
'& [ui5-icon]' : {
@@ -23,6 +24,7 @@ const createInvertedValueStateStyles = (baseColor: string) => ({
23
24
} ) ;
24
25
25
26
const createInvertedIndicationStyles = ( baseColor : string ) => ( {
27
+ textShadow : ThemingParameters . sapContent_ContrastTextShadow ,
26
28
color : ThemingParameters [ `${ baseColor } _TextColor` ] ,
27
29
backgroundColor : ThemingParameters [ `${ baseColor } ` ] ,
28
30
'& [ui5-icon]' : {
@@ -44,7 +46,32 @@ const styles = {
44
46
position : 'relative' ,
45
47
display : 'inline-block' ,
46
48
verticalAlign : 'top' ,
47
- width : 'fit-content'
49
+ width : 'fit-content' ,
50
+ textShadow : ThemingParameters . sapContent_TextShadow
51
+ } ,
52
+
53
+ active : {
54
+ cursor : 'pointer' ,
55
+ '&:not($inverted)' : {
56
+ '& $text' : {
57
+ textDecoration : 'underline'
58
+ } ,
59
+ '&:hover, &:active' : {
60
+ '& $text' : {
61
+ textDecoration : 'none'
62
+ }
63
+ } ,
64
+ '&:focus' : {
65
+ textShadow : 'none' ,
66
+ background : ThemingParameters . sapContent_FocusColor ,
67
+ color : ThemingParameters . sapContent_ContrastTextColor ,
68
+ borderRadius : '0.125rem' ,
69
+ outline : `0.125rem ${ ThemingParameters . sapContent_FocusColor } ` ,
70
+ '& [ui5-icon]' : {
71
+ color : ThemingParameters . sapContent_ContrastTextColor
72
+ }
73
+ }
74
+ }
48
75
} ,
49
76
50
77
icon : {
@@ -147,28 +174,28 @@ const styles = {
147
174
}
148
175
} ,
149
176
150
- active : {
151
- '&:hover, &:active' : {
152
- cursor : 'pointer' ,
153
- '&:not($inverted) $text, $icon:only-child' : {
154
- textDecoration : 'underline'
155
- }
156
- }
157
- } ,
158
-
159
177
inverted : {
160
178
height : 'auto' ,
161
179
minHeight : '1rem' ,
162
- minWidth : '1.25rem ' ,
163
- padding : '0.0625rem 0.25rem' ,
164
- borderRadius : ThemingParameters . sapElement_BorderCornerRadius ,
180
+ minWidth : '1.375rem ' ,
181
+ padding : '0.1875rem 0.25rem' ,
182
+ borderRadius : ThemingParameters . sapButton_BorderCornerRadius ,
165
183
fontFamily : ThemingParameters . sapFontBoldFamily ,
166
184
fontSize : ThemingParameters . sapFontSmallSize ,
167
185
'& [ui5-icon]' : {
168
- paddingTop : '0.125rem' ,
186
+ paddingBlockStart : '0.125rem' ,
169
187
width : ThemingParameters . sapFontSmallSize ,
170
188
height : ThemingParameters . sapFontSmallSize
171
189
} ,
190
+ '&[data-icon-only="true"]' : {
191
+ display : 'flex' ,
192
+ alignItems : 'center' ,
193
+ justifyContent : 'center' ,
194
+ padding : '0.1875rem 0.313rem'
195
+ } ,
196
+ '$active&:focus' : {
197
+ outline : `${ ThemingParameters . sapContent_FocusColor } ${ ThemingParameters . sapContent_FocusStyle } ${ ThemingParameters . sapContent_FocusWidth } `
198
+ } ,
172
199
'&$error' : createInvertedValueStateStyles ( 'sapButton_Negative' ) ,
173
200
'&$warning' : createInvertedValueStateStyles ( 'sapButton_Critical' ) ,
174
201
'&$success' : createInvertedValueStateStyles ( 'sapButton_Success' ) ,
0 commit comments