@primer/css 0.0.0-20220125003417 → 0.0.0-20220125154318

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +2 -16
  2. package/actionlist/action-list-item.scss +9 -28
  3. package/actionlist/action-list-tree.scss +0 -18
  4. package/actionlist/action-list.scss +0 -24
  5. package/button-refactor/ButtonsLinksAPI.md +115 -0
  6. package/button-refactor/button-group.scss +27 -0
  7. package/button-refactor/button.scss +249 -0
  8. package/button-refactor/icon-button.scss +14 -0
  9. package/button-refactor/link-styled-as-button.scss +75 -0
  10. package/button-refactor/link.scss +25 -0
  11. package/color-modes/native.scss +0 -11
  12. package/core/index.scss +5 -1
  13. package/dist/actionlist.css +1 -1
  14. package/dist/actionlist.css.map +1 -1
  15. package/dist/alerts.css.map +1 -1
  16. package/dist/autocomplete.css.map +1 -1
  17. package/dist/avatars.css.map +1 -1
  18. package/dist/base.css.map +1 -1
  19. package/dist/blankslate.css.map +1 -1
  20. package/dist/box.css.map +1 -1
  21. package/dist/branch-name.css.map +1 -1
  22. package/dist/breadcrumb.css.map +1 -1
  23. package/dist/buttons.css.map +1 -1
  24. package/dist/color-modes.css +1 -1
  25. package/dist/color-modes.css.map +1 -1
  26. package/dist/core.css +1 -1
  27. package/dist/core.css.map +1 -1
  28. package/dist/dropdown.css.map +1 -1
  29. package/dist/forms.css.map +1 -1
  30. package/dist/header.css.map +1 -1
  31. package/dist/labels.css.map +1 -1
  32. package/dist/layout.css +1 -1
  33. package/dist/layout.css.map +1 -1
  34. package/dist/links.css.map +1 -1
  35. package/dist/loaders.css.map +1 -1
  36. package/dist/markdown.css.map +1 -1
  37. package/dist/marketing-buttons.css.map +1 -1
  38. package/dist/marketing-links.css.map +1 -1
  39. package/dist/marketing-type.css.map +1 -1
  40. package/dist/marketing-utilities.css.map +1 -1
  41. package/dist/meta.json +31 -31
  42. package/dist/navigation.css.map +1 -1
  43. package/dist/pagination.css +1 -1
  44. package/dist/pagination.css.map +1 -1
  45. package/dist/popover.css.map +1 -1
  46. package/dist/primer.css +2 -2
  47. package/dist/primer.css.map +1 -1
  48. package/dist/progress.css.map +1 -1
  49. package/dist/select-menu.css.map +1 -1
  50. package/dist/stats/actionlist.json +1 -1
  51. package/dist/stats/color-modes.json +1 -1
  52. package/dist/stats/core.json +1 -1
  53. package/dist/stats/layout.json +1 -1
  54. package/dist/stats/pagination.json +1 -1
  55. package/dist/stats/primer.json +1 -1
  56. package/dist/subhead.css.map +1 -1
  57. package/dist/table-object.css.map +1 -1
  58. package/dist/timeline.css.map +1 -1
  59. package/dist/toasts.css.map +1 -1
  60. package/dist/tooltips.css.map +1 -1
  61. package/dist/truncate.css.map +1 -1
  62. package/dist/utilities.css.map +1 -1
  63. package/layout/layout.scss +1 -2
  64. package/package.json +1 -3
  65. package/pagination/pagination.scss +1 -38
  66. package/support/mixins/misc.scss +23 -0
  67. package/table-object/README.md +25 -0
  68. package/table-object/table-object.scss +0 -3
package/CHANGELOG.md CHANGED
@@ -1,20 +1,6 @@
1
1
  # @primer/css
2
2
 
3
- ## 0.0.0-20220125003417
4
-
5
- ### Patch Changes
6
-
7
- - [#1892](https://github.com/primer/css/pull/1892) [`55bd498b`](https://github.com/primer/css/commit/55bd498b7357e86659ac574f0f745f7b420fb6d3) Thanks [@langermank](https://github.com/langermank)! - Patch: Fix ActionList--divided for label with inline description scenarios
8
-
9
- * Fake entry to force publishing
10
-
11
- - [#1890](https://github.com/primer/css/pull/1890) [`74d0438b`](https://github.com/primer/css/commit/74d0438bd4dbaed447b553c5d3c8b945da282836) Thanks [@andrialexandrou](https://github.com/andrialexandrou)! - Adds --color-accent-emphasis and --color-fg-on-emphasis rules for Windows High Contrast Mode
12
-
13
- * [#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
14
-
15
- - [#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
16
-
17
- ## 19.2.0
3
+ ## 0.0.0-20220125154318
18
4
 
19
5
  ### Minor Changes
20
6
 
@@ -26,7 +12,7 @@
26
12
 
27
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.
28
14
 
29
- - [#1856](https://github.com/primer/css/pull/1856) [`cbe3fb56`](https://github.com/primer/css/commit/cbe3fb56e4c7ee6bfe803eb0c15e15ab95d84157) Thanks [@langermank](https://github.com/langermank)! - ActionList item outlines for high contrast theme
15
+ - Fake entry to force publishing
30
16
 
31
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
32
18
 
@@ -1,4 +1,4 @@
1
- // stylelint-disable max-nesting-depth, selector-max-specificity, selector-max-compound-selectors
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
- // stylelint-disable-next-line primer/box-shadow
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
@@ -92,11 +76,6 @@
92
76
  + .ActionList-item .ActionList-item-label::before {
93
77
  visibility: hidden;
94
78
  }
95
-
96
- .ActionList-item-descriptionWrap--inline::before,
97
- + .ActionList-item .ActionList-item-descriptionWrap--inline::before {
98
- visibility: hidden;
99
- }
100
79
  }
101
80
  }
102
81
  // stylelint-disable-next-line no-duplicate-selectors
@@ -174,6 +153,7 @@
174
153
 
175
154
  // has 16px leading visual
176
155
  .ActionList-content--visual16 + .ActionList--subGroup {
156
+ // stylelint-disable-next-line selector-max-compound-selectors
177
157
  .ActionList-content {
178
158
  padding-left: $spacer-5;
179
159
  }
@@ -181,6 +161,7 @@
181
161
 
182
162
  // has 20px leading visual
183
163
  .ActionList-content--visual20 + .ActionList--subGroup {
164
+ // stylelint-disable-next-line selector-max-compound-selectors
184
165
  .ActionList-content {
185
166
  padding-left: $spacer-2 * 4.5; // 36px
186
167
  }
@@ -188,6 +169,7 @@
188
169
 
189
170
  // has 24px leading visual
190
171
  .ActionList-content--visual24 + .ActionList--subGroup {
172
+ // stylelint-disable-next-line selector-max-compound-selectors
191
173
  .ActionList-content {
192
174
  padding-left: $spacer-6;
193
175
  }
@@ -493,7 +475,6 @@
493
475
 
494
476
  // inline
495
477
  .ActionList-item-descriptionWrap--inline {
496
- position: relative;
497
478
  flex-direction: row;
498
479
  align-items: baseline;
499
480
 
@@ -15,24 +15,6 @@
15
15
 
16
16
  .ActionList--tree {
17
17
  --ActionList-tree-depth: 1;
18
-
19
- // if direct sibling in ActionList--tree, and if not an expandable section (no chevron), indent to align with sibling icon or label
20
- > .ActionList-item[aria-expanded] ~ .ActionList-item:not([aria-expanded]) {
21
- .ActionList-content {
22
- padding-left: $spacer-5;
23
- background-color: palevioletred;
24
- }
25
- }
26
-
27
- > .ActionList-item:not([aria-expanded]) {
28
- .ActionList-content {
29
- padding-left: $spacer-5;
30
- background-color: darkkhaki;
31
- }
32
- }
33
-
34
- // .ActionList-item--rootSiblingItem
35
-
36
18
  // TODO: remove with PVC implementation
37
19
  .ActionList-item--subItem > .ActionList-content {
38
20
  font-size: $body-font-size;
@@ -21,24 +21,6 @@
21
21
  background: var(--color-action-list-item-inline-divider);
22
22
  }
23
23
 
24
- // if descriptionWrap--inline exists, move pseudo divider to wrapper
25
- .ActionList-item-descriptionWrap--inline {
26
- &::before {
27
- position: absolute;
28
- top: -$actionList-item-padding-vertical;
29
- display: block;
30
- width: 100%;
31
- height: $border-width;
32
- content: '';
33
- background: var(--color-action-list-item-inline-divider);
34
- }
35
-
36
- // unset the default label pseudo
37
- .ActionList-item-label::before {
38
- content: unset;
39
- }
40
- }
41
-
42
24
  // hide divider if item is active
43
25
  .ActionList-item--navActive {
44
26
  // stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
@@ -54,9 +36,3 @@
54
36
  .ActionList-sectionDivider + .ActionList-item .ActionList-item-label::before {
55
37
  visibility: hidden;
56
38
  }
57
-
58
- // hide if item is first of type with label::before, or is the first item after a sectionDivider
59
- .ActionList-item:first-of-type .ActionList-item-descriptionWrap--inline::before,
60
- .ActionList-sectionDivider + .ActionList-item .ActionList-item-descriptionWrap--inline::before {
61
- visibility: hidden;
62
- }
@@ -0,0 +1,115 @@
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
+
34
+ ## Specific notes from previous bugs to keep in mind
35
+ - [ ] Check all button variants have shadow present
36
+ - [ ] Ensure icon colors are consistent in hover states
37
+ - [ ] Ensure icon colors are consistent with variants in all states
38
+ - [ ] Ensure disabled colors are consistent across frameworks
39
+
40
+ ## Component list
41
+ 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.
42
+
43
+ | Component | Description |
44
+ | -- | -- |
45
+ | Button | standard `button` with variants, size, visual slots |
46
+ | IconButton | `button` with icon only (square) and required `aria-label` |
47
+ | ReactionButton | `button` snowflake with specific styles/interaction design (round) potentially a variant |
48
+ | ButtonGroup | wrapper to handle grouping buttons |
49
+ | Link | `a` with variants, optional trailing visuals |
50
+ | LinkStyledAsButton | `a` with button variants, required trailing visual |
51
+
52
+ ## Component API breakdown
53
+
54
+ ### Button
55
+
56
+ | prop | type | options | default | notes |
57
+ | -- | -- | -- | -- | -- |
58
+ | `variant` | one-of string | `primary` `secondary` `danger` `invisible` | `secondary` | |
59
+ | `size` | one-of string | `small` `default` `large` | `default` | |
60
+ | `label` | string | button description | null | |
61
+ | `aria-label` | string | button description for screen readers | null | |
62
+ | `aria-pressed` | boolean | `true/false` | `false` | |
63
+ | `leadingVisual` | children (slot) | octicon | null | |
64
+ | `trailingVisual` | children (slot) | octicon | null | |
65
+ | `trailingAction` | children (slot) | octicon | null | slot for caret to maintain leading/trailing visuals if they exist |
66
+ | `fullWidth` | boolean | `true/false` | `false` | |
67
+ | `visualPosition` | one-of string | `fixed` `some-other-word` | `fixed` | lock icon to the text label or to the button container |
68
+
69
+
70
+ ### LinkStyledAsButton
71
+
72
+ | prop | type | options | default | notes |
73
+ | -- | -- | -- | -- | -- |
74
+ | `variant` | one-of string | `primary` `secondary` `danger` `invisible` | `secondary` | |
75
+ | `size` | one-of string | `small` `default` `large` | `default` | |
76
+ | `label` | string | button description | null | |
77
+ | `leadingVisual` | children (slot) | octicon | null | |
78
+ | `trailingVisual` | children (slot) | octicon | null | |
79
+ | `showTrailingAction` | arrow octicon | `true/false` | true? | show trailingVisual icon to indicate linkyness |
80
+ | `fullWidth` | boolean | `true/false` | `false` | |
81
+ | `visualPosition` | one-of string | `fixed` `some-other-word` | `fixed` | lock icon to the text label or to the button container |
82
+
83
+ ### IconButton
84
+
85
+ | prop | type | options | default | notes |
86
+ | -- | -- | -- | -- | -- |
87
+ | `variant` | one-of string | `primary` `secondary` `danger` `outline`? | `secondary` | |
88
+ | `size` | one-of string | `small` `default` `large` | `default | |
89
+ | `aria-label` | string | button description for screen readers (required) | null | |
90
+ | `visual` | children (slot) | octicon | null | |
91
+ | `aria-pressed` | boolean | `true/false` | `false` | |
92
+
93
+ ### Link
94
+
95
+ | prop | type | options | default | notes |
96
+ | -- | -- | -- | -- | -- |
97
+ | `variant` | one-of string | ?? we need to work on this (subtle and or muted) | |
98
+ | `label` | string | button description | null | |
99
+ | `showTrailingAction` | boolean | specific octicon for new tab or new page (or anchor?) | null | |
100
+
101
+ ### ButtonGroup
102
+
103
+ | prop | type | options | default | notes |
104
+ | -- | -- | -- | -- | -- |
105
+ | `children` | child slot | | | |
106
+
107
+ ## Next review session
108
+ - [ ] Help refine transition animations + tokenize
109
+ - [ ] Icon colors- same as button text, or specific?
110
+ - [ ] 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`?
111
+ - [ ] What color should `invisible` button variant be? Blue or grey?
112
+ - [ ] No aria-label for `LinkStyledAsButton`
113
+ - [ ] Do we like `fullWidth` or `block` as a prop for width behavior?
114
+ - [ ] Should `ButtonGroup` offer an option with gaps (more of a layout tool)
115
+ - [ ] 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,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: 40px;
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,14 @@
1
+ .Button--iconOnly {
2
+ display: grid;
3
+ place-content: center;
4
+ padding: unset;
5
+ width: 32px;
6
+
7
+ &.Button--small {
8
+ width: 28px;
9
+ }
10
+
11
+ &.Button--large {
12
+ width: 44px;
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--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
+ }