@microsoft/atlas-css 3.8.2 → 3.9.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/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
- package/src/atomics/README.md +5 -3
- package/src/atomics/index.scss +1 -0
- package/src/atomics/width.scss +44 -0
- package/src/components/checkbox.scss +114 -0
- package/src/components/index.scss +1 -0
- package/src/core/bare-elements.scss +2 -1
- package/src/mixins/index.scss +1 -0
- package/src/mixins/visually-hidden.scss +12 -0
package/package.json
CHANGED
package/src/atomics/README.md
CHANGED
|
@@ -35,11 +35,13 @@ While CSS properties are straightfoward (they just match the CSS), the value pro
|
|
|
35
35
|
2. In some cases, such as themed colors values, values are associated concepts.
|
|
36
36
|
- Such as `primary` in the class `.color-primary`. (The `primary` is blue on light theme and yellow on high contrast theme.)
|
|
37
37
|
- Such as `semibold` in the class `font-weight-semibold`.
|
|
38
|
-
3. When a
|
|
38
|
+
3. When a value refers to a pixel value is involved we will just write out the number.
|
|
39
|
+
- Some width based classes use this approach. `width-100` means `width: 100px`.
|
|
40
|
+
4. When a em/rem value is involved, that value is typically represented as an at-least-two-letter-t-shirt size.
|
|
39
41
|
- Spacing and non-heading typography values follow this convention, as in `xs, sm, md, lg, xl, xxl` in `margin-top-xl`, and `font-size-md`.
|
|
40
42
|
- Within a set of values that require units such as the one above, 0 is represented by the string `none`.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
5. Within a series of values that are all unitless numbers, those numbers are used directly, as in `flex-grow: 1;` being represented by `flex-grow-1`.
|
|
44
|
+
6. When a shorthand property's value is multi-part, we choose a reasonable default and omit the value completely.
|
|
43
45
|
- In the case `border: 1px solid $border` the class becomes simply `.border`.
|
|
44
46
|
- In this case further modification would still be available.
|
|
45
47
|
|
package/src/atomics/index.scss
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
|
|
3
|
+
$universal-widths: auto, 100, 150, 200, 250, 300, 350 !default;
|
|
4
|
+
$mobile-incompatible-widths: 400, 450, unset !default;
|
|
5
|
+
$all-widths: list.join($universal-widths, $mobile-incompatible-widths);
|
|
6
|
+
|
|
7
|
+
// widths
|
|
8
|
+
|
|
9
|
+
.width-full {
|
|
10
|
+
width: 100% !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@each $width in $universal-widths {
|
|
14
|
+
$unit: if($width != auto, 'px', '');
|
|
15
|
+
.width-#{$width} {
|
|
16
|
+
width: #{$width}#{$unit} !important;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@include tablet {
|
|
21
|
+
.width-full-tablet {
|
|
22
|
+
width: 100% !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@each $width in $all-widths {
|
|
26
|
+
$unit: if($width != auto and $width != unset, 'px', '');
|
|
27
|
+
.width-#{$width}-tablet {
|
|
28
|
+
width: #{$width}#{$unit} !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@include desktop {
|
|
34
|
+
.width-full-desktop {
|
|
35
|
+
width: 100% !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@each $width in $all-widths {
|
|
39
|
+
$unit: if($width != auto and $width != unset, 'px', '');
|
|
40
|
+
.width-#{$width}-desktop {
|
|
41
|
+
width: #{$width}#{$unit} !important;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* stylelint-disable selector-max-specificity, max-nesting-depth, selector-no-qualifying-type */
|
|
2
|
+
|
|
3
|
+
$checkbox-border-radius: $radius-sm !default;
|
|
4
|
+
$checkbox-border-width: 0.0625em !default;
|
|
5
|
+
$checkbox-unchecked-border-color: $text !default;
|
|
6
|
+
$checkbox-color: $primary !default;
|
|
7
|
+
$checkbox-check-color: $primary-invert !default;
|
|
8
|
+
$checkbox-check-hover-color: $text-subtle !default;
|
|
9
|
+
$checkbox-size: 1.25em !default;
|
|
10
|
+
$checkbox-check-height: 0.75em !default;
|
|
11
|
+
$checkbox-check-top: 0.125em !default;
|
|
12
|
+
$checkbox-check-width: 0.3125em !default;
|
|
13
|
+
$checkbox-check-thickness: 0.0625em !default;
|
|
14
|
+
$checkbox-timing-function: $input-timing-function !default;
|
|
15
|
+
$checkbox-duration: $input-transition-duration !default;
|
|
16
|
+
$checkbox-spacing: $spacer-3 !default;
|
|
17
|
+
|
|
18
|
+
@mixin checkmark {
|
|
19
|
+
display: block;
|
|
20
|
+
position: absolute;
|
|
21
|
+
inset-block-start: $checkbox-check-top;
|
|
22
|
+
width: $checkbox-check-width;
|
|
23
|
+
height: $checkbox-check-height;
|
|
24
|
+
transform: rotate(45deg);
|
|
25
|
+
border: solid $checkbox-check-hover-color;
|
|
26
|
+
border-width: 0 $checkbox-check-thickness $checkbox-check-thickness 0;
|
|
27
|
+
content: '';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.checkbox {
|
|
31
|
+
display: flex;
|
|
32
|
+
position: relative;
|
|
33
|
+
align-items: center;
|
|
34
|
+
line-height: 1.25;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
|
|
37
|
+
.checkbox-check {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-shrink: 0;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
width: $checkbox-size;
|
|
43
|
+
height: $checkbox-size;
|
|
44
|
+
transition-duration: $checkbox-duration;
|
|
45
|
+
transition-property: background, border, border-color;
|
|
46
|
+
transition-timing-function: $checkbox-timing-function;
|
|
47
|
+
border: $checkbox-border-width solid $checkbox-unchecked-border-color;
|
|
48
|
+
border-radius: $checkbox-border-radius;
|
|
49
|
+
|
|
50
|
+
&:not(:last-child) {
|
|
51
|
+
margin-inline-end: 0.5rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&::before {
|
|
55
|
+
content: '\0020';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:hover .checkbox-check::before {
|
|
60
|
+
@include checkmark;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.checkbox-sm {
|
|
64
|
+
font-size: $font-size-8;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
input[type='checkbox'] {
|
|
68
|
+
@include visually-hidden();
|
|
69
|
+
|
|
70
|
+
&:focus-visible + .checkbox-check {
|
|
71
|
+
@extend %focus;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:checked + .checkbox-check {
|
|
75
|
+
border-color: $checkbox-color;
|
|
76
|
+
background-color: $checkbox-color;
|
|
77
|
+
|
|
78
|
+
&::before {
|
|
79
|
+
@include checkmark;
|
|
80
|
+
|
|
81
|
+
border-color: $checkbox-check-color;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&[disabled] + .checkbox-check {
|
|
86
|
+
opacity: 0.6;
|
|
87
|
+
cursor: not-allowed;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.checkbox-muted {
|
|
92
|
+
input[type='checkbox'] {
|
|
93
|
+
&:checked + .checkbox-check {
|
|
94
|
+
border-color: $text-subtle;
|
|
95
|
+
background-color: $text-subtle;
|
|
96
|
+
|
|
97
|
+
&::before {
|
|
98
|
+
border-color: $text-invert;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.checkbox-check.is-checked {
|
|
105
|
+
border-color: $checkbox-color;
|
|
106
|
+
background-color: $checkbox-color;
|
|
107
|
+
|
|
108
|
+
&::before {
|
|
109
|
+
@include checkmark;
|
|
110
|
+
|
|
111
|
+
border-color: $checkbox-check-color;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
package/src/mixins/index.scss
CHANGED