@primer/css 21.0.6-rc.6e86b56a → 21.0.7-rc.771a68b5
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/CHANGELOG.md +6 -0
- package/dist/color-modes.css +1 -1
- package/dist/color-modes.css.map +1 -1
- package/dist/meta.json +75 -75
- package/dist/primer.css +1 -1
- package/dist/primer.css.map +1 -1
- package/dist/stats/color-modes.json +1 -1
- package/dist/stats/primer.json +1 -1
- package/package.json +1 -1
- package/support/mixins/color-modes.scss +64 -4
package/package.json
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
// This mixin is used to output the tokens/variables from Primitives
|
|
2
|
+
//
|
|
3
|
+
// Example:
|
|
4
|
+
//
|
|
5
|
+
// @include color-mode-theme(dark) {
|
|
6
|
+
// --color: black;
|
|
7
|
+
// }
|
|
8
|
+
//
|
|
9
|
+
// Warning!!!
|
|
10
|
+
// Don't use this mixin with a class. E.g.
|
|
11
|
+
// @include color-mode-theme(dark) {
|
|
12
|
+
// .my-class {
|
|
13
|
+
// color: red;
|
|
14
|
+
// }
|
|
15
|
+
// }
|
|
16
|
+
//
|
|
17
|
+
// The outputted `::selection .my-class` will make the selector invalid and the entire ruleset is disregarded.
|
|
18
|
+
// At some point we hopefully can remove the need for `&, &::selection {}` again (once the spec/implementation changes).
|
|
19
|
+
|
|
1
20
|
@mixin color-mode-theme($theme-name, $include-root: false) {
|
|
2
21
|
@if $include-root {
|
|
3
22
|
:root,
|
|
4
23
|
[data-color-mode="light"][data-light-theme="#{$theme-name}"],
|
|
5
24
|
[data-color-mode="dark"][data-dark-theme="#{$theme-name}"] {
|
|
6
|
-
|
|
25
|
+
&,
|
|
26
|
+
&::selection {
|
|
27
|
+
@content;
|
|
28
|
+
}
|
|
7
29
|
|
|
8
30
|
/*! */ // This is a fix for a cssstats bug see https://github.com/cssstats/cssstats/issues/331
|
|
9
31
|
}
|
|
@@ -12,23 +34,61 @@
|
|
|
12
34
|
@else {
|
|
13
35
|
[data-color-mode="light"][data-light-theme="#{$theme-name}"],
|
|
14
36
|
[data-color-mode="dark"][data-dark-theme="#{$theme-name}"] {
|
|
15
|
-
|
|
37
|
+
&,
|
|
38
|
+
&::selection {
|
|
39
|
+
@content;
|
|
40
|
+
}
|
|
16
41
|
}
|
|
17
42
|
}
|
|
18
43
|
|
|
19
44
|
@media (prefers-color-scheme: light) {
|
|
20
45
|
[data-color-mode="auto"][data-light-theme="#{$theme-name}"] {
|
|
21
|
-
|
|
46
|
+
&,
|
|
47
|
+
&::selection {
|
|
48
|
+
@content;
|
|
49
|
+
}
|
|
22
50
|
}
|
|
23
51
|
}
|
|
24
52
|
|
|
25
53
|
@media (prefers-color-scheme: dark) {
|
|
26
54
|
[data-color-mode="auto"][data-dark-theme="#{$theme-name}"] {
|
|
27
|
-
|
|
55
|
+
&,
|
|
56
|
+
&::selection {
|
|
57
|
+
@content;
|
|
58
|
+
}
|
|
28
59
|
}
|
|
29
60
|
}
|
|
30
61
|
}
|
|
31
62
|
|
|
63
|
+
// This mixin wraps styles with light or dark mode selectors
|
|
64
|
+
// If possible, use a color variable instead.
|
|
65
|
+
//
|
|
66
|
+
// Example:
|
|
67
|
+
//
|
|
68
|
+
// @include color-mode('dark') {
|
|
69
|
+
// .my-class {
|
|
70
|
+
// color: red;
|
|
71
|
+
// }
|
|
72
|
+
// }
|
|
73
|
+
//
|
|
74
|
+
// Returns:
|
|
75
|
+
//
|
|
76
|
+
// [data-color-mode=light][data-light-theme*=dark] .my-class,
|
|
77
|
+
// [data-color-mode=dark][data-dark-theme*=dark] .my-class {
|
|
78
|
+
// color: red;
|
|
79
|
+
// }
|
|
80
|
+
//
|
|
81
|
+
// @media (prefers-color-scheme: light) {
|
|
82
|
+
// [data-color-mode=auto][data-light-theme*=dark] .my-class {
|
|
83
|
+
// color: red;
|
|
84
|
+
// }
|
|
85
|
+
// }
|
|
86
|
+
// @media (prefers-color-scheme: dark) {
|
|
87
|
+
// [data-color-mode=auto][data-dark-theme*=dark] .my-class {
|
|
88
|
+
// color: red;
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
|
|
32
92
|
@mixin color-mode($mode) {
|
|
33
93
|
@if $mode == light {
|
|
34
94
|
:root,
|