@primer/css 0.0.0-20220823123728 → 0.0.0-20220823201818
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 +1 -5
- package/RELEASING.md +1 -1
- package/actionlist/action-list-item-divider.scss +2 -2
- package/actionlist/action-list-item.scss +4 -4
- package/alerts/flash.scss +1 -1
- package/autocomplete/autocomplete.scss +1 -1
- package/autocomplete/suggester.scss +1 -1
- package/base/base.scss +1 -1
- package/base/normalize.scss +1 -1
- package/box/box.scss +1 -1
- package/button-refactor/ButtonsLinksAPI.md +116 -0
- package/button-refactor/button-group.scss +27 -0
- package/button-refactor/button.scss +305 -0
- package/button-refactor/icon-button.scss +14 -0
- package/button-refactor/index.scss +6 -0
- package/button-refactor/link-styled-as-button.scss +75 -0
- package/button-refactor/link.scss +28 -0
- package/buttons/button.scss +2 -2
- package/buttons/misc.scss +2 -2
- package/core/index.scss +1 -2
- package/deprecations.json +0 -2
- package/dist/button-refactor.css +2 -0
- package/dist/button-refactor.css.map +1 -0
- package/dist/button-refactor.js +1 -0
- package/dist/core.css +1 -1
- package/dist/core.css.map +1 -1
- package/dist/deprecations.json +0 -2
- package/dist/labels.css +1 -1
- package/dist/marketing-buttons.css +1 -1
- package/dist/marketing-buttons.css.map +1 -1
- package/dist/marketing-links.css.map +1 -1
- package/dist/marketing-type.css +1 -1
- package/dist/marketing-type.css.map +1 -1
- package/dist/marketing-utilities.css.map +1 -1
- package/dist/marketing.css +1 -1
- package/dist/marketing.css.map +1 -1
- package/dist/meta.json +122 -111
- package/dist/primer.css +3 -3
- package/dist/primer.css.map +1 -1
- package/dist/product.css +1 -1
- package/dist/stats/button-refactor.json +1 -0
- package/dist/stats/core.json +1 -1
- package/dist/stats/labels.json +1 -1
- package/dist/stats/marketing-buttons.json +1 -1
- package/dist/stats/marketing-type.json +1 -1
- package/dist/stats/marketing.json +1 -1
- package/dist/stats/primer.json +1 -1
- package/dist/stats/product.json +1 -1
- package/dist/stats/utilities.json +1 -1
- package/dist/utilities.css +1 -1
- package/dist/utilities.css.map +1 -1
- package/dist/variables.json +63 -73
- package/forms/form-control.scss +2 -2
- package/forms/form-group.scss +1 -1
- package/header/header.scss +1 -1
- package/labels/counters.scss +1 -1
- package/labels/diffstat.scss +1 -1
- package/labels/states.scss +1 -1
- package/markdown/blob-csv.scss +1 -1
- package/markdown/headings.scss +1 -1
- package/markdown/lists.scss +1 -1
- package/markdown/tables.scss +1 -1
- package/marketing/buttons/button.scss +4 -4
- package/marketing/support/variables.scss +4 -5
- package/marketing/type/typography.scss +11 -40
- package/navigation/filter-list.scss +1 -1
- package/navigation/menu.scss +1 -1
- package/navigation/sidenav.scss +1 -1
- package/navigation/subnav.scss +1 -1
- package/navigation/underline-nav.scss +2 -2
- package/overlay/overlay.scss +1 -1
- package/package.json +1 -1
- package/select-menu/select-menu.scss +4 -4
- package/subhead/subhead.scss +1 -1
- package/support/mixins/typography.scss +9 -9
- package/support/variables/typography.scss +2 -2
- package/utilities/typography.scss +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
# @primer/css
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- [#2192](https://github.com/primer/css/pull/2192) [`c2134afe`](https://github.com/primer/css/commit/c2134afe4e9f7d752114bdbda5398608b8b0fe0a) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Prepare marketing typography for variable fonts, align font weights with OpenType spec
|
|
3
|
+
## 0.0.0-20220823201818
|
|
8
4
|
|
|
9
5
|
### Patch Changes
|
|
10
6
|
|
package/RELEASING.md
CHANGED
|
@@ -31,7 +31,7 @@ The release process is automated by [changesets]. After you familiarize yourself
|
|
|
31
31
|
|
|
32
32
|
After tests run, the docs site will be deployed and `@primer/css` will be published with your changes to the `latest` dist-tag. You can check [npm](https://www.npmjs.com/package/@primer/css?activeTab=versions) to see if actions has finished.
|
|
33
33
|
|
|
34
|
-
2.
|
|
34
|
+
2. Done! 🎉
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
## Update github.com (in `github/github`):
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
display: flex;
|
|
7
7
|
padding: ($spacer-1 * 1.5) $spacer-2;
|
|
8
8
|
font-size: $font-size-small;
|
|
9
|
-
font-weight: $font-weight-
|
|
9
|
+
font-weight: $font-weight-bold;
|
|
10
10
|
color: var(--color-fg-muted);
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
.ActionList-sectionDivider-title {
|
|
27
27
|
font-size: $font-size-small;
|
|
28
|
-
font-weight: $font-weight-
|
|
28
|
+
font-weight: $font-weight-bold;
|
|
29
29
|
color: var(--color-fg-muted);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
&.ActionList-item--navActive {
|
|
142
142
|
&:not(.ActionList-item--subItem) {
|
|
143
143
|
.ActionList-item-label {
|
|
144
|
-
font-weight: $font-weight-
|
|
144
|
+
font-weight: $font-weight-bold;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
|
|
438
438
|
&.ActionList-content--hasActiveSubItem {
|
|
439
439
|
> .ActionList-item-label {
|
|
440
|
-
font-weight: $font-weight-
|
|
440
|
+
font-weight: $font-weight-bold;
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
}
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
background: var(--color-action-list-item-default-selected-bg);
|
|
462
462
|
|
|
463
463
|
.ActionList-item-label {
|
|
464
|
-
font-weight: $font-weight-
|
|
464
|
+
font-weight: $font-weight-bold;
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
&::before,
|
|
@@ -542,7 +542,7 @@
|
|
|
542
542
|
}
|
|
543
543
|
|
|
544
544
|
.ActionList-item-label {
|
|
545
|
-
font-weight: $font-weight-
|
|
545
|
+
font-weight: $font-weight-bold;
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
|
package/alerts/flash.scss
CHANGED
package/base/base.scss
CHANGED
package/base/normalize.scss
CHANGED
package/box/box.scss
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
- https://github.com/github/primer/issues/65
|
|
32
|
+
-- Segmented control, pressed state discussion
|
|
33
|
+
https://github.com/primer/design/pull/193
|
|
34
|
+
|
|
35
|
+
## Specific notes from previous bugs to keep in mind
|
|
36
|
+
- [ ] Check all button variants have shadow present
|
|
37
|
+
- [ ] Ensure icon colors are consistent in hover states
|
|
38
|
+
- [ ] Ensure icon colors are consistent with variants in all states
|
|
39
|
+
- [ ] Ensure disabled colors are consistent across frameworks
|
|
40
|
+
|
|
41
|
+
## Component list
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
| Component | Description |
|
|
45
|
+
| -- | -- |
|
|
46
|
+
| Button | standard `button` with variants, size, visual slots |
|
|
47
|
+
| IconButton | `button` with icon only (square) and required `aria-label` |
|
|
48
|
+
| ReactionButton | `button` snowflake with specific styles/interaction design (round) potentially a variant |
|
|
49
|
+
| ButtonGroup | wrapper to handle grouping buttons |
|
|
50
|
+
| Link | `a` with variants, optional trailing visuals |
|
|
51
|
+
| LinkStyledAsButton | `a` with button variants, required trailing visual |
|
|
52
|
+
|
|
53
|
+
## Component API breakdown
|
|
54
|
+
|
|
55
|
+
### Button
|
|
56
|
+
|
|
57
|
+
| prop | type | options | default | notes |
|
|
58
|
+
| -- | -- | -- | -- | -- |
|
|
59
|
+
| `variant` | one-of string | `primary` `secondary` `danger` `invisible` | `secondary` | |
|
|
60
|
+
| `size` | one-of string | `small` `default` `large` | `default` | |
|
|
61
|
+
| `label` | string | button description | null | |
|
|
62
|
+
| `aria-label` | string | button description for screen readers | null | |
|
|
63
|
+
| `aria-pressed` | boolean | `true/false` | `false` | |
|
|
64
|
+
| `leadingVisual` | children (slot) | octicon | null | |
|
|
65
|
+
| `trailingVisual` | children (slot) | octicon | null | |
|
|
66
|
+
| `trailingAction` | children (slot) | octicon | null | slot for caret to maintain leading/trailing visuals if they exist |
|
|
67
|
+
| `fullWidth` | boolean | `true/false` | `false` | |
|
|
68
|
+
| `visualPosition` | one-of string | `fixed` `some-other-word` | `fixed` | lock icon to the text label or to the button container |
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### LinkStyledAsButton
|
|
72
|
+
|
|
73
|
+
| prop | type | options | default | notes |
|
|
74
|
+
| -- | -- | -- | -- | -- |
|
|
75
|
+
| `variant` | one-of string | `primary` `secondary` `danger` `invisible` | `secondary` | |
|
|
76
|
+
| `size` | one-of string | `small` `default` `large` | `default` | |
|
|
77
|
+
| `label` | string | button description | null | |
|
|
78
|
+
| `leadingVisual` | children (slot) | octicon | null | |
|
|
79
|
+
| `trailingVisual` | children (slot) | octicon | null | |
|
|
80
|
+
| `showTrailingAction` | arrow octicon | `true/false` | true? | show trailingVisual icon to indicate linkyness |
|
|
81
|
+
| `fullWidth` | boolean | `true/false` | `false` | |
|
|
82
|
+
| `visualPosition` | one-of string | `fixed` `some-other-word` | `fixed` | lock icon to the text label or to the button container |
|
|
83
|
+
|
|
84
|
+
### IconButton
|
|
85
|
+
|
|
86
|
+
| prop | type | options | default | notes |
|
|
87
|
+
| -- | -- | -- | -- | -- |
|
|
88
|
+
| `variant` | one-of string | `primary` `secondary` `danger` `outline`? | `secondary` | |
|
|
89
|
+
| `size` | one-of string | `small` `default` `large` | `default | |
|
|
90
|
+
| `aria-label` | string | button description for screen readers (required) | null | |
|
|
91
|
+
| `visual` | children (slot) | octicon | null | |
|
|
92
|
+
| `aria-pressed` | boolean | `true/false` | `false` | |
|
|
93
|
+
|
|
94
|
+
### Link
|
|
95
|
+
|
|
96
|
+
| prop | type | options | default | notes |
|
|
97
|
+
| -- | -- | -- | -- | -- |
|
|
98
|
+
| `variant` | one-of string | ?? we need to work on this (subtle and or muted) | |
|
|
99
|
+
| `label` | string | button description | null | |
|
|
100
|
+
| `showTrailingAction` | boolean | specific octicon for new tab or new page (or anchor?) | null | |
|
|
101
|
+
|
|
102
|
+
### ButtonGroup
|
|
103
|
+
|
|
104
|
+
| prop | type | options | default | notes |
|
|
105
|
+
| -- | -- | -- | -- | -- |
|
|
106
|
+
| `children` | child slot | | | |
|
|
107
|
+
|
|
108
|
+
## Next review session
|
|
109
|
+
- [ ] Help refine transition animations + tokenize
|
|
110
|
+
- [ ] Icon colors- same as button text, or specific?
|
|
111
|
+
- [ ] 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`?
|
|
112
|
+
- [ ] What color should `invisible` button variant be? Blue or grey?
|
|
113
|
+
- [ ] No aria-label for `LinkStyledAsButton`
|
|
114
|
+
- [ ] Do we like `fullWidth` or `block` as a prop for width behavior?
|
|
115
|
+
- [ ] Should `ButtonGroup` offer an option with gaps (more of a layout tool)
|
|
116
|
+
- [ ] Should `Button` proper handle a `pressed` (formerly selected) state, or should we create a new component `SegmentedControl` that uses `Button` and provides specific design (color, shadows)?
|
|
@@ -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,305 @@
|
|
|
1
|
+
// temporary, pre primitives release
|
|
2
|
+
:root {
|
|
3
|
+
--primer-duration-fast: 80ms;
|
|
4
|
+
--primer-easing-easeInOut: cubic-bezier(0.65, 0, 0.35, 1);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// base button
|
|
8
|
+
.Button {
|
|
9
|
+
position: relative;
|
|
10
|
+
font-size: var(--primer-text-body-size-medium);
|
|
11
|
+
font-weight: var(--base-text-weight-medium);
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
user-select: none;
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
border: var(--primer-borderWidth-thin) solid;
|
|
16
|
+
border-color: transparent;
|
|
17
|
+
border-radius: var(--primer-borderRadius-medium);
|
|
18
|
+
color: var(--color-btn-text);
|
|
19
|
+
transition: var(--primer-duration-fast) var(--primer-easing-easeInOut);
|
|
20
|
+
transition-property: color, fill, background-color, border-color;
|
|
21
|
+
text-align: center;
|
|
22
|
+
height: var(--primer-control-medium-size);
|
|
23
|
+
padding: 0 var(--primer-control-medium-paddingInline-normal);
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: var(--primer-control-medium-gap);
|
|
29
|
+
|
|
30
|
+
// mobile friendly sizing
|
|
31
|
+
@media (pointer: course) {
|
|
32
|
+
&::before {
|
|
33
|
+
@include minTouchTarget(48px, 48px);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// base states
|
|
38
|
+
|
|
39
|
+
&:hover,
|
|
40
|
+
[open] > & {
|
|
41
|
+
transition-duration: var(--primer-duration-fast);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:active,
|
|
45
|
+
&.Button--active {
|
|
46
|
+
transition: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:disabled,
|
|
50
|
+
&.Button--disabled,
|
|
51
|
+
&[aria-disabled='true'] {
|
|
52
|
+
cursor: not-allowed;
|
|
53
|
+
box-shadow: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:focus {
|
|
57
|
+
@include focusOutline;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.Button-withTooltip {
|
|
62
|
+
position: relative;
|
|
63
|
+
display: inline-block;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
a.Button,
|
|
67
|
+
summary.Button {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// wrap grid content to allow trailingAction to lock-right
|
|
76
|
+
.Button-content {
|
|
77
|
+
flex: 1 0 auto;
|
|
78
|
+
display: grid;
|
|
79
|
+
grid-template-areas: 'leadingVisual text trailingVisual';
|
|
80
|
+
grid-template-columns: min-content minmax(0, auto) min-content;
|
|
81
|
+
align-items: center;
|
|
82
|
+
place-content: center;
|
|
83
|
+
// padding-bottom: 1px; // optical alignment for firefox
|
|
84
|
+
|
|
85
|
+
> :not(:last-child) {
|
|
86
|
+
margin-right: var(--primer-control-medium-gap);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// center child elements for fullWidth
|
|
91
|
+
.Button-content--alignStart {
|
|
92
|
+
justify-content: start;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// button child elements
|
|
96
|
+
|
|
97
|
+
// align svg
|
|
98
|
+
.Button-visual {
|
|
99
|
+
display: flex;
|
|
100
|
+
pointer-events: none; // allow click handler to work, avoiding visuals
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.Button-label {
|
|
104
|
+
grid-area: text;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
line-height: var(--primer-text-body-lineHeight-medium);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.Button-leadingVisual {
|
|
110
|
+
grid-area: leadingVisual;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.Button-trailingVisual {
|
|
114
|
+
grid-area: trailingVisual;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.Button-trailingAction {
|
|
118
|
+
margin-right: calc(var(--base-size-4) * -1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// sizes
|
|
122
|
+
|
|
123
|
+
.Button--small {
|
|
124
|
+
font-size: var(--primer-text-body-size-small);
|
|
125
|
+
height: var(--primer-control-small-size);
|
|
126
|
+
padding: 0 var(--primer-control-small-paddingInline-normal);
|
|
127
|
+
gap: var(--primer-control-small-gap);
|
|
128
|
+
|
|
129
|
+
.Button-label {
|
|
130
|
+
line-height: var(--primer-text-body-lineHeight-small);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.Button-content {
|
|
134
|
+
> :not(:last-child) {
|
|
135
|
+
margin-right: var(--primer-control-small-gap);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.Button--large {
|
|
141
|
+
height: var(--primer-control-large-size);
|
|
142
|
+
padding: 0 var(--primer-control-large-paddingInline-normal);
|
|
143
|
+
gap: var(--primer-control-large-gap);
|
|
144
|
+
|
|
145
|
+
.Button-label {
|
|
146
|
+
line-height: var(--primer-text-body-lineHeight-large);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.Button-content {
|
|
150
|
+
> :not(:last-child) {
|
|
151
|
+
margin-right: var(--primer-control-large-gap);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.Button--fullWidth {
|
|
157
|
+
width: 100%;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// variants
|
|
161
|
+
|
|
162
|
+
// primary
|
|
163
|
+
.Button--primary {
|
|
164
|
+
color: var(--color-btn-primary-text);
|
|
165
|
+
fill: var(--color-btn-primary-icon);
|
|
166
|
+
background-color: var(--color-btn-primary-bg);
|
|
167
|
+
border-color: var(--color-btn-primary-border);
|
|
168
|
+
box-shadow: var(--color-btn-primary-shadow), var(--color-btn-primary-inset-shadow);
|
|
169
|
+
|
|
170
|
+
&:hover,
|
|
171
|
+
[open] > & {
|
|
172
|
+
background-color: var(--color-btn-primary-hover-bg);
|
|
173
|
+
border-color: var(--color-btn-primary-hover-border);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&:active,
|
|
177
|
+
&[aria-pressed='true'],
|
|
178
|
+
&.Button--pressed {
|
|
179
|
+
background-color: var(--color-btn-primary-selected-bg);
|
|
180
|
+
box-shadow: var(--color-btn-primary-selected-shadow);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&:disabled,
|
|
184
|
+
&.Button--disabled,
|
|
185
|
+
&[aria-disabled='true'] {
|
|
186
|
+
color: var(--color-btn-primary-disabled-text);
|
|
187
|
+
background-color: var(--color-btn-primary-disabled-bg);
|
|
188
|
+
border-color: var(--color-btn-primary-disabled-border);
|
|
189
|
+
fill: var(--color-btn-primary-disabled-text);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// default (secondary)
|
|
194
|
+
.Button--secondary {
|
|
195
|
+
color: var(--color-btn-text);
|
|
196
|
+
fill: var(--color-fg-muted); // help this
|
|
197
|
+
background-color: var(--color-btn-bg);
|
|
198
|
+
border-color: var(--color-btn-border);
|
|
199
|
+
box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
|
|
200
|
+
|
|
201
|
+
&:hover,
|
|
202
|
+
[open] > & {
|
|
203
|
+
background-color: var(--color-btn-hover-bg);
|
|
204
|
+
border-color: var(--color-btn-hover-border);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&:active,
|
|
208
|
+
&.Button--active {
|
|
209
|
+
background-color: var(--color-btn-active-bg);
|
|
210
|
+
border-color: var(--color-btn-active-border);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&[aria-pressed='true'],
|
|
214
|
+
&.Button--pressed {
|
|
215
|
+
background-color: var(--color-btn-selected-bg);
|
|
216
|
+
box-shadow: var(--color-primer-shadow-inset);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&:disabled,
|
|
220
|
+
&.Button--disabled,
|
|
221
|
+
&[aria-disabled='true'] {
|
|
222
|
+
color: var(--color-primer-fg-disabled);
|
|
223
|
+
background-color: var(--color-btn-bg);
|
|
224
|
+
border-color: var(--color-btn-border);
|
|
225
|
+
fill: var(--color-primer-fg-disabled);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// link color without svg
|
|
230
|
+
.Button--invisible {
|
|
231
|
+
color: var(--color-fg-default);
|
|
232
|
+
fill: var(--color-fg-default);
|
|
233
|
+
border: none;
|
|
234
|
+
|
|
235
|
+
&:hover,
|
|
236
|
+
[open] > & {
|
|
237
|
+
background-color: var(--color-segmented-control-button-hover-bg);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&[aria-pressed='true'],
|
|
241
|
+
&:active,
|
|
242
|
+
&.Button--active,
|
|
243
|
+
&.Button--pressed {
|
|
244
|
+
background-color: var(--color-segmented-control-button-active-bg);
|
|
245
|
+
// box-shadow: var(--color-primer-shadow-inset);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&:disabled,
|
|
249
|
+
&.Button--disabled,
|
|
250
|
+
&[aria-disabled='true'] {
|
|
251
|
+
color: var(--color-primer-fg-disabled);
|
|
252
|
+
background-color: var(--color-btn-bg);
|
|
253
|
+
border-color: var(--color-btn-border);
|
|
254
|
+
fill: var(--color-primer-fg-disabled);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// if visual is present, muted label color
|
|
258
|
+
.Button-label:not(:only-child) {
|
|
259
|
+
color: var(--color-btn-text);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// if trailingAction is present, muted label color
|
|
263
|
+
.Button-content:not(:only-child) {
|
|
264
|
+
.Button-label {
|
|
265
|
+
color: var(--color-btn-text);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// danger
|
|
271
|
+
.Button--danger {
|
|
272
|
+
color: var(--color-btn-danger-text);
|
|
273
|
+
fill: var(--color-btn-danger-icon);
|
|
274
|
+
background-color: var(--color-btn-bg);
|
|
275
|
+
border-color: var(--color-btn-border);
|
|
276
|
+
box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
|
|
277
|
+
|
|
278
|
+
&:hover,
|
|
279
|
+
[open] > & {
|
|
280
|
+
color: var(--color-btn-danger-hover-text);
|
|
281
|
+
fill: var(--color-btn-danger-hover-text);
|
|
282
|
+
background-color: var(--color-btn-danger-hover-bg);
|
|
283
|
+
border-color: var(--color-btn-danger-hover-border);
|
|
284
|
+
box-shadow: var(--color-btn-danger-hover-shadow), var(--color-btn-danger-hover-inset-shadow);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
&:active,
|
|
288
|
+
&[aria-pressed='true'],
|
|
289
|
+
&.Button--pressed {
|
|
290
|
+
color: var(--color-btn-danger-selected-text);
|
|
291
|
+
fill: var(--color-btn-danger-selected-text);
|
|
292
|
+
background-color: var(--color-btn-danger-selected-bg);
|
|
293
|
+
border-color: var(--color-btn-danger-selected-border);
|
|
294
|
+
box-shadow: var(--color-btn-danger-selected-shadow);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
&:disabled,
|
|
298
|
+
&.disabled,
|
|
299
|
+
&[aria-disabled='true'] {
|
|
300
|
+
color: var(--color-btn-danger-disabled-text);
|
|
301
|
+
fill: var(--color-btn-danger-disabled-text);
|
|
302
|
+
background-color: var(--color-btn-danger-disabled-bg);
|
|
303
|
+
border-color: var(--color-btn-border);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.Button--iconOnly {
|
|
2
|
+
display: grid;
|
|
3
|
+
place-content: center;
|
|
4
|
+
padding: unset;
|
|
5
|
+
width: var(--primer-control-medium-size);
|
|
6
|
+
|
|
7
|
+
&.Button--small {
|
|
8
|
+
width: var(--primer-control-small-size);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.Button--large {
|
|
12
|
+
width: var(--primer-control-large-size);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -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--alignStart {
|
|
16
|
+
@extend .Button-content--alignStart;
|
|
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
|
+
}
|