@primer/css 0.0.0-20220120020705 → 0.0.0-20220120204717
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 +2 -14
- package/actionlist/action-list-item.scss +9 -22
- package/button-refactor/ButtonsLinksAPI.md +112 -0
- package/button-refactor/button-group.scss +27 -0
- package/button-refactor/button.scss +249 -0
- package/button-refactor/icon-button.scss +14 -0
- package/button-refactor/link-styled-as-button.scss +75 -0
- package/button-refactor/link.scss +25 -0
- package/color-modes/native.scss +0 -11
- package/core/index.scss +5 -1
- package/dist/actionlist.css +1 -1
- package/dist/actionlist.css.map +1 -1
- package/dist/alerts.css.map +1 -1
- package/dist/autocomplete.css.map +1 -1
- package/dist/avatars.css.map +1 -1
- package/dist/base.css.map +1 -1
- package/dist/blankslate.css.map +1 -1
- package/dist/box.css.map +1 -1
- package/dist/branch-name.css.map +1 -1
- package/dist/breadcrumb.css.map +1 -1
- package/dist/buttons.css.map +1 -1
- package/dist/color-modes.css +1 -1
- package/dist/color-modes.css.map +1 -1
- package/dist/core.css +1 -1
- package/dist/core.css.map +1 -1
- package/dist/dropdown.css.map +1 -1
- package/dist/forms.css.map +1 -1
- package/dist/header.css.map +1 -1
- package/dist/labels.css.map +1 -1
- package/dist/layout.css +1 -1
- package/dist/layout.css.map +1 -1
- package/dist/links.css.map +1 -1
- package/dist/loaders.css.map +1 -1
- package/dist/markdown.css.map +1 -1
- package/dist/marketing-buttons.css.map +1 -1
- package/dist/marketing-links.css.map +1 -1
- package/dist/marketing-type.css.map +1 -1
- package/dist/marketing-utilities.css.map +1 -1
- package/dist/meta.json +66 -66
- package/dist/navigation.css.map +1 -1
- package/dist/pagination.css +1 -1
- package/dist/pagination.css.map +1 -1
- package/dist/popover.css.map +1 -1
- package/dist/primer.css +2 -2
- package/dist/primer.css.map +1 -1
- package/dist/progress.css.map +1 -1
- package/dist/select-menu.css.map +1 -1
- package/dist/stats/actionlist.json +1 -1
- package/dist/stats/color-modes.json +1 -1
- package/dist/stats/core.json +1 -1
- package/dist/stats/layout.json +1 -1
- package/dist/stats/pagination.json +1 -1
- package/dist/stats/primer.json +1 -1
- package/dist/subhead.css.map +1 -1
- package/dist/timeline.css.map +1 -1
- package/dist/toasts.css.map +1 -1
- package/dist/tooltips.css.map +1 -1
- package/dist/truncate.css.map +1 -1
- package/dist/utilities.css.map +1 -1
- package/layout/layout.scss +1 -2
- package/package.json +1 -3
- package/pagination/pagination.scss +1 -38
- package/support/mixins/misc.scss +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
# @primer/css
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Fake entry to force publishing
|
|
8
|
-
|
|
9
|
-
* [#1890](https://github.com/primer/css/pull/1890) [`0b469228`](https://github.com/primer/css/commit/0b469228c05224609f4ae370f304a0fe58760de8) Thanks [@andrialexandrou](https://github.com/andrialexandrou)! - Adds --color-accent-emphasis and --color-fg-on-emphasis rules for Windows High Contrast Mode
|
|
10
|
-
|
|
11
|
-
- [#1882](https://github.com/primer/css/pull/1882) [`4a06aba1`](https://github.com/primer/css/commit/4a06aba1d3f80bcc228ff4360d0e02d5ace158ff) Thanks [@tqwewe](https://github.com/tqwewe)! - Fix layout gutter none styles
|
|
12
|
-
|
|
13
|
-
* [#1894](https://github.com/primer/css/pull/1894) [`d1adf595`](https://github.com/primer/css/commit/d1adf595308afb97f83c5ca172222944189a5961) Thanks [@simurai](https://github.com/simurai)! - Make `pagination` responsive by default
|
|
14
|
-
|
|
15
|
-
## 19.2.0
|
|
3
|
+
## 0.0.0-20220120204717
|
|
16
4
|
|
|
17
5
|
### Minor Changes
|
|
18
6
|
|
|
@@ -24,7 +12,7 @@
|
|
|
24
12
|
|
|
25
13
|
* [#1869](https://github.com/primer/css/pull/1869) [`868f61a1`](https://github.com/primer/css/commit/868f61a199df14862922d52905de66cdb1e1c192) Thanks [@jdanyow](https://github.com/jdanyow)! - Minor bugfix for AvatarStack. Removing the box-shadow from the AvatarStack-body on hover.
|
|
26
14
|
|
|
27
|
-
-
|
|
15
|
+
- Fake entry to force publishing
|
|
28
16
|
|
|
29
17
|
* [#1870](https://github.com/primer/css/pull/1870) [`815daff9`](https://github.com/primer/css/commit/815daff9f07d8096d572cf75bee17284f36492f6) Thanks [@vdepizzol](https://github.com/vdepizzol)! - [ActionList] Add hover to `aria-current` elements and other micro interactions
|
|
30
18
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// stylelint-disable max-nesting-depth, selector-max-specificity
|
|
1
|
+
// stylelint-disable max-nesting-depth, selector-max-specificity
|
|
2
2
|
|
|
3
3
|
@mixin focusOutline {
|
|
4
4
|
position: relative;
|
|
@@ -38,50 +38,34 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// only hover li without list as children
|
|
41
|
-
&:not(.ActionList-item--hasSubItem)
|
|
42
|
-
// target contents of first child li if sub-item (li wraps item label + nested ul)
|
|
43
|
-
&.ActionList-item--hasSubItem > .ActionList-content {
|
|
41
|
+
&:not(.ActionList-item--hasSubItem) {
|
|
44
42
|
@media (hover: hover) {
|
|
45
43
|
&:hover {
|
|
46
44
|
cursor: pointer;
|
|
47
45
|
background-color: var(--color-action-list-item-default-hover-bg);
|
|
48
|
-
|
|
49
|
-
&:not(.ActionList-item--navActive) {
|
|
50
|
-
// Support for "Windows high contrast mode"
|
|
51
|
-
outline: $border-style $border-width transparent;
|
|
52
|
-
outline-offset: -$border-width;
|
|
53
|
-
// stylelint-disable-next-line primer/box-shadow
|
|
54
|
-
box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
|
|
55
|
-
}
|
|
56
46
|
}
|
|
57
47
|
}
|
|
58
48
|
|
|
59
49
|
&:active {
|
|
60
50
|
background: var(--color-action-list-item-default-active-bg);
|
|
61
51
|
|
|
62
|
-
&:not(.ActionList-item--navActive) {
|
|
63
|
-
// Support for "Windows high contrast mode" https://sarahmhigley.com/writing/whcm-quick-tips/
|
|
64
|
-
outline: $border-style $border-width transparent;
|
|
65
|
-
outline-offset: -$border-width;
|
|
66
|
-
// stylelint-disable-next-line primer/box-shadow
|
|
67
|
-
box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
52
|
@media screen and (prefers-reduced-motion: no-preference) {
|
|
71
53
|
animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
|
|
72
54
|
}
|
|
73
55
|
|
|
56
|
+
// stylelint-disable primer/box-shadow
|
|
74
57
|
@keyframes ActionList-item-active-bg {
|
|
75
58
|
50% {
|
|
76
|
-
|
|
77
|
-
box-shadow: inset 0 2px 12px 6px rgba(var(--color-canvas-default), 0.4);
|
|
59
|
+
box-shadow: inset 0 0 0 rgba(#000, 0.04);
|
|
78
60
|
transform: scale(1);
|
|
79
61
|
}
|
|
80
62
|
|
|
81
63
|
100% {
|
|
64
|
+
box-shadow: inset 0 3px 9px rgba(#000, 0.04);
|
|
82
65
|
transform: scale(0.97);
|
|
83
66
|
}
|
|
84
67
|
}
|
|
68
|
+
// stylelint-enable primer/box-shadow
|
|
85
69
|
}
|
|
86
70
|
|
|
87
71
|
// hide dividers
|
|
@@ -169,6 +153,7 @@
|
|
|
169
153
|
|
|
170
154
|
// has 16px leading visual
|
|
171
155
|
.ActionList-content--visual16 + .ActionList--subGroup {
|
|
156
|
+
// stylelint-disable-next-line selector-max-compound-selectors
|
|
172
157
|
.ActionList-content {
|
|
173
158
|
padding-left: $spacer-5;
|
|
174
159
|
}
|
|
@@ -176,6 +161,7 @@
|
|
|
176
161
|
|
|
177
162
|
// has 20px leading visual
|
|
178
163
|
.ActionList-content--visual20 + .ActionList--subGroup {
|
|
164
|
+
// stylelint-disable-next-line selector-max-compound-selectors
|
|
179
165
|
.ActionList-content {
|
|
180
166
|
padding-left: $spacer-2 * 4.5; // 36px
|
|
181
167
|
}
|
|
@@ -183,6 +169,7 @@
|
|
|
183
169
|
|
|
184
170
|
// has 24px leading visual
|
|
185
171
|
.ActionList-content--visual24 + .ActionList--subGroup {
|
|
172
|
+
// stylelint-disable-next-line selector-max-compound-selectors
|
|
186
173
|
.ActionList-content {
|
|
187
174
|
padding-left: $spacer-6;
|
|
188
175
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Button and Link component APIs
|
|
2
|
+
Button and Link has been discussed in a number of issues and discussions over past few years. I went through the list below, took note of their purpose and started compiling a new API spec. This doc is is meant to be collaborative and accompany Storybook docs while we work through a final API recommendation. Once we have a solid plan, this can move into an issue and be delegated across frameworks.
|
|
3
|
+
|
|
4
|
+
Existing issues
|
|
5
|
+
- https://github.com/github/primer/issues/141
|
|
6
|
+
-- Accessory button component, should reconcile with reaction button (sister component to Button)
|
|
7
|
+
- https://github.com/github/primer/issues/220
|
|
8
|
+
-- Tracking issue, mentions Button in the context of API consistency
|
|
9
|
+
- https://github.com/github/primer/issues/253
|
|
10
|
+
-- Button audit, anatomy spec, design considerations, some button link discussion, icon buttons (this issue is very informative!)
|
|
11
|
+
- https://github.com/github/primer/issues/263
|
|
12
|
+
-- More design discussion, particularly focused on outline button
|
|
13
|
+
- https://github.com/github/primer/issues/272
|
|
14
|
+
-- Make icon only buttons square
|
|
15
|
+
- https://github.com/github/primer/issues/321
|
|
16
|
+
-- Super specific button use case?
|
|
17
|
+
- https://github.com/github/primer/issues/350
|
|
18
|
+
-- a11y audit with task list for PVC
|
|
19
|
+
- https://github.com/github/primer/issues/382
|
|
20
|
+
-- React button refactor
|
|
21
|
+
- https://github.com/github/primer/issues/468
|
|
22
|
+
-- Visual bugs (colors, state)
|
|
23
|
+
- https://github.com/github/primer/discussions/87
|
|
24
|
+
-- Discussion about accessory buttons
|
|
25
|
+
- https://github.com/github/primer/discussions/211
|
|
26
|
+
-- Open ended discussion about primary button as dropdown
|
|
27
|
+
- https://github.com/github/primer/discussions/459
|
|
28
|
+
-- Allie's thoughts on limiting icon only buttons and working towards encouraging visual labels
|
|
29
|
+
- https://github.com/github/primer/discussions/477
|
|
30
|
+
-- Buttons styled as links, links styled as buttons
|
|
31
|
+
|
|
32
|
+
## Specific notes from previous bugs to keep in mind
|
|
33
|
+
- [ ] Check all button variants have shadow present
|
|
34
|
+
- [ ] Ensure icon colors are consistent in hover states
|
|
35
|
+
- [ ] Ensure icon colors are consistent with variants in all states
|
|
36
|
+
- [ ] Ensure disabled colors are consistent across frameworks
|
|
37
|
+
|
|
38
|
+
## Component list
|
|
39
|
+
A few discussions were about naming and prop drilling (source here). We found that for Button to handle all of its use cases, we would need a large number of props– some conditional and dependent on one another. When that happens, it's typically a sign that the logic should be separated into another component.
|
|
40
|
+
|
|
41
|
+
| Component | Description |
|
|
42
|
+
| -- | -- |
|
|
43
|
+
| Button | standard `button` with variants, size, visual slots |
|
|
44
|
+
| IconButton | `button` with icon only (square) and required `aria-label` |
|
|
45
|
+
| ReactionButton | `button` snowflake with specific styles/interaction design (round) potentially a variant |
|
|
46
|
+
| ButtonGroup | wrapper to handle grouping buttons |
|
|
47
|
+
| Link | `a` with variants, optional trailing visuals |
|
|
48
|
+
| LinkStyledAsButton | `a` with button variants, required trailing visual |
|
|
49
|
+
|
|
50
|
+
## Component API breakdown
|
|
51
|
+
|
|
52
|
+
### Button
|
|
53
|
+
|
|
54
|
+
| prop | type | options | default | notes |
|
|
55
|
+
| -- | -- | -- | -- | -- |
|
|
56
|
+
| `variant` | one-of string | `primary` `secondary` `danger` `invisible` | `secondary` | |
|
|
57
|
+
| `size` | one-of string | `small` `default` `large` | `default` | |
|
|
58
|
+
| `label` | string | button description | null | |
|
|
59
|
+
| `aria-label` | string | button description for screen readers | null | |
|
|
60
|
+
| `aria-pressed` | boolean | `true/false` | `false` | |
|
|
61
|
+
| `leadingVisual` | children (slot) | octicon | null | |
|
|
62
|
+
| `trailingVisual` | children (slot) | octicon | null | |
|
|
63
|
+
| `trailingAction` | children (slot) | octicon | null | slot for caret to maintain leading/trailing visuals if they exist |
|
|
64
|
+
| `fullWidth` | boolean | `true/false` | `false` | |
|
|
65
|
+
| `visualPosition` | one-of string | `fixed` `some-other-word` | `fixed` | lock icon to the text label or to the button container |
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### LinkStyledAsButton
|
|
69
|
+
|
|
70
|
+
| prop | type | options | default | notes |
|
|
71
|
+
| -- | -- | -- | -- | -- |
|
|
72
|
+
| `variant` | one-of string | `primary` `secondary` `danger` `invisible` | `secondary` | |
|
|
73
|
+
| `size` | one-of string | `small` `default` `large` | `default` | |
|
|
74
|
+
| `label` | string | button description | null | |
|
|
75
|
+
| `leadingVisual` | children (slot) | octicon | null | |
|
|
76
|
+
| `trailingVisual` | children (slot) | octicon | null | |
|
|
77
|
+
| `showTrailingAction` | arrow octicon | `true/false` | true? | show trailingVisual icon to indicate linkyness |
|
|
78
|
+
| `fullWidth` | boolean | `true/false` | `false` | |
|
|
79
|
+
| `visualPosition` | one-of string | `fixed` `some-other-word` | `fixed` | lock icon to the text label or to the button container |
|
|
80
|
+
|
|
81
|
+
### IconButton
|
|
82
|
+
|
|
83
|
+
| prop | type | options | default | notes |
|
|
84
|
+
| -- | -- | -- | -- | -- |
|
|
85
|
+
| `variant` | one-of string | `primary` `secondary` `danger` `outline`? | `secondary` | |
|
|
86
|
+
| `size` | one-of string | `small` `default` `large` | `default | |
|
|
87
|
+
| `aria-label` | string | button description for screen readers (required) | null | |
|
|
88
|
+
| `visual` | children (slot) | octicon | null | |
|
|
89
|
+
| `aria-pressed` | boolean | `true/false` | `false` | |
|
|
90
|
+
|
|
91
|
+
### Link
|
|
92
|
+
|
|
93
|
+
| prop | type | options | default | notes |
|
|
94
|
+
| -- | -- | -- | -- | -- |
|
|
95
|
+
| `variant` | one-of string | ?? we need to work on this (subtle and or muted) | |
|
|
96
|
+
| `label` | string | button description | null | |
|
|
97
|
+
| `showTrailingAction` | boolean | specific octicon for new tab or new page (or anchor?) | null | |
|
|
98
|
+
|
|
99
|
+
### ButtonGroup
|
|
100
|
+
|
|
101
|
+
| prop | type | options | default | notes |
|
|
102
|
+
| -- | -- | -- | -- | -- |
|
|
103
|
+
| `children` | child slot | | | |
|
|
104
|
+
|
|
105
|
+
## Next review session
|
|
106
|
+
- [ ] Help refine transition animations + tokenize
|
|
107
|
+
- [ ] Icon colors- same as button text, or specific?
|
|
108
|
+
- [ ] for `LinkStyledAsButton` should `trailingAction` slot be reserved for the > chevron indicating this is a link and not a button? Or is it more of a `trailingVisual`?
|
|
109
|
+
- [ ] What color should `invisible` button variant be? Blue or grey?
|
|
110
|
+
- [ ] No aria-label for `LinkStyledAsButton`
|
|
111
|
+
- [ ] Do we like `fullWidth` or `block` as a prop for width behavior?
|
|
112
|
+
- [ ] Should `ButtonGroup` offer an option with gaps (more of a layout tool)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.ButtonGroup {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// reset border-radius
|
|
7
|
+
.ButtonGroup-item {
|
|
8
|
+
border-right-width: 0;
|
|
9
|
+
border-radius: 0;
|
|
10
|
+
|
|
11
|
+
&:first-of-type {
|
|
12
|
+
border-top-left-radius: $border-radius;
|
|
13
|
+
border-bottom-left-radius: $border-radius;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:last-of-type {
|
|
17
|
+
border-right-width: $border-width;
|
|
18
|
+
border-top-right-radius: $border-radius;
|
|
19
|
+
border-bottom-right-radius: $border-radius;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ensure that the focus ring sits above the adjacent buttons
|
|
23
|
+
&:focus,
|
|
24
|
+
&:active {
|
|
25
|
+
z-index: 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
// base button
|
|
2
|
+
.Button {
|
|
3
|
+
position: relative;
|
|
4
|
+
font-size: $body-font-size;
|
|
5
|
+
font-weight: $font-weight-semibold;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
user-select: none;
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
border: $border-width $border-style;
|
|
10
|
+
border-color: transparent;
|
|
11
|
+
border-radius: $border-radius;
|
|
12
|
+
color: var(--color-btn-text);
|
|
13
|
+
transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);
|
|
14
|
+
transition-property: color, background-color, border-color;
|
|
15
|
+
text-align: center;
|
|
16
|
+
height: 32px;
|
|
17
|
+
padding: 0 16px;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: $spacer-2;
|
|
23
|
+
|
|
24
|
+
// mobile friendly sizing
|
|
25
|
+
@media (pointer: course) {
|
|
26
|
+
&::before {
|
|
27
|
+
@include minTouchTarget(48px, 48px);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// base states
|
|
32
|
+
|
|
33
|
+
&:hover,
|
|
34
|
+
[open] > & {
|
|
35
|
+
transition-duration: 0.1s;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:active,
|
|
39
|
+
&.Button--active {
|
|
40
|
+
transition: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:disabled,
|
|
44
|
+
&.Button--disabled,
|
|
45
|
+
&[aria-disabled='true'] {
|
|
46
|
+
cursor: not-allowed;
|
|
47
|
+
box-shadow: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:focus {
|
|
51
|
+
@include focusOutline;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// wrap grid content to allow trailingAction to lock-right
|
|
56
|
+
.Button-content {
|
|
57
|
+
flex: 1 0 auto;
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-areas: 'leadingVisual text trailingVisual';
|
|
60
|
+
grid-template-columns: min-content minmax(0, auto) min-content;
|
|
61
|
+
align-items: center;
|
|
62
|
+
|
|
63
|
+
> :not(:last-child) {
|
|
64
|
+
margin-right: $spacer-2;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// center child elements for fullWidth
|
|
69
|
+
.Button-content--visualFixed {
|
|
70
|
+
place-content: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// button child elements
|
|
74
|
+
|
|
75
|
+
// align svg
|
|
76
|
+
.Button-visual {
|
|
77
|
+
display: flex;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.Button-label {
|
|
81
|
+
grid-area: text;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.Button-leadingVisual {
|
|
86
|
+
grid-area: leadingVisual;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.Button-trailingVisual {
|
|
90
|
+
grid-area: trailingVisual;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.Button-trailingAction {
|
|
94
|
+
margin-right: -8px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// sizes
|
|
98
|
+
|
|
99
|
+
.Button--small {
|
|
100
|
+
height: 28px;
|
|
101
|
+
font-size: $font-size-small;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.Button--large {
|
|
105
|
+
height: 44px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.Button--fullWidth {
|
|
109
|
+
width: 100%;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// variants
|
|
113
|
+
|
|
114
|
+
// primary
|
|
115
|
+
.Button--primary {
|
|
116
|
+
color: var(--color-btn-primary-text);
|
|
117
|
+
fill: var(--color-btn-primary-icon);
|
|
118
|
+
background-color: var(--color-btn-primary-bg);
|
|
119
|
+
border-color: var(--color-btn-primary-border);
|
|
120
|
+
box-shadow: var(--color-btn-primary-shadow), var(--color-btn-primary-inset-shadow);
|
|
121
|
+
|
|
122
|
+
&:hover,
|
|
123
|
+
[open] > & {
|
|
124
|
+
background-color: var(--color-btn-primary-hover-bg);
|
|
125
|
+
border-color: var(--color-btn-primary-hover-border);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:active,
|
|
129
|
+
&[aria-pressed='true'],
|
|
130
|
+
&.Button--pressed {
|
|
131
|
+
background-color: var(--color-btn-primary-selected-bg);
|
|
132
|
+
box-shadow: var(--color-btn-primary-selected-shadow);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:disabled,
|
|
136
|
+
&.Button--disabled,
|
|
137
|
+
&[aria-disabled='true'] {
|
|
138
|
+
color: var(--color-btn-primary-disabled-text);
|
|
139
|
+
background-color: var(--color-btn-primary-disabled-bg);
|
|
140
|
+
border-color: var(--color-btn-primary-disabled-border);
|
|
141
|
+
fill: var(--color-btn-primary-disabled-text);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// default (secondary)
|
|
146
|
+
.Button--secondary {
|
|
147
|
+
color: var(--color-btn-text);
|
|
148
|
+
fill: var(--color-fg-muted); // help this
|
|
149
|
+
background-color: var(--color-btn-bg);
|
|
150
|
+
border: $border-width $border-style;
|
|
151
|
+
border-color: var(--color-btn-border);
|
|
152
|
+
box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
|
|
153
|
+
|
|
154
|
+
&:hover,
|
|
155
|
+
[open] > & {
|
|
156
|
+
background-color: var(--color-btn-hover-bg);
|
|
157
|
+
border-color: var(--color-btn-hover-border);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&:active,
|
|
161
|
+
&.Button--active {
|
|
162
|
+
background-color: var(--color-btn-active-bg);
|
|
163
|
+
border-color: var(--color-btn-active-border);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&[aria-pressed='true'],
|
|
167
|
+
&.Button--pressed {
|
|
168
|
+
background-color: var(--color-btn-selected-bg);
|
|
169
|
+
box-shadow: var(--color-primer-shadow-inset);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:disabled,
|
|
173
|
+
&.Button--disabled,
|
|
174
|
+
&[aria-disabled='true'] {
|
|
175
|
+
color: var(--color-primer-fg-disabled);
|
|
176
|
+
background-color: var(--color-btn-bg);
|
|
177
|
+
border-color: var(--color-btn-border);
|
|
178
|
+
fill: var(--color-primer-fg-disabled);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.Button--invisible {
|
|
183
|
+
color: var(--color-btn-outline-text);
|
|
184
|
+
fill: var(--color-btn-outline-text);
|
|
185
|
+
background-color: var(--color-canvas-default);
|
|
186
|
+
border: $border-width $border-style;
|
|
187
|
+
border-color: var(--color-canvas-default);
|
|
188
|
+
|
|
189
|
+
&:hover,
|
|
190
|
+
[open] > & {
|
|
191
|
+
background-color: var(--color-btn-hover-bg);
|
|
192
|
+
border-color: var(--color-btn-hover-bg);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&[aria-pressed='true'],
|
|
196
|
+
&:active,
|
|
197
|
+
&.Button--active,
|
|
198
|
+
&.Button--pressed {
|
|
199
|
+
background-color: var(--color-btn-selected-bg);
|
|
200
|
+
box-shadow: var(--color-primer-shadow-inset);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&:disabled,
|
|
204
|
+
&.Button--disabled,
|
|
205
|
+
&[aria-disabled='true'] {
|
|
206
|
+
color: var(--color-primer-fg-disabled);
|
|
207
|
+
background-color: var(--color-btn-bg);
|
|
208
|
+
border-color: var(--color-btn-border);
|
|
209
|
+
fill: var(--color-primer-fg-disabled);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// danger
|
|
214
|
+
.Button--danger {
|
|
215
|
+
color: var(--color-btn-danger-text);
|
|
216
|
+
fill: var(--color-btn-danger-icon);
|
|
217
|
+
background-color: var(--color-btn-bg);
|
|
218
|
+
border: $border-width $border-style;
|
|
219
|
+
border-color: var(--color-btn-border);
|
|
220
|
+
box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
|
|
221
|
+
|
|
222
|
+
&:hover,
|
|
223
|
+
[open] > & {
|
|
224
|
+
color: var(--color-btn-danger-hover-text);
|
|
225
|
+
fill: var(--color-btn-danger-hover-text);
|
|
226
|
+
background-color: var(--color-btn-danger-hover-bg);
|
|
227
|
+
border-color: var(--color-btn-danger-hover-border);
|
|
228
|
+
box-shadow: var(--color-btn-danger-hover-shadow), var(--color-btn-danger-hover-inset-shadow);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&:active,
|
|
232
|
+
&[aria-pressed='true'],
|
|
233
|
+
&.Button--pressed {
|
|
234
|
+
color: var(--color-btn-danger-selected-text);
|
|
235
|
+
fill: var(--color-btn-danger-selected-text);
|
|
236
|
+
background-color: var(--color-btn-danger-selected-bg);
|
|
237
|
+
border-color: var(--color-btn-danger-selected-border);
|
|
238
|
+
box-shadow: var(--color-btn-danger-selected-shadow);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
&:disabled,
|
|
242
|
+
&.disabled,
|
|
243
|
+
&[aria-disabled='true'] {
|
|
244
|
+
color: var(--color-btn-danger-disabled-text);
|
|
245
|
+
fill: var(--color-btn-danger-disabled-text);
|
|
246
|
+
background-color: var(--color-btn-danger-disabled-bg);
|
|
247
|
+
border-color: var(--color-btn-border);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// base link
|
|
2
|
+
.LinkStyledAsButton {
|
|
3
|
+
@extend .Button;
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
|
|
6
|
+
&:hover {
|
|
7
|
+
text-decoration: none;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.LinkStyledAsButton-content {
|
|
12
|
+
@extend .Button-content;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.LinkStyledAsButton-content--visualFixed {
|
|
16
|
+
@extend .Button-content--visualFixed;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// link child elements
|
|
20
|
+
|
|
21
|
+
.LinkStyledAsButton-visual {
|
|
22
|
+
@extend .Button-visual;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.LinkStyledAsButton-label {
|
|
26
|
+
@extend .Button-label;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.LinkStyledAsButton-leadingVisual {
|
|
30
|
+
@extend .Button-leadingVisual;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.LinkStyledAsButton-trailingVisual {
|
|
34
|
+
@extend .Button-trailingVisual;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.LinkStyledAsButton-trailingAction {
|
|
38
|
+
@extend .Button-trailingAction;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// sizes
|
|
42
|
+
|
|
43
|
+
.LinkStyledAsButton--small {
|
|
44
|
+
@extend .Button--small;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.LinkStyledAsButton--large {
|
|
48
|
+
@extend .Button--large;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.LinkStyledAsButton--fullWidth {
|
|
52
|
+
@extend .Button--fullWidth;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// variants
|
|
56
|
+
|
|
57
|
+
// primary
|
|
58
|
+
.LinkStyledAsButton--primary {
|
|
59
|
+
@extend .Button--primary;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// default (secondary)
|
|
63
|
+
.LinkStyledAsButton--secondary {
|
|
64
|
+
@extend .Button--secondary;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// invisible
|
|
68
|
+
.LinkStyledAsButton--invisible {
|
|
69
|
+
@extend .Button--invisible;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// danger
|
|
73
|
+
.LinkStyledAsButton--danger {
|
|
74
|
+
@extend .Button--danger;
|
|
75
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.Link {
|
|
2
|
+
color: var(--color-accent-fg);
|
|
3
|
+
|
|
4
|
+
&:hover {
|
|
5
|
+
text-decoration: underline;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// variants
|
|
10
|
+
|
|
11
|
+
&.Link--muted {
|
|
12
|
+
color: var(--color-fg-muted);
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
color: var(--color-accent-fg);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.Link-trailingVisual {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 4px;
|
|
25
|
+
}
|
package/color-modes/native.scss
CHANGED
|
@@ -9,14 +9,3 @@
|
|
|
9
9
|
color: var(--color-fg-default);
|
|
10
10
|
background-color: var(--color-canvas-default);
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
// Windows High Contrast mode
|
|
14
|
-
|
|
15
|
-
// Improves focus state for various components when Windows High Contrast mode is enabled
|
|
16
|
-
// stylelint-disable selector-max-type
|
|
17
|
-
@media (forced-colors: active) {
|
|
18
|
-
body {
|
|
19
|
-
--color-accent-emphasis: Highlight;
|
|
20
|
-
--color-fg-on-emphasis: LinkText;
|
|
21
|
-
}
|
|
22
|
-
}
|
package/core/index.scss
CHANGED
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
@import '../pagination/index.scss';
|
|
25
25
|
@import '../tooltips/index.scss';
|
|
26
26
|
@import '../truncate/index.scss';
|
|
27
|
-
|
|
27
|
+
@import '../button-refactor/button.scss';
|
|
28
|
+
@import '../button-refactor/link.scss';
|
|
29
|
+
@import '../button-refactor/icon-button.scss';
|
|
30
|
+
@import '../button-refactor/link-styled-as-button.scss';
|
|
31
|
+
@import '../button-refactor/button-group.scss';
|
|
28
32
|
// Utilities always go last so that they can override components
|
|
29
33
|
@import '../utilities/index.scss';
|