primer_view_components 0.0.113 → 0.0.114

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,557 +0,0 @@
1
- /* btn */
2
-
3
- /* Base button styles */
4
- .btn {
5
- position: relative;
6
- display: inline-block;
7
- padding: 5px var(--primer-control-medium-paddingInline-spacious, 16px);
8
- font-size: var(--primer-text-body-size-medium, 14px);
9
- font-weight: var(--base-text-weight-medium, 500);
10
- line-height: 20px; /* Specifically not inherit our `<body>` default */
11
- white-space: nowrap;
12
- vertical-align: middle;
13
- cursor: pointer;
14
- user-select: none;
15
- border: var(--primer-borderWidth-thin, 1px) solid;
16
- border-radius: var(--primer-borderRadius-medium, 6px);
17
- appearance: none; /* Corrects inability to style clickable `input` types in iOS. */
18
-
19
- &:hover {
20
- text-decoration: none;
21
- }
22
-
23
- &:disabled,
24
- &.disabled,
25
- &[aria-disabled='true'] {
26
- cursor: default;
27
- }
28
-
29
- & i {
30
- font-style: normal;
31
- font-weight: var(--base-text-weight-medium, 500);
32
- opacity: 0.75;
33
- }
34
-
35
- & .octicon {
36
- margin-right: var(--primer-control-small-gap, 4px);
37
- color: var(--color-fg-muted);
38
- vertical-align: text-bottom;
39
-
40
- &:only-child {
41
- margin-right: 0;
42
- }
43
- }
44
-
45
- & .Counter {
46
- margin-left: 2px;
47
- color: inherit;
48
- text-shadow: none;
49
- vertical-align: top;
50
- background-color: var(--color-btn-counter-bg);
51
- }
52
-
53
- & .dropdown-caret {
54
- margin-left: var(--primer-control-small-gap, 4px);
55
- opacity: 0.8;
56
- }
57
-
58
- /* Default button */
59
-
60
- color: var(--color-btn-text);
61
- background-color: var(--color-btn-bg);
62
- border-color: var(--color-btn-border);
63
- box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
64
- transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
65
- transition-property: color, background-color, box-shadow, border-color;
66
-
67
- &:hover,
68
- &.hover,
69
- & [open] > & {
70
- background-color: var(--color-btn-hover-bg);
71
- border-color: var(--color-btn-hover-border);
72
- transition-duration: 0.1s;
73
- }
74
-
75
- &:active {
76
- background-color: var(--color-btn-active-bg);
77
- border-color: var(--color-btn-active-border);
78
- transition: none;
79
- }
80
-
81
- &.selected,
82
- &[aria-selected='true'] {
83
- background-color: var(--color-btn-selected-bg);
84
- box-shadow: var(--color-primer-shadow-inset);
85
- }
86
-
87
- &.disabled,
88
- &[aria-disabled='true'] {
89
- color: var(--color-primer-fg-disabled);
90
- background-color: var(--color-btn-bg);
91
- border-color: var(--color-btn-border);
92
-
93
- & .octicon {
94
- color: var(--color-primer-fg-disabled);
95
- }
96
- }
97
- }
98
-
99
- /* Primary button */
100
-
101
- .btn-primary {
102
- color: var(--color-btn-primary-text);
103
- background-color: var(--color-btn-primary-bg);
104
- border-color: var(--color-btn-primary-border);
105
- box-shadow: var(--color-btn-primary-shadow), var(--color-btn-primary-inset-shadow);
106
-
107
- &:hover,
108
- &.hover,
109
- & [open] > & {
110
- background-color: var(--color-btn-primary-hover-bg);
111
- border-color: var(--color-btn-primary-hover-border);
112
- }
113
-
114
- /* fallback :focus state */
115
- &:focus {
116
- @mixin focusOutlineOnEmphasis;
117
-
118
- /* remove fallback :focus if :focus-visible is supported */
119
- &:not(:focus-visible) {
120
- outline: solid 1px transparent;
121
- box-shadow: none;
122
- }
123
- }
124
-
125
- /* default focus state */
126
- &:focus-visible {
127
- @mixin focusOutlineOnEmphasis;
128
- }
129
-
130
- &:active,
131
- &.selected,
132
- &[aria-selected='true'] {
133
- background-color: var(--color-btn-primary-selected-bg);
134
- box-shadow: var(--color-btn-primary-selected-shadow);
135
- }
136
-
137
- &:disabled,
138
- &.disabled,
139
- &[aria-disabled='true'] {
140
- color: var(--color-btn-primary-disabled-text);
141
- background-color: var(--color-btn-primary-disabled-bg);
142
- border-color: var(--color-btn-primary-disabled-border);
143
-
144
- & .octicon {
145
- color: var(--color-btn-primary-disabled-text);
146
- }
147
- }
148
-
149
- & .Counter {
150
- color: inherit;
151
- background-color: var(--color-btn-primary-counter-bg);
152
- }
153
-
154
- & .octicon {
155
- color: var(--color-btn-primary-icon);
156
- }
157
- }
158
-
159
- /* ensure links styled as button primary gets proper focus style */
160
- a.btn-primary {
161
- /* fallback :focus state */
162
- &:focus {
163
- @mixin focusOutlineOnEmphasis;
164
-
165
- /* remove fallback :focus if :focus-visible is supported */
166
- &:not(:focus-visible) {
167
- outline: solid 1px transparent;
168
- box-shadow: none;
169
- }
170
- }
171
-
172
- /* default focus state */
173
- &:focus-visible {
174
- @mixin focusOutlineOnEmphasis;
175
- }
176
- }
177
-
178
- /* Outline button */
179
-
180
- .btn-outline {
181
- color: var(--color-btn-outline-text);
182
-
183
- &:hover,
184
- & [open] > & {
185
- color: var(--color-btn-outline-hover-text);
186
- background-color: var(--color-btn-outline-hover-bg);
187
- border-color: var(--color-btn-outline-hover-border);
188
- box-shadow: var(--color-btn-outline-hover-shadow), var(--color-btn-outline-hover-inset-shadow);
189
-
190
- & .Counter {
191
- background-color: var(--color-btn-outline-hover-counter-bg);
192
- }
193
-
194
- & .octicon {
195
- color: inherit;
196
- }
197
- }
198
-
199
- &:active,
200
- &.selected,
201
- &[aria-selected='true'] {
202
- color: var(--color-btn-outline-selected-text);
203
- background-color: var(--color-btn-outline-selected-bg);
204
- border-color: var(--color-btn-outline-selected-border);
205
- box-shadow: var(--color-btn-outline-selected-shadow);
206
-
207
- /* fallback :focus state */
208
- &:focus {
209
- @mixin focusOutlineOnEmphasis;
210
-
211
- /* remove fallback :focus if :focus-visible is supported */
212
- &:not(:focus-visible) {
213
- outline: solid 1px transparent;
214
- box-shadow: none;
215
- }
216
- }
217
-
218
- /* default focus state */
219
- &:focus-visible {
220
- @mixin focusOutlineOnEmphasis;
221
- }
222
- }
223
-
224
- &:disabled,
225
- &.disabled,
226
- &[aria-disabled='true'] {
227
- color: var(--color-btn-outline-disabled-text);
228
- background-color: var(--color-btn-outline-disabled-bg);
229
- border-color: var(--color-btn-border);
230
- box-shadow: none;
231
-
232
- & .Counter {
233
- background-color: var(--color-btn-outline-disabled-counter-bg);
234
- }
235
- }
236
-
237
- & .Counter {
238
- color: inherit;
239
- background-color: var(--color-btn-outline-counter-bg);
240
- }
241
- }
242
-
243
- /* Danger button */
244
-
245
- .btn-danger {
246
- color: var(--color-btn-danger-text);
247
-
248
- & .octicon {
249
- color: var(--color-btn-danger-icon);
250
- }
251
-
252
- &:hover,
253
- & [open] > & {
254
- color: var(--color-btn-danger-hover-text);
255
- background-color: var(--color-btn-danger-hover-bg);
256
- border-color: var(--color-btn-danger-hover-border);
257
- box-shadow: var(--color-btn-danger-hover-shadow), var(--color-btn-danger-hover-inset-shadow);
258
-
259
- & .Counter {
260
- background-color: var(--color-btn-danger-hover-counter-bg);
261
- }
262
-
263
- & .octicon {
264
- color: var(--color-btn-danger-hover-icon);
265
- }
266
- }
267
-
268
- &:active,
269
- &.selected,
270
- &[aria-selected='true'] {
271
- color: var(--color-btn-danger-selected-text);
272
- background-color: var(--color-btn-danger-selected-bg);
273
- border-color: var(--color-btn-danger-selected-border);
274
- box-shadow: var(--color-btn-danger-selected-shadow);
275
- }
276
-
277
- &:disabled,
278
- &.disabled,
279
- &[aria-disabled='true'] {
280
- color: var(--color-btn-danger-disabled-text);
281
- background-color: var(--color-btn-danger-disabled-bg);
282
- border-color: var(--color-btn-border);
283
- box-shadow: none;
284
-
285
- & .Counter {
286
- background-color: var(--color-btn-danger-disabled-counter-bg);
287
- }
288
-
289
- & .octicon {
290
- color: var(--color-btn-danger-disabled-text);
291
- }
292
- }
293
-
294
- & .Counter {
295
- color: inherit;
296
- background-color: var(--color-btn-danger-counter-bg);
297
- }
298
- }
299
-
300
- /* Sizes
301
- **
302
- ** Tweak `line-height` to make them smaller. */
303
- .btn-sm {
304
- padding: 3px 12px;
305
- font-size: var(--primer-text-body-size-small, 12px);
306
- line-height: 20px;
307
-
308
- & .octicon {
309
- vertical-align: text-top;
310
- }
311
- }
312
-
313
- /* Large button adds more padding around text. Use font-size utils to increase font-size..
314
- ** e.g, <p class="text-gamma"><button class="btn btn-large btn-primary" type="button">Big green button</button></p> */
315
- .btn-large {
316
- padding: 0.75em 1.5em;
317
- font-size: inherit;
318
- line-height: 1.5;
319
- border-radius: 0.5em;
320
- }
321
-
322
- /* Full-width button
323
- **
324
- ** These buttons expand to the full width of their parent container */
325
- .btn-block {
326
- display: block;
327
- width: 100%;
328
- text-align: center;
329
- }
330
-
331
-
332
- /* Link-like buttons
333
- **
334
- ** This class is for styling <button> and <input> elements to look like links */
335
-
336
- .btn-link {
337
- display: inline-block;
338
- padding: 0;
339
- font-size: inherit;
340
- color: var(--color-accent-fg);
341
- text-decoration: none;
342
- white-space: nowrap;
343
- cursor: pointer;
344
- user-select: none;
345
- background-color: transparent;
346
- border: 0;
347
- appearance: none; /* Corrects inability to style clickable `input` types in iOS. */
348
-
349
- &:hover {
350
- text-decoration: underline;
351
- }
352
-
353
- &:disabled,
354
- &[aria-disabled='true'] {
355
- &,
356
- &:hover {
357
- color: var(--color-primer-fg-disabled);
358
- cursor: default;
359
- }
360
- }
361
-
362
- &:not(.dropdown-item) {
363
- &:focus,
364
- &:focus-visible {
365
- border-radius: var(--primer-borderRadius-medium, 6px);
366
- outline-offset: 0;
367
- }
368
- }
369
- }
370
-
371
- /* Invisible button
372
- **
373
- ** Typically used as a "cancel" button next to a .btn */
374
-
375
- .btn-invisible {
376
- color: var(--color-accent-fg);
377
- background-color: transparent; /* Reset default gradient backgrounds and colors */
378
- border: 0;
379
- border-radius: var(--primer-borderRadius-medium, 6px);
380
- box-shadow: none;
381
-
382
- &:hover,
383
- &.zeroclipboard-is-hover {
384
- color: var(--color-accent-fg);
385
- background-color: var(--color-btn-hover-bg);
386
- outline: none;
387
- box-shadow: none;
388
- }
389
-
390
- &:active,
391
- &.selected,
392
- &[aria-selected='true'],
393
- &.zeroclipboard-is-active {
394
- color: var(--color-accent-fg);
395
- background: none;
396
- border-color: var(--color-btn-active-border);
397
-
398
- @mixin focusOutline;
399
- }
400
-
401
- &:active &.zeroclipboard-is-active {
402
- background-color: var(--color-btn-selected-bg);
403
- }
404
-
405
- &:disabled,
406
- &.disabled,
407
- &[aria-disabled='true'] {
408
- color: var(--color-primer-fg-disabled);
409
- background-color: transparent;
410
- }
411
- }
412
-
413
- /* Octicon button
414
- **
415
- ** Icon-only buttons */
416
-
417
- .btn-octicon {
418
- display: inline-block;
419
- padding: 5px;
420
- margin-left: 5px;
421
- line-height: 1;
422
- color: var(--color-fg-muted);
423
- vertical-align: middle;
424
-
425
- /* For `<button>` elements */
426
- background: transparent;
427
- border: 0;
428
- box-shadow: none;
429
-
430
- &:hover {
431
- color: var(--color-accent-fg);
432
- }
433
-
434
- &:focus,
435
- &:focus-visible {
436
- border-radius: var(--primer-borderRadius-medium, 6px);
437
- }
438
-
439
- &.disabled,
440
- &[aria-disabled='true'] {
441
- color: var(--color-primer-fg-disabled);
442
- cursor: default;
443
-
444
- &:hover {
445
- color: var(--color-primer-fg-disabled);
446
- }
447
- }
448
- }
449
-
450
- .btn-octicon-danger:hover {
451
- color: var(--color-danger-fg);
452
- }
453
-
454
- /* Close button
455
- **
456
- ** Typically used with an octicon-x */
457
-
458
- .close-button {
459
- padding: 0;
460
- color: var(--color-fg-muted);
461
- background: transparent;
462
- border: 0;
463
-
464
- &:hover {
465
- color: var(--color-fg-default);
466
- }
467
-
468
- &:active {
469
- @mixin focusOutline;
470
- }
471
- }
472
-
473
- /* Hidden text button
474
- **
475
- ** Use `.hidden-text-expander` to indicate and expand hidden text. */
476
-
477
- .hidden-text-expander {
478
- display: block;
479
-
480
- &.inline {
481
- position: relative;
482
- top: -1px;
483
- display: inline-block;
484
- margin-left: 5px;
485
- line-height: 0;
486
- }
487
- }
488
-
489
- .hidden-text-expander a,
490
- .ellipsis-expander {
491
- display: inline-block;
492
- height: 12px;
493
- padding: 0 5px 5px;
494
- font-size: var(--primer-text-body-size-small, 12px);
495
- font-weight: var(--base-text-weight-semibold, 600);
496
- line-height: 6px;
497
- color: var(--color-fg-default);
498
- text-decoration: none;
499
- vertical-align: middle;
500
- background: var(--color-neutral-muted);
501
- border: 0;
502
- border-radius: 1px;
503
-
504
- &:hover {
505
- text-decoration: none;
506
- background-color: var(--color-accent-muted);
507
- }
508
-
509
- &:active {
510
- color: var(--color-fg-on-emphasis);
511
- background-color: var(--color-accent-emphasis);
512
- }
513
- }
514
-
515
- /* Social button count
516
- ** TODO: Deprecate? Use BtnGroup instead? */
517
-
518
- .btn-with-count {
519
- float: left;
520
- border-top-right-radius: 0;
521
- border-bottom-right-radius: 0;
522
-
523
- &:focus {
524
- z-index: 1;
525
- }
526
- }
527
-
528
- /* Social count bubble
529
- **
530
- ** A container that is used for social bubbles counts. */
531
-
532
- .social-count {
533
- position: relative;
534
- float: left;
535
- padding: 3px 12px;
536
- font-size: var(--primer-text-body-size-small, 12px);
537
- font-weight: var(--base-text-weight-semibold, 600);
538
- line-height: 20px;
539
- color: var(--color-fg-default);
540
- vertical-align: middle;
541
- background-color: var(--color-canvas-default);
542
- border: var(--primer-borderWidth-thin, 1px) solid var(--color-btn-border);
543
- border-left: 0;
544
- border-top-right-radius: var(--primer-borderRadius-medium, 6px);
545
- border-bottom-right-radius: var(--primer-borderRadius-medium, 6px);
546
- box-shadow: var(--color-shadow-small), var(--color-primer-shadow-highlight);
547
-
548
- &:hover,
549
- &:active {
550
- text-decoration: none;
551
- }
552
-
553
- &:hover {
554
- color: var(--color-accent-fg);
555
- cursor: pointer;
556
- }
557
- }