This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 8 files changed +143
-26
lines changed
shared/components/buttons/themes
8 files changed +143
-26
lines changed Original file line number Diff line number Diff line change 32
32
"lint:scss" : " ./node_modules/.bin/stylelint **/*.scss --syntax scss" ,
33
33
"test" : " npm run lint && npm run jest"
34
34
},
35
- "version" : " 0.5.1 " ,
35
+ "version" : " 0.5.2 " ,
36
36
"dependencies" : {
37
37
"react" : " ^16.4.1" ,
38
38
"react-css-super-themr" : " ^2.2.0" ,
Original file line number Diff line number Diff line change 4
4
5
5
@import " default" ;
6
6
7
- . button {
7
+ @mixin button {
8
8
background : $tc-red-70 ;
9
9
border-color : transparent ;
10
10
color : $tc-white ;
11
11
}
12
12
13
- .disabled {
13
+ .button.disabled {
14
+ @include button ;
15
+
14
16
background-color : $tc-gray-20 ;
15
17
opacity : 1 ;
16
18
}
17
19
18
- .link ,
19
- .regular {
20
+ .button.link ,
21
+ .button.regular {
22
+ @include button ;
23
+
20
24
& :visited {
21
25
color : $tc-white ;
22
26
}
Original file line number Diff line number Diff line change 7
7
8
8
@import " ~styles/mixins" ;
9
9
10
- /* General button style - medium size. */
11
- . button {
10
+ /* Generic button of medium size. */
11
+ @mixin button {
12
12
@include tc-label-lg ;
13
13
14
14
align-items : center ;
15
15
background : $tc-white ;
16
16
border : solid 1px $tc-gray-30 ;
17
17
border-radius : 4px ;
18
+ box-sizing : border-box ;
18
19
color : $tc-gray-80 ;
19
20
display : inline-flex ;
20
21
justify-content : center ;
21
22
min-height : 40px ;
22
23
margin : 5px ;
23
24
padding : 5px 23px ;
25
+ text-align : center ;
24
26
vertical-align : middle ;
25
27
}
26
28
29
+ /* NOTE: All CSS rules below use two classes, to have higher specifity, thus
30
+ * avoiding overriding of these rules by parent rules in some scenarious. */
31
+
27
32
/* Additional styling for a disabled button. */
28
- .disabled {
33
+ .button.disabled {
34
+ @include button ;
35
+
29
36
cursor : not-allowed ;
30
37
opacity : 0.3 ;
31
38
}
32
39
33
40
/* .link and .regular classes are applied only to active button-like links,
34
41
* and real buttons (rendered as <button> elements). */
35
- .link ,
36
- .regular {
42
+ .button.link ,
43
+ .button.regular {
44
+ @include button ;
45
+
37
46
/* To prevent different styling of the button-like link once it has been
38
47
* visited. */
39
48
& :visited {
63
72
64
73
/* And a few extra classes to support XS, SM and LG sizes. */
65
74
66
- .xs {
75
+ .button. xs {
67
76
@include tc-label-sm ;
68
77
69
78
border-radius : 2px ;
72
81
padding : 1px 13px ;
73
82
}
74
83
75
- .sm {
84
+ .button. sm {
76
85
@include tc-label-md ;
77
86
78
87
color : $tc-gray-80 ;
79
88
min-height : 30px ;
80
89
padding : 4px 18px ;
81
90
}
82
91
83
- .lg {
92
+ .button. lg {
84
93
@include tc-label-xl ;
85
94
86
95
color : $tc-gray-80 ;
Original file line number Diff line number Diff line change 4
4
5
5
@import " default" ;
6
6
7
- . button {
7
+ @mixin button {
8
8
background : transparent ;
9
9
border-color : transparent ;
10
10
color : $tc-dark-blue-110 ;
11
11
}
12
12
13
- .disabled {
13
+ .button.disabled {
14
+ @include button ;
15
+
14
16
color : $tc-gray-80 ;
15
17
}
16
18
17
- .link ,
18
- .regular {
19
+ .button.link ,
20
+ .button.regular {
21
+ @include button ;
22
+
19
23
& :visited {
20
24
color : $tc-dark-blue-110 ;
21
25
}
Original file line number Diff line number Diff line change 4
4
5
5
@import " default" ;
6
6
7
- . button {
7
+ @mixin button {
8
8
background : $tc-dark-blue ;
9
9
border-color : transparent ;
10
10
color : $tc-white ;
11
11
}
12
12
13
- .disabled {
13
+ .button.disabled {
14
+ @include button ;
15
+
14
16
background-color : $tc-gray-20 ;
15
17
opacity : 1 ;
16
18
}
17
19
18
- .link ,
19
- .regular {
20
+ .button.link ,
21
+ .button.regular {
22
+ @include button ;
23
+
20
24
& :visited {
21
25
color : $tc-white ;
22
26
}
Original file line number Diff line number Diff line change 4
4
5
5
@import " default" ;
6
6
7
- . button {
7
+ @mixin button {
8
8
background : $tc-gray-40 ;
9
9
border-color : transparent ;
10
10
color : $tc-white ;
11
11
}
12
12
13
- .disabled {
13
+ .button.disabled {
14
+ @include button ;
15
+
14
16
background-color : $tc-gray-20 ;
15
17
opacity : 1 ;
16
18
}
17
19
18
- .link ,
19
- .regular {
20
+ .button.link ,
21
+ .button.regular {
22
+ @include button ;
23
+
20
24
& :visited {
21
25
color : $tc-white ;
22
26
}
Original file line number Diff line number Diff line change 172
172
font-size : 42px ;
173
173
line-height : 50px ;
174
174
}
175
+
176
+ /* *
177
+ * Mixing of inline styles for a generic text block.
178
+ *
179
+ * TODO: In my understanding, it violates UI styleguides in various aspects,
180
+ * thus it is placed here for now, and not into UI Kit library. This code comes
181
+ * from challenges related to Contentful integration, ContentBlocks,
182
+ * in particular, that was done without a close watch on the design. It is
183
+ * separated into mixing, as other Contentful components also need inline
184
+ * styles, thus we at least should keep them consistent between different
185
+ * Contentful components, and later clean them all to match UI Kit.
186
+ */
187
+
188
+ @mixin tc-typography {
189
+ a { color : $tc-dark-blue ; }
190
+
191
+ a :active ,
192
+ a :focus ,
193
+ a :visited ,
194
+ a :hover {
195
+ color : $tc-dark-blue ;
196
+ }
197
+
198
+ em {
199
+ font-style : italic ;
200
+ }
201
+
202
+ h1 {
203
+ @include tc-heading-lg ;
204
+ }
205
+
206
+ h1 ,
207
+ h2 ,
208
+ h3 ,
209
+ h4 ,
210
+ h5 ,
211
+ h6 {
212
+ margin : 20px 0 10px ;
213
+ }
214
+
215
+ p {
216
+ @include tc-body-md ;
217
+
218
+ padding : 10px 0 ;
219
+ }
220
+
221
+ td ,
222
+ th {
223
+ @include tc-body-md ;
224
+ }
225
+
226
+ ul ,
227
+ ol {
228
+ @include tc-body-md ;
229
+
230
+ padding-left : 20px ;
231
+ }
232
+
233
+ ul {
234
+ list-style-type : disc ;
235
+ }
236
+
237
+ ol {
238
+ list-style-type : decimal ;
239
+ }
240
+
241
+ img {
242
+ max-width : 100% ;
243
+ }
244
+
245
+ code {
246
+ @include roboto-mono-regular ;
247
+
248
+ line-height : 1.5 ;
249
+ white-space : pre ;
250
+ }
251
+
252
+ sub ,
253
+ sup {
254
+ font-size : 75% ;
255
+ line-height : 0 ;
256
+ position : relative ;
257
+ vertical-align : baseline ;
258
+ }
259
+
260
+ sup { top : -0.5em ; }
261
+ sub { bottom : -0.25em ; }
262
+
263
+ strong {
264
+ font-weight : bold ;
265
+ }
266
+ }
You can’t perform that action at this time.
0 commit comments