@primer/css 0.0.0-1ea75fe → 0.0.0-202110100305
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 +1231 -132
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTING.md +85 -0
- package/DEVELOP.md +11 -69
- package/LICENSE +1 -1
- package/README.md +13 -15
- package/RELEASING.md +5 -72
- package/actionlist/action-list-item-divider.scss +42 -0
- package/actionlist/action-list-item.scss +444 -0
- package/actionlist/action-list-variables.scss +8 -0
- package/actionlist/action-list.scss +33 -0
- package/actionlist/index.scss +5 -0
- package/alerts/README.md +11 -22
- package/alerts/flash.scss +91 -21
- package/alerts/index.scss +2 -2
- package/autocomplete/README.md +25 -0
- package/autocomplete/autocomplete.scss +58 -0
- package/autocomplete/index.scss +4 -0
- package/autocomplete/suggester.scss +92 -0
- package/avatars/README.md +11 -23
- package/avatars/avatar-parent-child.scss +4 -3
- package/avatars/avatar-stack.scss +21 -13
- package/avatars/avatar.scss +31 -3
- package/avatars/circle-badge.scss +5 -4
- package/avatars/index.scss +5 -5
- package/base/README.md +11 -22
- package/base/base.scss +5 -4
- package/base/index.scss +6 -4
- package/base/kbd.scss +20 -0
- package/base/normalize.scss +5 -5
- package/base/octicons.scss +6 -0
- package/base/typography-base.scss +2 -0
- package/blankslate/README.md +11 -23
- package/blankslate/blankslate.scss +25 -12
- package/blankslate/index.scss +2 -2
- package/box/README.md +11 -23
- package/box/box.scss +52 -44
- package/box/index.scss +2 -2
- package/branch-name/README.md +11 -23
- package/branch-name/branch-name.scss +18 -8
- package/branch-name/index.scss +2 -2
- package/breadcrumb/README.md +17 -13
- package/breadcrumb/breadcrumb.scss +15 -5
- package/breadcrumb/index.scss +2 -2
- package/buttons/README.md +11 -23
- package/buttons/button-group.scss +2 -0
- package/buttons/button.scss +243 -143
- package/buttons/index.scss +4 -3
- package/buttons/misc.scss +222 -0
- package/color-modes/index.scss +9 -0
- package/color-modes/native.scss +10 -0
- package/color-modes/themes/dark.scss +7 -0
- package/color-modes/themes/dark_colorblind.scss +7 -0
- package/color-modes/themes/dark_dimmed.scss +7 -0
- package/color-modes/themes/dark_high_contrast.scss +7 -0
- package/color-modes/themes/light.scss +7 -0
- package/color-modes/themes/light_colorblind.scss +7 -0
- package/core/README.md +11 -23
- package/core/index.scss +19 -20
- package/deprecations.js +24 -0
- package/deprecations.json +539 -0
- package/dist/actionlist.css +2 -0
- package/dist/actionlist.css.map +1 -0
- package/dist/actionlist.js +1 -0
- package/dist/alerts.css +1 -2
- package/dist/alerts.css.map +1 -1
- package/dist/alerts.js +1 -1
- package/dist/autocomplete.css +2 -0
- package/dist/autocomplete.css.map +1 -0
- package/dist/autocomplete.js +1 -0
- package/dist/avatars.css +1 -2
- package/dist/avatars.css.map +1 -1
- package/dist/avatars.js +1 -1
- package/dist/base.css +1 -2
- package/dist/base.css.map +1 -1
- package/dist/base.js +1 -1
- package/dist/blankslate.css +1 -2
- package/dist/blankslate.css.map +1 -1
- package/dist/blankslate.js +1 -1
- package/dist/box.css +1 -2
- package/dist/box.css.map +1 -1
- package/dist/box.js +1 -1
- package/dist/branch-name.css +1 -2
- package/dist/branch-name.css.map +1 -1
- package/dist/branch-name.js +1 -1
- package/dist/breadcrumb.css +1 -2
- package/dist/breadcrumb.css.map +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/buttons.css +1 -2
- package/dist/buttons.css.map +1 -1
- package/dist/buttons.js +1 -1
- package/dist/color-modes.css +2 -0
- package/dist/color-modes.css.map +1 -0
- package/dist/color-modes.js +1 -0
- package/dist/core.css +3 -4
- package/dist/core.css.map +1 -1
- package/dist/core.js +1 -1
- package/dist/deprecations.json +539 -0
- package/dist/dropdown.css +2 -0
- package/dist/dropdown.css.map +1 -0
- package/dist/dropdown.js +1 -0
- package/dist/forms.css +1 -2
- package/dist/forms.css.map +1 -1
- package/dist/forms.js +1 -1
- package/dist/header.css +2 -0
- package/dist/header.css.map +1 -0
- package/dist/header.js +1 -0
- package/dist/labels.css +1 -2
- package/dist/labels.css.map +1 -1
- package/dist/labels.js +1 -1
- package/dist/layout.css +1 -2
- package/dist/layout.css.map +1 -1
- package/dist/layout.js +1 -1
- package/dist/links.css +2 -0
- package/dist/links.css.map +1 -0
- package/dist/links.js +1 -0
- package/dist/loaders.css +2 -0
- package/dist/loaders.css.map +1 -0
- package/dist/loaders.js +1 -0
- package/dist/markdown.css +1 -2
- package/dist/markdown.css.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/marketing-buttons.css +1 -2
- package/dist/marketing-buttons.css.map +1 -1
- package/dist/marketing-buttons.js +1 -1
- package/dist/marketing-support.css +1 -2
- package/dist/marketing-support.js +1 -1
- package/dist/marketing-type.css +1 -2
- package/dist/marketing-type.css.map +1 -1
- package/dist/marketing-type.js +1 -1
- package/dist/marketing-utilities.css +1 -2
- package/dist/marketing-utilities.css.map +1 -1
- package/dist/marketing-utilities.js +1 -1
- package/dist/marketing.css +3 -4
- package/dist/marketing.css.map +1 -1
- package/dist/marketing.js +1 -1
- package/dist/meta.json +316 -273
- package/dist/navigation.css +1 -2
- package/dist/navigation.css.map +1 -1
- package/dist/navigation.js +1 -1
- package/dist/pagination.css +1 -2
- package/dist/pagination.css.map +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.css +1 -2
- package/dist/popover.css.map +1 -1
- package/dist/popover.js +1 -1
- package/dist/primer.css +13 -14
- package/dist/primer.css.map +1 -1
- package/dist/primer.js +1 -1
- package/dist/product.css +3 -4
- package/dist/product.css.map +1 -1
- package/dist/product.js +1 -1
- package/dist/progress.css +1 -2
- package/dist/progress.css.map +1 -1
- package/dist/progress.js +1 -1
- package/dist/select-menu.css +2 -0
- package/dist/select-menu.css.map +1 -0
- package/dist/select-menu.js +1 -0
- package/dist/stats/actionlist.json +1 -0
- package/dist/stats/alerts.json +1 -1
- package/dist/stats/autocomplete.json +1 -0
- package/dist/stats/avatars.json +1 -1
- package/dist/stats/base.json +1 -1
- package/dist/stats/blankslate.json +1 -1
- package/dist/stats/box.json +1 -1
- package/dist/stats/branch-name.json +1 -1
- package/dist/stats/breadcrumb.json +1 -1
- package/dist/stats/buttons.json +1 -1
- package/dist/stats/color-modes.json +1 -0
- package/dist/stats/core.json +1 -1
- package/dist/stats/dropdown.json +1 -0
- package/dist/stats/forms.json +1 -1
- package/dist/stats/header.json +1 -0
- package/dist/stats/labels.json +1 -1
- package/dist/stats/layout.json +1 -1
- package/dist/stats/links.json +1 -0
- package/dist/stats/loaders.json +1 -0
- package/dist/stats/markdown.json +1 -1
- package/dist/stats/marketing-buttons.json +1 -1
- package/dist/stats/marketing-support.json +1 -1
- package/dist/stats/marketing-type.json +1 -1
- package/dist/stats/marketing-utilities.json +1 -1
- package/dist/stats/marketing.json +1 -1
- package/dist/stats/navigation.json +1 -1
- package/dist/stats/pagination.json +1 -1
- package/dist/stats/popover.json +1 -1
- package/dist/stats/primer.json +1 -1
- package/dist/stats/product.json +1 -1
- package/dist/stats/progress.json +1 -1
- package/dist/stats/select-menu.json +1 -0
- package/dist/stats/subhead.json +1 -1
- package/dist/stats/support.json +1 -1
- package/dist/stats/table-object.json +1 -1
- package/dist/stats/timeline.json +1 -0
- package/dist/stats/toasts.json +1 -0
- package/dist/stats/tooltips.json +1 -1
- package/dist/stats/truncate.json +1 -1
- package/dist/stats/utilities.json +1 -1
- package/dist/subhead.css +1 -2
- package/dist/subhead.css.map +1 -1
- package/dist/subhead.js +1 -1
- package/dist/support.css +1 -1
- package/dist/support.js +1 -1
- package/dist/table-object.css +0 -1
- package/dist/table-object.css.map +1 -1
- package/dist/table-object.js +1 -1
- package/dist/timeline.css +2 -0
- package/dist/timeline.css.map +1 -0
- package/dist/timeline.js +1 -0
- package/dist/toasts.css +2 -0
- package/dist/toasts.css.map +1 -0
- package/dist/toasts.js +1 -0
- package/dist/tooltips.css +1 -2
- package/dist/tooltips.css.map +1 -1
- package/dist/tooltips.js +1 -1
- package/dist/truncate.css +1 -2
- package/dist/truncate.css.map +1 -1
- package/dist/truncate.js +1 -1
- package/dist/utilities.css +1 -2
- package/dist/utilities.css.map +1 -1
- package/dist/utilities.js +1 -1
- package/dist/variables.json +1352 -0
- package/dropdown/README.md +25 -0
- package/dropdown/dropdown.scss +272 -0
- package/dropdown/index.scss +2 -0
- package/forms/README.md +11 -23
- package/forms/form-control.scss +76 -32
- package/forms/form-group.scss +83 -46
- package/forms/form-select.scss +17 -5
- package/forms/form-validation.scss +51 -32
- package/forms/index.scss +7 -6
- package/forms/input-group.scss +2 -0
- package/forms/radio-group.scss +62 -0
- package/header/README.md +25 -0
- package/header/header.scss +47 -0
- package/header/index.scss +2 -0
- package/index.scss +7 -4
- package/labels/README.md +11 -23
- package/labels/counters.scss +24 -13
- package/labels/diffstat.scss +37 -0
- package/labels/index.scss +8 -4
- package/labels/issue-labels.scss +23 -0
- package/labels/labels.scss +59 -40
- package/labels/mixins.scss +32 -0
- package/labels/states.scss +40 -19
- package/layout/README.md +11 -23
- package/layout/container.scss +0 -8
- package/layout/grid-offset.scss +11 -11
- package/layout/grid.scss +23 -23
- package/layout/index.scss +8 -5
- package/layout/layout-beta.scss +339 -0
- package/layout/layout.scss +185 -0
- package/layout/mixins.scss +79 -0
- package/links/README.md +25 -0
- package/links/index.scss +3 -0
- package/links/link.scss +55 -0
- package/loaders/README.md +25 -0
- package/loaders/index.scss +2 -0
- package/loaders/loaders.scss +19 -0
- package/markdown/README.md +11 -23
- package/markdown/blob-csv.scss +4 -2
- package/markdown/code.scss +11 -3
- package/markdown/footnotes.scss +37 -0
- package/markdown/headings.scss +13 -4
- package/markdown/images.scss +15 -4
- package/markdown/index.scss +9 -8
- package/markdown/lists.scss +19 -5
- package/markdown/markdown-body.scss +15 -18
- package/markdown/tables.scss +8 -5
- package/marketing/README.md +11 -23
- package/marketing/buttons/button.scss +82 -61
- package/marketing/index.scss +6 -11
- package/marketing/support/index.scss +1 -0
- package/marketing/support/mixins.scss +66 -0
- package/marketing/support/variables.scss +110 -51
- package/marketing/type/typography.scss +100 -62
- package/marketing/utilities/animations.scss +9 -0
- package/marketing/utilities/filters.scss +0 -1
- package/marketing/utilities/index.scss +2 -3
- package/marketing/utilities/layout.scss +32 -11
- package/navigation/README.md +11 -23
- package/navigation/filter-list.scss +16 -14
- package/navigation/index.scss +7 -6
- package/navigation/menu.scss +44 -35
- package/navigation/sidenav.scss +108 -0
- package/navigation/subnav.scss +28 -21
- package/navigation/tabnav.scss +45 -21
- package/navigation/underline-nav.scss +36 -22
- package/package.json +78 -107
- package/pagination/README.md +12 -14
- package/pagination/index.scss +2 -2
- package/pagination/pagination.scss +61 -37
- package/popover/README.md +11 -24
- package/popover/index.scss +2 -2
- package/popover/popover.scss +18 -9
- package/postcss.config.cjs +22 -0
- package/prettier.config.cjs +1 -0
- package/product/README.md +11 -23
- package/product/index.scss +19 -17
- package/progress/README.md +11 -23
- package/progress/index.scss +2 -2
- package/progress/progress.scss +11 -1
- package/select-menu/README.md +25 -0
- package/select-menu/index.scss +3 -0
- package/select-menu/select-menu.scss +464 -0
- package/stylelint.config.cjs +16 -0
- package/subhead/README.md +11 -25
- package/subhead/index.scss +2 -2
- package/subhead/subhead.scss +10 -4
- package/support/README.md +12 -18
- package/support/index.scss +7 -8
- package/support/mixins/color-modes.scss +106 -0
- package/support/mixins/misc.scss +9 -12
- package/support/mixins/typography.scss +1 -1
- package/support/variables/layout.scss +103 -11
- package/support/variables/misc.scss +7 -30
- package/support/variables/typography.scss +4 -4
- package/table-object/README.md +11 -24
- package/table-object/index.scss +1 -1
- package/timeline/README.md +25 -0
- package/timeline/index.scss +2 -0
- package/timeline/timeline-item.scss +95 -0
- package/toasts/README.md +25 -0
- package/toasts/index.scss +2 -0
- package/toasts/toasts.scss +124 -0
- package/tooltips/README.md +11 -24
- package/tooltips/index.scss +2 -2
- package/tooltips/tooltips.scss +17 -8
- package/truncate/README.md +11 -24
- package/truncate/index.scss +2 -1
- package/truncate/truncate.scss +41 -7
- package/utilities/README.md +11 -23
- package/utilities/animations.scss +14 -2
- package/utilities/borders.scss +29 -65
- package/utilities/box-shadow.scss +8 -9
- package/utilities/colors.scss +71 -110
- package/utilities/details.scss +12 -4
- package/utilities/flexbox.scss +14 -14
- package/utilities/index.scss +12 -12
- package/utilities/layout.scss +28 -22
- package/utilities/margin.scss +34 -17
- package/utilities/padding.scss +13 -9
- package/utilities/typography.scss +54 -25
- package/utilities/visibility-display.scss +0 -13
- package/.browserslistrc +0 -6
- package/.eslintrc.json +0 -13
- package/.stylelintrc.json +0 -9
- package/MIGRATING.md +0 -70
- package/bin/primer-migrate +0 -86
- package/build/build.css +0 -23
- package/build/build.json +0 -1
- package/build/index.js +0 -1
- package/dist/marketing-support.css.map +0 -1
- package/dist/support.css.map +0 -1
- package/fonts/Inter-Medium.woff +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/layout/columns.scss +0 -56
- package/marketing/buttons/README.md +0 -39
- package/marketing/support/README.md +0 -31
- package/marketing/type/README.md +0 -39
- package/marketing/utilities/README.md +0 -36
- package/marketing/utilities/margin.scss +0 -18
- package/marketing/utilities/padding.scss +0 -28
- package/postcss.config.js +0 -14
- package/prettier.config.js +0 -1
- package/support/mixins/buttons.scss +0 -160
- package/support/variables/color-system.scss +0 -243
- package/support/variables/colors.scss +0 -70
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
@mixin focusOutline {
|
|
2
|
+
position: relative;
|
|
3
|
+
z-index: 1;
|
|
4
|
+
outline: none;
|
|
5
|
+
box-shadow: 0 0 0 2px var(--color-accent-fg); // this color breaks convention
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// <li>
|
|
9
|
+
.ActionList-item {
|
|
10
|
+
position: relative;
|
|
11
|
+
list-style: none;
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
border-radius: $border-radius;
|
|
14
|
+
|
|
15
|
+
&:hover,
|
|
16
|
+
&:active {
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
|
|
19
|
+
// a href
|
|
20
|
+
.ActionList-content {
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// only hover li without list as children
|
|
26
|
+
&:not(.ActionList-item--hasSubItem) {
|
|
27
|
+
&:hover {
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
background-color: var(--color-action-list-item-default-hover-bg);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:active {
|
|
33
|
+
background: var(--color-action-list-item-default-active-bg);
|
|
34
|
+
|
|
35
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
36
|
+
animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// stylelint-disable primer/box-shadow
|
|
40
|
+
@keyframes ActionList-item-active-bg {
|
|
41
|
+
// stylelint-disable-next-line max-nesting-depth
|
|
42
|
+
50% {
|
|
43
|
+
box-shadow: inset 0 0 0 rgba(#000, 0.04);
|
|
44
|
+
transform: scale(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// stylelint-disable-next-line max-nesting-depth
|
|
48
|
+
100% {
|
|
49
|
+
box-shadow: inset 0 3px 9px rgba(#000, 0.04);
|
|
50
|
+
transform: scale(0.97);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// stylelint-enable primer/box-shadow
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:hover,
|
|
57
|
+
&:active {
|
|
58
|
+
// hide dividers
|
|
59
|
+
// stylelint-disable-next-line selector-max-specificity
|
|
60
|
+
.ActionList-item-label::before,
|
|
61
|
+
+ .ActionList-item .ActionList-item-label::before {
|
|
62
|
+
visibility: hidden;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// target contents of li if sub-item (li wraps item label + nested ul)
|
|
68
|
+
// collapse styles here
|
|
69
|
+
&.ActionList-item--hasSubItem {
|
|
70
|
+
// first child
|
|
71
|
+
> .ActionList-content {
|
|
72
|
+
&:hover {
|
|
73
|
+
background-color: var(--color-action-list-item-default-hover-bg);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// active state [aria-current]
|
|
79
|
+
|
|
80
|
+
&.ActionList-item--navActive:not(.ActionList-item--danger) {
|
|
81
|
+
background: var(--color-action-list-item-default-selected-bg);
|
|
82
|
+
|
|
83
|
+
// stylelint-disable-next-line selector-max-specificity
|
|
84
|
+
&::before,
|
|
85
|
+
+ .ActionList-item::before {
|
|
86
|
+
visibility: hidden;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// blue accent line
|
|
90
|
+
&::after {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: calc(50% - 12px);
|
|
93
|
+
left: -$actionList-item-padding-horizontal;
|
|
94
|
+
width: $spacer-1;
|
|
95
|
+
height: $spacer-4;
|
|
96
|
+
content: '';
|
|
97
|
+
background: var(--color-accent-fg);
|
|
98
|
+
border-radius: $border-radius;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// collapsible item [aria-expanded]
|
|
103
|
+
|
|
104
|
+
&[aria-expanded='true'] {
|
|
105
|
+
.ActionList-item-collapseIcon {
|
|
106
|
+
transition: transform 120ms linear;
|
|
107
|
+
transform: scaleY(-1);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ActionList--subGroup {
|
|
111
|
+
display: block;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.ActionList-item--hasSubItem {
|
|
115
|
+
// stylelint-disable-next-line selector-max-specificity
|
|
116
|
+
> .ActionList-content > .ActionList-item-label {
|
|
117
|
+
font-weight: $font-weight-bold;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&[aria-expanded='false'] {
|
|
123
|
+
.ActionList-item-collapseIcon {
|
|
124
|
+
transition: transform 120ms linear;
|
|
125
|
+
transform: scaleY(1);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ActionList--subGroup {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// checkbox item [aria-checked]
|
|
134
|
+
// listbox [aria-selected]
|
|
135
|
+
|
|
136
|
+
&[aria-checked='true'],
|
|
137
|
+
&[aria-selected='true'] {
|
|
138
|
+
// multiselect checkmark
|
|
139
|
+
.ActionList-item-multiSelectCheckmark {
|
|
140
|
+
visibility: visible;
|
|
141
|
+
opacity: 1;
|
|
142
|
+
transition: visibility 0 linear 0, opacity $actionList-item-checkmark-transition-timing;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// singleselect checkmark
|
|
146
|
+
.ActionList-item-singleSelectCheckmark {
|
|
147
|
+
visibility: visible;
|
|
148
|
+
|
|
149
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
150
|
+
animation: checkmarkIn 200ms cubic-bezier(0.11, 0, 0.5, 0) forwards;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// checkbox
|
|
155
|
+
.ActionList-item-multiSelectIcon {
|
|
156
|
+
.ActionList-item-multiSelectIconRect {
|
|
157
|
+
fill: var(--color-accent-fg);
|
|
158
|
+
stroke: var(--color-accent-fg);
|
|
159
|
+
stroke-width: $border-width;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.ActionList-item-multiSelectCheckmark {
|
|
163
|
+
fill: var(--color-fg-on-emphasis);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&[aria-checked='false'],
|
|
169
|
+
&[aria-selected='false'] {
|
|
170
|
+
// multiselect checkmark
|
|
171
|
+
.ActionList-item-multiSelectCheckmark {
|
|
172
|
+
visibility: hidden;
|
|
173
|
+
opacity: 0;
|
|
174
|
+
transition:
|
|
175
|
+
visibility 0 linear $actionList-item-checkmark-transition-timing,
|
|
176
|
+
opacity $actionList-item-checkmark-transition-timing;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// singleselect checkmark
|
|
180
|
+
.ActionList-item-singleSelectCheckmark {
|
|
181
|
+
visibility: hidden;
|
|
182
|
+
transition: visibility 0s linear 200ms;
|
|
183
|
+
clip-path: inset(16px 0 0 0);
|
|
184
|
+
|
|
185
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
186
|
+
animation: checkmarkOut 200ms cubic-bezier(0.11, 0, 0.5, 0) forwards;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// checkbox
|
|
191
|
+
.ActionList-item-multiSelectIcon {
|
|
192
|
+
.ActionList-item-multiSelectIconRect {
|
|
193
|
+
fill: var(--color-canvas-default);
|
|
194
|
+
stroke: var(--color-border-default);
|
|
195
|
+
stroke-width: $border-width;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.ActionList-item-multiSelectIconRect {
|
|
200
|
+
fill: var(--color-canvas-default);
|
|
201
|
+
border: $border-width $border-style var(--color-border-default);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@keyframes checkmarkIn {
|
|
206
|
+
from {
|
|
207
|
+
clip-path: inset(16px 0 0 0);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
to {
|
|
211
|
+
clip-path: inset(0 0 0 0);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@keyframes checkmarkOut {
|
|
216
|
+
from {
|
|
217
|
+
clip-path: inset(0 0 0 0);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
to {
|
|
221
|
+
clip-path: inset(16px 0 0 0);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// variants
|
|
226
|
+
|
|
227
|
+
// danger
|
|
228
|
+
&.ActionList-item--danger {
|
|
229
|
+
.ActionList-item-label {
|
|
230
|
+
color: var(--color-danger-fg);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.ActionList-item-visual {
|
|
234
|
+
color: var(--color-danger-fg);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@media (hover: hover) and (pointer: fine) {
|
|
238
|
+
&:hover {
|
|
239
|
+
background: var(--color-action-list-item-danger-hover-bg);
|
|
240
|
+
|
|
241
|
+
// stylelint-disable-next-line max-nesting-depth
|
|
242
|
+
.ActionList-item-label {
|
|
243
|
+
color: var(--color-action-list-item-danger-hover-text);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&:active {
|
|
249
|
+
background: var(--color-action-list-item-danger-active-bg);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// disabled
|
|
254
|
+
&[aria-disabled='true'] {
|
|
255
|
+
.ActionList-item-label,
|
|
256
|
+
.ActionList-item-description {
|
|
257
|
+
color: var(--color-primer-fg-disabled);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.ActionList-item-visual {
|
|
261
|
+
fill: var(--color-primer-fg-disabled);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@media (hover: hover) and (pointer: fine) {
|
|
265
|
+
&:hover {
|
|
266
|
+
cursor: not-allowed;
|
|
267
|
+
background-color: transparent;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// if nested list exists, remove default padding
|
|
273
|
+
.ActionList {
|
|
274
|
+
// stylelint-disable-next-line primer/spacing
|
|
275
|
+
padding: unset;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// span or a href
|
|
280
|
+
.ActionList-content {
|
|
281
|
+
position: relative;
|
|
282
|
+
display: grid;
|
|
283
|
+
// stylelint-disable-next-line primer/spacing
|
|
284
|
+
padding: $actionList-item-padding-vertical $actionList-item-padding-horizontal;
|
|
285
|
+
font-weight: $font-weight-normal;
|
|
286
|
+
color: var(--color-fg-default);
|
|
287
|
+
user-select: none;
|
|
288
|
+
border-radius: $border-radius;
|
|
289
|
+
transition: $actionList-item-bg-transition;
|
|
290
|
+
grid-template-rows: min-content;
|
|
291
|
+
grid-template-areas: 'leadingAction leadingVisual label trailingVisual trailingAction';
|
|
292
|
+
grid-template-columns: min-content min-content minmax(min-content, auto) min-content min-content;
|
|
293
|
+
align-items: center;
|
|
294
|
+
|
|
295
|
+
// column-gap persists with empty grid-areas, margin applies only when children exist
|
|
296
|
+
> :not(:last-child) {
|
|
297
|
+
margin-right: $spacer-2;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&:focus-visible {
|
|
301
|
+
@include focusOutline;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// sizes
|
|
305
|
+
|
|
306
|
+
&.ActionList-content--sizeMedium {
|
|
307
|
+
// 44px total height
|
|
308
|
+
// stylelint-disable-next-line primer/spacing
|
|
309
|
+
padding: $actionList-item-padding-vertical-md $actionList-item-padding-horizontal;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
&.ActionList-content--sizeLarge {
|
|
313
|
+
// 48px total height
|
|
314
|
+
// stylelint-disable-next-line primer/spacing
|
|
315
|
+
padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// On pointer:coarse (mobile), all list items are large
|
|
319
|
+
@media (pointer: coarse) {
|
|
320
|
+
// stylelint-disable-next-line primer/spacing
|
|
321
|
+
padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
&.ActionList-content--blockDescription {
|
|
325
|
+
// if leading/trailing visual, align with first line of content
|
|
326
|
+
.ActionList-item-visual {
|
|
327
|
+
place-self: start;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// place children on grid
|
|
333
|
+
|
|
334
|
+
.ActionList-item-action--leading {
|
|
335
|
+
grid-area: leadingAction;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.ActionList-item-visual--leading {
|
|
339
|
+
grid-area: leadingVisual;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.ActionList-item-label {
|
|
343
|
+
grid-area: label;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.ActionList-item-visual--trailing {
|
|
347
|
+
grid-area: trailingVisual;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.ActionList-item-action--trailing {
|
|
351
|
+
grid-area: trailingAction;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// wrapper span
|
|
355
|
+
// default block
|
|
356
|
+
.ActionList-item-descriptionWrap {
|
|
357
|
+
grid-area: label;
|
|
358
|
+
display: flex;
|
|
359
|
+
flex-direction: column;
|
|
360
|
+
|
|
361
|
+
.ActionList-item-description {
|
|
362
|
+
margin-top: $spacer-1;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.ActionList-item-label {
|
|
366
|
+
font-weight: $font-weight-bold;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// inline
|
|
371
|
+
.ActionList-item-descriptionWrap--inline {
|
|
372
|
+
flex-direction: row;
|
|
373
|
+
align-items: baseline;
|
|
374
|
+
|
|
375
|
+
.ActionList-item-description {
|
|
376
|
+
// stylelint-disable-next-line primer/spacing
|
|
377
|
+
margin-left: $actionList-item-padding-horizontal;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// description
|
|
382
|
+
.ActionList-item-description {
|
|
383
|
+
font-size: $font-size-small;
|
|
384
|
+
font-weight: $font-weight-normal;
|
|
385
|
+
line-height: $lh-default;
|
|
386
|
+
color: var(--color-fg-muted);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// helper for grid alignment with multi-line content
|
|
390
|
+
// span wrapping svg or text
|
|
391
|
+
.ActionList-item-visual,
|
|
392
|
+
.ActionList-item-action {
|
|
393
|
+
display: flex;
|
|
394
|
+
min-height: $actionList-item-height-sm;
|
|
395
|
+
color: var(--color-fg-muted); // if visual is text
|
|
396
|
+
fill: var(--color-fg-muted);
|
|
397
|
+
align-items: center;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// text
|
|
401
|
+
// stylelint-disable-next-line no-duplicate-selectors
|
|
402
|
+
.ActionList-item-label {
|
|
403
|
+
position: relative; // for pseudo dividers
|
|
404
|
+
font-weight: $font-weight-normal;
|
|
405
|
+
// we need a strict value here for grid alignment
|
|
406
|
+
// stylelint-disable-next-line primer/typography
|
|
407
|
+
line-height: $actionList-item-label-line-height;
|
|
408
|
+
color: var(--color-fg-default);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// nested lists (only supports 1 level currently)
|
|
412
|
+
// target ActionList-item--subItem for padding-left to maintain :active :after state
|
|
413
|
+
|
|
414
|
+
.ActionList-item--subItem > .ActionList-content {
|
|
415
|
+
font-size: $font-size-small;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// no leading visual
|
|
419
|
+
.ActionList--subGroup {
|
|
420
|
+
.ActionList-item--subItem {
|
|
421
|
+
padding-left: $spacer-3;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// has 16px leading visual
|
|
426
|
+
.ActionList-content--visual16 + .ActionList--subGroup {
|
|
427
|
+
.ActionList-item--subItem {
|
|
428
|
+
padding-left: $spacer-4;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// has 20px leading visual
|
|
433
|
+
.ActionList-content--visual20 + .ActionList--subGroup {
|
|
434
|
+
.ActionList-item--subItem {
|
|
435
|
+
padding-left: $spacer-3 * 1.75;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// has 24px leading visual
|
|
440
|
+
.ActionList-content--visual24 + .ActionList--subGroup {
|
|
441
|
+
.ActionList-item--subItem {
|
|
442
|
+
padding-left: $spacer-5;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
$actionList-item-height-sm: $spacer-2 * 2.5 !default;
|
|
2
|
+
$actionList-item-label-line-height: $spacer-2 * 2.5 !default;
|
|
3
|
+
$actionList-item-padding-vertical-md: $spacer-2 * 1.25 !default;
|
|
4
|
+
$actionList-item-padding-vertical-lg: $spacer-2 * 1.75 !default;
|
|
5
|
+
$actionList-item-padding-vertical: $spacer-1 * 1.5 !default;
|
|
6
|
+
$actionList-item-padding-horizontal: $spacer-2 !default;
|
|
7
|
+
$actionList-item-bg-transition: background 33.333ms linear !default; // 2 frames on a 60hz monitor
|
|
8
|
+
$actionList-item-checkmark-transition-timing: 50ms !default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// <ul>
|
|
2
|
+
.ActionList {
|
|
3
|
+
padding: $spacer-2;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// dividers
|
|
7
|
+
|
|
8
|
+
.ActionList--divided {
|
|
9
|
+
.ActionList-item-label::before {
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: -$actionList-item-padding-vertical;
|
|
12
|
+
display: block;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 1px;
|
|
15
|
+
content: '';
|
|
16
|
+
background: var(--color-action-list-item-inline-divider);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// hide divider if item is active
|
|
20
|
+
.ActionList-item--navActive {
|
|
21
|
+
// stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
|
|
22
|
+
.ActionList-item-label::before,
|
|
23
|
+
+ .ActionList-item .ActionList-item-label::before {
|
|
24
|
+
visibility: hidden;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// hide if item is first of type with label::before, or is the first item after a sectionDivider
|
|
30
|
+
.ActionList-item:first-of-type .ActionList-item-label::before,
|
|
31
|
+
.ActionList-sectionDivider + .ActionList-item .ActionList-item-label::before {
|
|
32
|
+
visibility: hidden;
|
|
33
|
+
}
|
package/alerts/README.md
CHANGED
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
---
|
|
2
|
+
bundle: "alerts"
|
|
3
|
+
generated: true
|
|
4
|
+
---
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
# Primer CSS: `alerts` bundle
|
|
5
7
|
|
|
6
8
|
## Usage
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
|
|
9
11
|
|
|
10
12
|
```scss
|
|
11
|
-
@import "primer
|
|
13
|
+
@import "@primer/css/alerts/index.scss";
|
|
12
14
|
```
|
|
13
15
|
|
|
14
|
-
You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._
|
|
15
|
-
|
|
16
16
|
## Build
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
$ npm run build
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Documentation
|
|
25
|
-
|
|
26
|
-
Find further documentation at [primer.style/css/components/alerts](https://primer.style/css/components/alerts).
|
|
18
|
+
The `@primer/css` npm package includes a standalone CSS build of this module in `dist/alerts.css`.
|
|
27
19
|
|
|
28
20
|
## License
|
|
29
21
|
|
|
30
|
-
[MIT](
|
|
22
|
+
[MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
|
|
23
|
+
|
|
31
24
|
|
|
32
|
-
[
|
|
33
|
-
[docs]: https://primer.style/css
|
|
34
|
-
[npm]: https://www.npmjs.com/
|
|
35
|
-
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
|
|
36
|
-
[sass]: http://sass-lang.com/
|
|
25
|
+
[scss]: https://sass-lang.com/documentation/syntax#scss
|
package/alerts/flash.scss
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
// stylelint-disable selector-max-type, no-duplicate-selectors
|
|
2
|
+
|
|
1
3
|
// Default flash
|
|
2
|
-
// stylelint-disable selector-max-type
|
|
3
4
|
.flash {
|
|
4
5
|
position: relative;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
border:
|
|
9
|
-
border-radius:
|
|
6
|
+
// stylelint-disable-next-line primer/spacing
|
|
7
|
+
padding: 20px $spacer-3;
|
|
8
|
+
border-style: $border-style;
|
|
9
|
+
border-width: $border-width;
|
|
10
|
+
border-radius: $border-radius;
|
|
10
11
|
|
|
11
12
|
p:last-child {
|
|
12
13
|
margin-bottom: 0;
|
|
13
14
|
}
|
|
15
|
+
|
|
16
|
+
.octicon {
|
|
17
|
+
// stylelint-disable-next-line primer/spacing
|
|
18
|
+
margin-right: 12px;
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
// Contain the flash messages
|
|
@@ -23,59 +29,123 @@
|
|
|
23
29
|
float: right;
|
|
24
30
|
padding: $spacer-3;
|
|
25
31
|
margin: -$spacer-3;
|
|
26
|
-
color: inherit;
|
|
27
32
|
text-align: center;
|
|
28
33
|
cursor: pointer;
|
|
34
|
+
|
|
29
35
|
// Undo `<button>` styles
|
|
30
36
|
background: none;
|
|
31
37
|
border: 0;
|
|
32
38
|
appearance: none;
|
|
33
|
-
opacity: 0.6;
|
|
34
39
|
|
|
35
40
|
&:hover {
|
|
36
|
-
opacity:
|
|
41
|
+
opacity: 0.7;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:active {
|
|
45
|
+
opacity: 0.5;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.octicon {
|
|
49
|
+
margin-right: 0;
|
|
37
50
|
}
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
// Action button
|
|
41
54
|
.flash-action {
|
|
42
55
|
float: right;
|
|
56
|
+
// stylelint-disable-next-line primer/spacing
|
|
43
57
|
margin-top: -3px;
|
|
44
58
|
margin-left: $spacer-4;
|
|
59
|
+
background-clip: padding-box;
|
|
60
|
+
|
|
61
|
+
&.btn .octicon {
|
|
62
|
+
margin-right: $spacer-1;
|
|
63
|
+
color: var(--color-fg-muted);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.btn-primary .octicon {
|
|
67
|
+
color: inherit;
|
|
68
|
+
}
|
|
45
69
|
}
|
|
46
70
|
|
|
47
71
|
//
|
|
48
|
-
//
|
|
72
|
+
// Color variations
|
|
49
73
|
//
|
|
50
74
|
|
|
75
|
+
.flash {
|
|
76
|
+
color: var(--color-fg-default);
|
|
77
|
+
background-image: linear-gradient(var(--color-accent-subtle), var(--color-accent-subtle));
|
|
78
|
+
border-color: var(--color-accent-muted);
|
|
79
|
+
|
|
80
|
+
.octicon {
|
|
81
|
+
color: var(--color-accent-fg);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
51
85
|
.flash-warn {
|
|
52
|
-
color:
|
|
53
|
-
background-
|
|
54
|
-
border-color:
|
|
86
|
+
color: var(--color-fg-default);
|
|
87
|
+
background-image: linear-gradient(var(--color-attention-subtle), var(--color-attention-subtle));
|
|
88
|
+
border-color: var(--color-attention-muted);
|
|
89
|
+
|
|
90
|
+
.octicon {
|
|
91
|
+
color: var(--color-attention-fg);
|
|
92
|
+
}
|
|
55
93
|
}
|
|
56
94
|
|
|
57
95
|
.flash-error {
|
|
58
|
-
color:
|
|
59
|
-
background-
|
|
60
|
-
border-color:
|
|
96
|
+
color: var(--color-fg-default);
|
|
97
|
+
background-image: linear-gradient(var(--color-danger-subtle), var(--color-danger-subtle));
|
|
98
|
+
border-color: var(--color-danger-muted);
|
|
99
|
+
|
|
100
|
+
.octicon {
|
|
101
|
+
color: var(--color-danger-fg);
|
|
102
|
+
}
|
|
61
103
|
}
|
|
62
104
|
|
|
63
105
|
.flash-success {
|
|
64
|
-
color:
|
|
65
|
-
background-
|
|
66
|
-
border-color:
|
|
106
|
+
color: var(--color-fg-default);
|
|
107
|
+
background-image: linear-gradient(var(--color-success-subtle), var(--color-success-subtle));
|
|
108
|
+
border-color: var(--color-success-muted);
|
|
109
|
+
|
|
110
|
+
.octicon {
|
|
111
|
+
color: var(--color-success-fg);
|
|
112
|
+
}
|
|
67
113
|
}
|
|
68
114
|
|
|
115
|
+
//
|
|
116
|
+
// Layout variations
|
|
117
|
+
//
|
|
118
|
+
|
|
69
119
|
.flash-full {
|
|
120
|
+
// stylelint-disable-next-line primer/spacing
|
|
70
121
|
margin-top: -1px;
|
|
71
|
-
border-width:
|
|
122
|
+
border-width: $border-width 0;
|
|
123
|
+
border-radius: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// A banner rendered at the top of the page.
|
|
127
|
+
.flash-banner {
|
|
128
|
+
position: fixed;
|
|
129
|
+
top: 0;
|
|
130
|
+
z-index: 90;
|
|
131
|
+
width: 100%;
|
|
132
|
+
border-top: 0;
|
|
133
|
+
border-right: 0;
|
|
134
|
+
border-left: 0;
|
|
72
135
|
border-radius: 0;
|
|
73
136
|
}
|
|
74
137
|
|
|
138
|
+
// Makes sure the background is opaque to cover any content underneath
|
|
139
|
+
.flash-full,
|
|
140
|
+
.flash-banner {
|
|
141
|
+
background-color: var(--color-canvas-default);
|
|
142
|
+
}
|
|
143
|
+
|
|
75
144
|
// FIXME deprecate this
|
|
76
145
|
.warning {
|
|
77
146
|
padding: $em-spacer-5;
|
|
147
|
+
// stylelint-disable-next-line primer/spacing
|
|
78
148
|
margin-bottom: 0.8em;
|
|
79
149
|
font-weight: $font-weight-bold;
|
|
80
|
-
background-color:
|
|
150
|
+
background-color: var(--color-attention-subtle);
|
|
81
151
|
}
|