@papillonbits/css 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/primer/base/base.scss +63 -3
- package/build/primer/base/normalize.scss +12 -52
- package/build/primer/support/mixins/color-modes.scss +2 -0
- package/build/primer/support/mixins/layout.scss +1 -0
- package/build/primer/support/mixins/misc.scss +47 -1
- package/build/primer/support/variables/layout.scss +1 -0
- package/build/primer/utilities/details.scss +81 -4
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import "../support/variables/typography.scss";
|
|
2
2
|
@import "../support/variables/misc.scss";
|
|
3
3
|
|
|
4
|
-
// stylelint-disable selector-max-type
|
|
4
|
+
// stylelint-disable selector-max-type, selector-no-qualifying-type
|
|
5
5
|
* {
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
}
|
|
@@ -80,10 +80,70 @@ button {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
details {
|
|
83
|
-
summary {
|
|
83
|
+
summary {
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
}
|
|
84
86
|
|
|
85
87
|
&:not([open]) {
|
|
86
88
|
// Set details content hidden by default for browsers that don't do this
|
|
87
|
-
> *:not(summary) {
|
|
89
|
+
> *:not(summary) {
|
|
90
|
+
display: none !important;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// global focus styles
|
|
96
|
+
|
|
97
|
+
a,
|
|
98
|
+
button,
|
|
99
|
+
[role='button'],
|
|
100
|
+
input[type='radio'],
|
|
101
|
+
input[type='checkbox'] {
|
|
102
|
+
transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
|
|
103
|
+
transition-property: color, background-color, box-shadow, border-color;
|
|
104
|
+
// fallback :focus state
|
|
105
|
+
&:focus {
|
|
106
|
+
@include focusOutline;
|
|
107
|
+
|
|
108
|
+
// remove fallback :focus if :focus-visible is supported
|
|
109
|
+
&:not(:focus-visible) {
|
|
110
|
+
outline: solid 1px transparent;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// default focus state
|
|
115
|
+
&:focus-visible {
|
|
116
|
+
@include focusOutline;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
a:not([class]),
|
|
121
|
+
input[type='radio'],
|
|
122
|
+
input[type='checkbox'] {
|
|
123
|
+
&:focus,
|
|
124
|
+
&:focus-visible {
|
|
125
|
+
outline-offset: 0;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// for handling focus conditionally
|
|
130
|
+
.focus {
|
|
131
|
+
@include focusBoxShadowInset;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Windows High Contrast mode
|
|
135
|
+
@media (forced-colors: active) {
|
|
136
|
+
*:focus,
|
|
137
|
+
*:focus-visible {
|
|
138
|
+
outline: solid 1px transparent;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
input:not([type='radio'], [type='checkbox']),
|
|
142
|
+
textarea,
|
|
143
|
+
select {
|
|
144
|
+
&:focus,
|
|
145
|
+
&:focus-visible {
|
|
146
|
+
outline-offset: 2px;
|
|
147
|
+
}
|
|
88
148
|
}
|
|
89
149
|
}
|
|
@@ -39,7 +39,8 @@ header,
|
|
|
39
39
|
main, /* 2 */
|
|
40
40
|
menu,
|
|
41
41
|
nav,
|
|
42
|
-
section {
|
|
42
|
+
section {
|
|
43
|
+
/* 1 */
|
|
43
44
|
display: block;
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -96,16 +97,6 @@ a {
|
|
|
96
97
|
background-color: transparent; /* 1 */
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
/**
|
|
100
|
-
* Remove the outline on focused links when they are also active or hovered
|
|
101
|
-
* in all browsers (opinionated).
|
|
102
|
-
*/
|
|
103
|
-
|
|
104
|
-
a:active,
|
|
105
|
-
a:hover {
|
|
106
|
-
outline-width: 0;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
100
|
/* Text-level semantics
|
|
110
101
|
========================================================================== */
|
|
111
102
|
|
|
@@ -278,7 +269,8 @@ optgroup {
|
|
|
278
269
|
*/
|
|
279
270
|
|
|
280
271
|
button,
|
|
281
|
-
input {
|
|
272
|
+
input {
|
|
273
|
+
/* 1 */
|
|
282
274
|
overflow: visible;
|
|
283
275
|
}
|
|
284
276
|
|
|
@@ -288,7 +280,8 @@ input { /* 1 */
|
|
|
288
280
|
*/
|
|
289
281
|
|
|
290
282
|
button,
|
|
291
|
-
select {
|
|
283
|
+
select {
|
|
284
|
+
/* 1 */
|
|
292
285
|
text-transform: none;
|
|
293
286
|
}
|
|
294
287
|
|
|
@@ -305,29 +298,6 @@ html [type="button"], /* 1 */
|
|
|
305
298
|
-webkit-appearance: button; /* 2 */
|
|
306
299
|
}
|
|
307
300
|
|
|
308
|
-
/**
|
|
309
|
-
* Remove the inner border and padding in Firefox.
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
button::-moz-focus-inner,
|
|
313
|
-
[type="button"]::-moz-focus-inner,
|
|
314
|
-
[type="reset"]::-moz-focus-inner,
|
|
315
|
-
[type="submit"]::-moz-focus-inner {
|
|
316
|
-
border-style: none;
|
|
317
|
-
padding: 0;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Restore the focus styles unset by the previous rule.
|
|
322
|
-
*/
|
|
323
|
-
|
|
324
|
-
button:-moz-focusring,
|
|
325
|
-
[type="button"]:-moz-focusring,
|
|
326
|
-
[type="reset"]:-moz-focusring,
|
|
327
|
-
[type="submit"]:-moz-focusring {
|
|
328
|
-
outline: 1px dotted ButtonText;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
301
|
/**
|
|
332
302
|
* Change the border, margin, and padding in all browsers (opinionated).
|
|
333
303
|
*/
|
|
@@ -367,8 +337,8 @@ textarea {
|
|
|
367
337
|
* 2. Remove the padding in IE 10-.
|
|
368
338
|
*/
|
|
369
339
|
|
|
370
|
-
[type=
|
|
371
|
-
[type=
|
|
340
|
+
[type='checkbox'],
|
|
341
|
+
[type='radio'] {
|
|
372
342
|
box-sizing: border-box; /* 1 */
|
|
373
343
|
padding: 0; /* 2 */
|
|
374
344
|
}
|
|
@@ -377,27 +347,17 @@ textarea {
|
|
|
377
347
|
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
378
348
|
*/
|
|
379
349
|
|
|
380
|
-
[type=
|
|
381
|
-
[type=
|
|
350
|
+
[type='number']::-webkit-inner-spin-button,
|
|
351
|
+
[type='number']::-webkit-outer-spin-button {
|
|
382
352
|
height: auto;
|
|
383
353
|
}
|
|
384
354
|
|
|
385
|
-
/**
|
|
386
|
-
* 1. Correct the odd appearance in Chrome and Safari.
|
|
387
|
-
* 2. Correct the outline style in Safari.
|
|
388
|
-
*/
|
|
389
|
-
|
|
390
|
-
[type="search"] {
|
|
391
|
-
-webkit-appearance: textfield; /* 1 */
|
|
392
|
-
outline-offset: -2px; /* 2 */
|
|
393
|
-
}
|
|
394
|
-
|
|
395
355
|
/**
|
|
396
356
|
* Remove the inner padding and cancel buttons in Chrome and Safari on OS X.
|
|
397
357
|
*/
|
|
398
358
|
|
|
399
|
-
[type=
|
|
400
|
-
[type=
|
|
359
|
+
[type='search']::-webkit-search-cancel-button,
|
|
360
|
+
[type='search']::-webkit-search-decoration {
|
|
401
361
|
-webkit-appearance: none;
|
|
402
362
|
}
|
|
403
363
|
|
|
@@ -84,10 +84,12 @@
|
|
|
84
84
|
@each $name, $value in $color-map {
|
|
85
85
|
@each $type, $color in $value {
|
|
86
86
|
@if $type == dark {
|
|
87
|
+
// stylelint-disable-next-line function-no-unknown
|
|
87
88
|
$dark-colors: append($dark-colors, (--color-#{$name}, #{$color}));
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
@else {
|
|
92
|
+
// stylelint-disable-next-line function-no-unknown
|
|
91
93
|
$light-colors: append($light-colors, (--color-#{$name}, #{$color}));
|
|
92
94
|
}
|
|
93
95
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
&::after {
|
|
18
18
|
// stylelint-disable-next-line primer/spacing
|
|
19
|
-
margin-left:
|
|
19
|
+
margin-left: 2px;
|
|
20
20
|
background-color: var(--color-canvas-default);
|
|
21
21
|
background-image: linear-gradient($background, $background);
|
|
22
22
|
}
|
|
@@ -25,3 +25,49 @@
|
|
|
25
25
|
background-color: $border;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
// global focus styles
|
|
30
|
+
|
|
31
|
+
// inset box-shadow for form controls
|
|
32
|
+
@mixin focusBoxShadowInset($outlineWidth: 1px, $outlineColor: var(--color-accent-fg)) {
|
|
33
|
+
border-color: var(--color-accent-fg);
|
|
34
|
+
outline: none;
|
|
35
|
+
box-shadow: inset 0 0 0 $outlineWidth $outlineColor;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// box-shadow for :target styles (no inset)
|
|
39
|
+
// !important to override PCSS utilities
|
|
40
|
+
@mixin targetBoxShadow($outlineWidth: 2px, $outlineColor: var(--color-accent-fg)) {
|
|
41
|
+
outline: none !important;
|
|
42
|
+
box-shadow: 0 0 0 $outlineWidth $outlineColor !important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// outline
|
|
46
|
+
@mixin focusOutline($outlineOffset: -2px, $outlineColor: var(--color-accent-fg)) {
|
|
47
|
+
outline: 2px solid $outlineColor;
|
|
48
|
+
outline-offset: $outlineOffset;
|
|
49
|
+
box-shadow: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// outline with fg box-shadow for buttons
|
|
53
|
+
@mixin focusOutlineOnEmphasis($outlineOffset: -2px, $outlineColor: var(--color-accent-fg)) {
|
|
54
|
+
outline: 2px solid $outlineColor;
|
|
55
|
+
outline-offset: $outlineOffset;
|
|
56
|
+
box-shadow: inset 0 0 0 3px var(--color-fg-on-emphasis);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// if min-width is undefined, return only min-height
|
|
60
|
+
@mixin minTouchTarget($min-height: 32px, $min-width: '') {
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 50%;
|
|
63
|
+
left: 50%;
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
min-height: $min-height;
|
|
67
|
+
content: '';
|
|
68
|
+
transform: translateX(-50%) translateY(-50%);
|
|
69
|
+
|
|
70
|
+
@if $min-width != '' {
|
|
71
|
+
min-width: $min-width;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// stylelint-disable selector-max-type
|
|
1
|
+
// stylelint-disable selector-max-type, selector-max-specificity, max-nesting-depth, selector-no-qualifying-type
|
|
2
2
|
|
|
3
3
|
.details-overlay[open] > summary::before {
|
|
4
4
|
position: fixed;
|
|
@@ -20,9 +20,86 @@
|
|
|
20
20
|
|
|
21
21
|
.details-reset {
|
|
22
22
|
// Remove marker added by the display: list-item browser default
|
|
23
|
-
> summary {
|
|
23
|
+
> summary {
|
|
24
|
+
list-style: none;
|
|
25
|
+
transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
|
|
26
|
+
transition-property: color, background-color, box-shadow, border-color;
|
|
27
|
+
// fallback :focus state
|
|
28
|
+
&:focus {
|
|
29
|
+
@include focusOutline;
|
|
30
|
+
|
|
31
|
+
// remove fallback :focus if :focus-visible is supported
|
|
32
|
+
&:not(:focus-visible) {
|
|
33
|
+
outline: solid 1px transparent;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// default focus state
|
|
38
|
+
&:focus-visible {
|
|
39
|
+
@include focusOutline;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.btn-primary {
|
|
43
|
+
// fallback :focus state
|
|
44
|
+
&:focus {
|
|
45
|
+
@include focusOutlineOnEmphasis;
|
|
46
|
+
|
|
47
|
+
// remove fallback :focus if :focus-visible is supported
|
|
48
|
+
&:not(:focus-visible) {
|
|
49
|
+
outline: solid 1px transparent;
|
|
50
|
+
box-shadow: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// default focus state
|
|
55
|
+
&:focus-visible {
|
|
56
|
+
@include focusOutlineOnEmphasis;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
24
60
|
// Remove marker added by details polyfill
|
|
25
|
-
> summary::before {
|
|
61
|
+
> summary::before {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
26
64
|
// Remove marker added by Chrome
|
|
27
|
-
> summary::-webkit-details-marker {
|
|
65
|
+
> summary::-webkit-details-marker {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.details-overlay > summary {
|
|
71
|
+
transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
|
|
72
|
+
transition-property: color, background-color, box-shadow, border-color;
|
|
73
|
+
// fallback :focus state
|
|
74
|
+
&:focus {
|
|
75
|
+
@include focusOutline;
|
|
76
|
+
|
|
77
|
+
// remove fallback :focus if :focus-visible is supported
|
|
78
|
+
&:not(:focus-visible) {
|
|
79
|
+
outline: solid 1px transparent;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// default focus state
|
|
84
|
+
&:focus-visible {
|
|
85
|
+
@include focusOutline;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.btn-primary {
|
|
89
|
+
// fallback :focus state
|
|
90
|
+
&:focus {
|
|
91
|
+
@include focusOutlineOnEmphasis;
|
|
92
|
+
|
|
93
|
+
// remove fallback :focus if :focus-visible is supported
|
|
94
|
+
&:not(:focus-visible) {
|
|
95
|
+
outline: solid 1px transparent;
|
|
96
|
+
box-shadow: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// default focus state
|
|
101
|
+
&:focus-visible {
|
|
102
|
+
@include focusOutlineOnEmphasis;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
28
105
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papillonbits/css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Papillon Bits CSS",
|
|
5
5
|
"homepage": "https://github.com/papillonbits/papillonbits/tree/master/packages/css",
|
|
6
6
|
"repository": {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"build-acceptance": "npm run build",
|
|
24
24
|
"build-release": "npm run build"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "a1b80ef4af73c00ad9edddcaefbe25f3b8e1a9d8"
|
|
27
27
|
}
|