@primer/css 0.0.0-202191417526 → 0.0.0-202191521542

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @primer/css
2
2
 
3
- ## 0.0.0-202191417526
3
+ ## 0.0.0-202191521542
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -0,0 +1,314 @@
1
+ // waiting on https://github.com/primer/primitives/pull/256 for these primitives
2
+ $actionList-item-hover-bg: #f0f3f5;
3
+ $actionList-item-active-bg: #e8ebed;
4
+ $actionList-item-selected-bg: #f0f3f5;
5
+ $actionList-item-focus-bg: #e0e4e7;
6
+ $actionList-item-divider: #e9e9ed;
7
+
8
+ $actionList-item-danger-hover-bg: #fff0f2;
9
+ $actionList-item-danger-active-bg: #ffebed;
10
+ $actionList-item-danger-focus-bg: #ffdbe0;
11
+
12
+ // expanded from src/support/variables/layout.scss
13
+ // adds 12px to the scale as of https://github.com/github/design-systems/issues/992
14
+ //
15
+ // https://github.com/github/design-systems/issues/1272
16
+
17
+ $s-20: 20px;
18
+ $s-28: 28px;
19
+
20
+ // CSS Easing
21
+
22
+ $ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
23
+ $ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
24
+ $ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
25
+ // $actionList-item-padding-vertical: (($spacer-5 - $s-20) / 2); hmmmmm
26
+ $actionList-item-padding-vertical: 6px;
27
+ $actionList-item-padding-horizontal: $spacer-2;
28
+ $actionList-item-bg-transition: background 33.333ms linear; // 2 frames on a 60hz monitor
29
+ $actionList-item-checkmark-transition-timing: 50ms;
30
+
31
+ @mixin pseudoBackground {
32
+ content: '';
33
+ position: absolute;
34
+ height: 32px;
35
+ position: absolute;
36
+ width: 100%;
37
+ border-radius: $border-radius-2;
38
+ z-index: -1;
39
+ }
40
+
41
+ // // span or a href
42
+ // .ActionList-item-content {
43
+ // display: grid;
44
+ // padding: $actionList-item-padding-vertical $actionList-item-padding-horizontal;
45
+ // grid-template-rows: minmax(20px, max-content); // 20px + 12px padding [32]
46
+ // grid-template-columns: minmax(min-content, 100%); // default one column
47
+ // column-gap: $spacer-2;
48
+ // align-items: center;
49
+ // position: relative;
50
+ // border-radius: $border-radius-2;
51
+ // font-weight: $font-weight-normal;
52
+ // color: var(--color-fg-default);
53
+ // user-select: none;
54
+ // transition: $actionList-item-bg-transition;
55
+
56
+ // &:before {
57
+ // @include pseudoBackground;
58
+ // }
59
+
60
+ // &:hover {
61
+ // text-decoration: none;
62
+ // }
63
+
64
+ // &:focus-visible {
65
+ // outline: none;
66
+ // box-shadow: 0 0 0 2px var(--color-accent-fg); // this color breaks convention
67
+ // position: relative;
68
+ // z-index: 1;
69
+ // }
70
+
71
+ // // desktop
72
+ // @media (hover: hover) and (pointer: fine) {
73
+ // &:hover {
74
+ // cursor: pointer;
75
+ // &:before {
76
+ // background-color: $actionList-item-hover-bg;
77
+ // }
78
+ // }
79
+ // }
80
+
81
+ // &:active {
82
+ // background: $actionList-item-active-bg;
83
+
84
+ // @media screen and (prefers-reduced-motion: no-preference) {
85
+ // animation: ActionList-item-active-bg 4s forwards $ease-out-cubic;
86
+ // }
87
+
88
+ // @keyframes ActionList-item-active-bg {
89
+ // 0% {
90
+ // }
91
+ // 50% {
92
+ // transform: scale(1);
93
+ // box-shadow: inset 0 0 0 rgba(#000, 0.04);
94
+ // }
95
+ // 100% {
96
+ // transform: scale(0.97);
97
+ // box-shadow: inset 0 3px 9px rgba(#000, 0.04);
98
+ // }
99
+ // }
100
+ // }
101
+
102
+ // // sizes
103
+
104
+ // &.ActionList-item-content--sizeMedium {
105
+ // grid-template-rows: minmax(28px, max-content); // 28px + 12px padding [40]
106
+ // }
107
+
108
+ // &.ActionList-item-content--sizeLarge {
109
+ // grid-template-rows: minmax(36px, max-content); // 36px + 12px padding [48]
110
+ // }
111
+
112
+ // // On pointer:coarse (mobile), all list items are large
113
+ // @media (pointer: coarse) {
114
+ // grid-template-rows: minmax(36px, max-content);
115
+ // }
116
+
117
+ // // variants
118
+
119
+ // &.ActionList-item-content--danger {
120
+ // .ActionList-item-label {
121
+ // color: var(--color-danger-fg);
122
+ // }
123
+
124
+ // @media (hover: hover) and (pointer: fine) {
125
+ // &:hover {
126
+ // background: var(--color-danger-subtle);
127
+ // }
128
+ // }
129
+
130
+ // &:active {
131
+ // background: var(--color-danger-subtle);
132
+ // }
133
+ // }
134
+
135
+ // // children grid definitions
136
+
137
+ // &.ActionList-item-content--blockDescription {
138
+ // // if leading/trailing visual, align with first line of content
139
+ // .ActionList-item-visual {
140
+ // place-self: start;
141
+ // }
142
+ // }
143
+
144
+ // // leading visual
145
+ // &.ActionList-item-content--leadingVisual {
146
+ // grid-template-columns: min-content minmax(min-content, auto);
147
+ // }
148
+
149
+ // // trailing visual
150
+ // &.ActionList-item-content--trailingVisual {
151
+ // grid-template-columns: minmax(min-content, auto) min-content;
152
+ // }
153
+
154
+ // // leading + trailing visuals
155
+ // &.ActionList-item-content--leadingVisual.ActionList-item-content--trailingVisual {
156
+ // grid-template-columns: min-content minmax(min-content, auto) min-content;
157
+ // }
158
+
159
+ // // checkmark
160
+ // &.ActionList-item-content--singleSelect,
161
+ // &.ActionList-item-content--multiSelect {
162
+ // grid-template-columns: min-content minmax(min-content, auto);
163
+
164
+ // // checkmark + leading visual
165
+ // &.ActionList-item-content--leadingVisual {
166
+ // grid-template-columns: min-content min-content minmax(min-content, auto);
167
+ // }
168
+
169
+ // // checkmark + trailing visual
170
+ // &.ActionList-item-content--trailingVisual {
171
+ // grid-template-columns: min-content minmax(min-content, auto) min-content;
172
+ // }
173
+
174
+ // // checkmark + leading * trailing visuals
175
+ // &.ActionList-item-content--leadingVisual.ActionList-item-content--trailingVisual {
176
+ // grid-template-columns: min-content min-content minmax(min-content, auto) min-content;
177
+ // }
178
+ // }
179
+
180
+ // // helper for grid alignment with multi-line content
181
+ // // span wrapping svg or text
182
+ // .ActionList-item-visual {
183
+ // min-height: 20px;
184
+ // display: flex;
185
+ // align-items: center;
186
+ // fill: var(--color-fg-muted);
187
+ // color: var(--color-fg-muted); // if visual is text
188
+ // }
189
+
190
+ // // text
191
+ // .ActionList-item-label {
192
+ // font-weight: $font-weight-normal;
193
+ // color: var(--color-fg-default);
194
+ // position: relative; // for pseudo dividers
195
+ // }
196
+
197
+ // // wrapper span
198
+ // .ActionList-item-label--blockDescription,
199
+ // .ActionList-item-label--inlineDescription {
200
+ // display: flex;
201
+
202
+ // .ActionList-item-label {
203
+ // font-weight: $font-weight-bold;
204
+ // }
205
+ // }
206
+
207
+ // // block
208
+ // .ActionList-item-label--blockDescription {
209
+ // flex-direction: column;
210
+
211
+ // .ActionList-item-description {
212
+ // margin-top: $spacer-1;
213
+ // }
214
+ // }
215
+
216
+ // // inline
217
+ // .ActionList-item-label--inlineDescription {
218
+ // flex-direction: row;
219
+ // align-items: baseline;
220
+
221
+ // .ActionList-item-description {
222
+ // margin-left: $actionList-item-padding-horizontal;
223
+ // }
224
+ // }
225
+
226
+ // // description
227
+ // .ActionList-item-description {
228
+ // font-size: $font-size-small;
229
+ // line-height: $lh-default;
230
+ // color: var(--color-fg-muted);
231
+ // }
232
+ // }
233
+
234
+ // // .ActionList-item--sub-group .ActionList-item:last-of-type .ActionList-item--sub-group {
235
+ // .ActionList-item-visual--16 + .ActionList-item--sub-group .ActionList-item:last-of-type .ActionList-item--sub-group {
236
+ // .ActionList-item--sub-item > .ActionList-item-content {
237
+ // &:before {
238
+ // width: calc(100% + 48px);
239
+ // transform: translateX(-48px);
240
+ // }
241
+
242
+ // &:after {
243
+ // transform: translateX(-48px);
244
+ // }
245
+ // }
246
+ // }
247
+ // // }
248
+
249
+ // .ActionList-item--sub-group {
250
+ // padding-left: 24px;
251
+ // }
252
+
253
+ // .ActionList-item--sub-item > .ActionList-item-content {
254
+ // font-size: $font-size-small;
255
+
256
+ // // .ActionList-item-label {
257
+ // // grid-column: 2/3;
258
+ // // }
259
+ // }
260
+
261
+ // .ActionList-item-visual--16 + .ActionList-item--sub-group .ActionList-item:last-of-type {
262
+ // > a:before {
263
+ // width: calc(100% + 24px);
264
+ // transform: translateX(-24px);
265
+ // }
266
+ // }
267
+
268
+ // .ActionList-item-visual--16 + .ActionList-item--sub-group {
269
+ // .ActionList-item--sub-item > .ActionList-item-content {
270
+ // // padding-left: 16px;
271
+
272
+ // &:before {
273
+ // width: calc(100% + 24px);
274
+ // transform: translateX(-24px);
275
+ // }
276
+
277
+ // &:after {
278
+ // transform: translateX(-24px);
279
+ // }
280
+ // }
281
+ // }
282
+
283
+ // .ActionList-item-visual--20 + .ActionList-item--sub-group {
284
+ // .ActionList-item--sub-item > .ActionList-item-content {
285
+ // padding-left: 20px;
286
+ // }
287
+ // }
288
+
289
+ // .ActionList-item-visual--24 + .ActionList-item--sub-group {
290
+ // .ActionList-item--sub-item > .ActionList-item-content {
291
+ // padding-left: 24px;
292
+ // }
293
+ // }
294
+ // // single select
295
+
296
+ // // maintain space on grid while check is hidden
297
+ // // .ActionList-item-content--singleSelect {
298
+ // // .ActionList-item-check {
299
+ // // visibility: hidden;
300
+ // // opacity: 0;
301
+ // // transition: visibility 0s linear $actionList-item-checkmark-transition-timing,
302
+ // // opacity $actionList-item-checkmark-transition-timing;
303
+ // // }
304
+ // // }
305
+
306
+ // // &[aria-checked='true'] {
307
+ // // .ActionList-item-content--singleSelect {
308
+ // // .ActionList-item-check {
309
+ // // visibility: visible;
310
+ // // opacity: 1;
311
+ // // transition: visibility 0s linear 0s, opacity $actionList-item-checkmark-transition-timing;
312
+ // // }
313
+ // // }
314
+ // // }
@@ -0,0 +1,73 @@
1
+ // waiting on https://github.com/primer/primitives/pull/256 for these primitives
2
+ $actionList-item-hover-bg: #f0f3f5;
3
+ $actionList-item-active-bg: #e8ebed;
4
+ $actionList-item-selected-bg: #f0f3f5;
5
+ $actionList-item-focus-bg: #e0e4e7;
6
+ $actionList-item-divider: #e9e9ed;
7
+
8
+ $actionList-item-danger-hover-bg: #fff0f2;
9
+ $actionList-item-danger-active-bg: #ffebed;
10
+ $actionList-item-danger-focus-bg: #ffdbe0;
11
+
12
+ // expanded from src/support/variables/layout.scss
13
+ // adds 12px to the scale as of https://github.com/github/design-systems/issues/992
14
+ //
15
+ // https://github.com/github/design-systems/issues/1272
16
+
17
+ $s-20: 20px;
18
+ $s-28: 28px;
19
+
20
+ // CSS Easing
21
+
22
+ $ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
23
+ $ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
24
+ $ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
25
+ // $actionList-item-padding-vertical: (($spacer-5 - $s-20) / 2); hmmmmm
26
+ $actionList-item-padding-vertical: 6px;
27
+ $actionList-item-padding-horizontal: $spacer-2;
28
+ $actionList-item-bg-transition: background 33.333ms linear; // 2 frames on a 60hz monitor
29
+
30
+ // emtpy divider
31
+
32
+ .ActionList-sectionDivider {
33
+ height: 1px;
34
+ background: $actionList-item-divider;
35
+ border: 0;
36
+ margin: ($spacer-2 - 1px) ($spacer-2 * -1) $spacer-2;
37
+ padding: 0;
38
+ list-style: none;
39
+ }
40
+
41
+ .ActionList-sectionDivider--filled {
42
+ margin: $spacer-2 ($spacer-2 * -1);
43
+ background: var(--color-canvas-subtle);
44
+ border-top: 1px solid var(--color-scale-gray-2);
45
+ border-bottom: 1px solid var(--color-scale-gray-2);
46
+
47
+ // if no children, treat as divider
48
+ &:empty {
49
+ height: $spacer-2;
50
+ box-sizing: border-box;
51
+ }
52
+
53
+ &:first-child {
54
+ margin-top: 0;
55
+ }
56
+ }
57
+
58
+ // section header
59
+
60
+ .ActionList-sectionHeader {
61
+ // 32px total height considering 20px line-height
62
+ padding: (($spacer-5 - $s-20) / 2) $spacer-2;
63
+ font-size: $font-size-small;
64
+ font-weight: $font-weight-bold;
65
+ color: var(--color-fg-muted);
66
+ display: flex;
67
+ flex-direction: column;
68
+
69
+ .ActionList-sectionHeader--description {
70
+ font-size: $font-size-small;
71
+ font-weight: $font-weight-normal;
72
+ }
73
+ }