@primer/css 0.0.0-20220120162542 → 0.0.0-20220120184157

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 (64) hide show
  1. package/CHANGELOG.md +2 -16
  2. package/actionlist/action-list-item.scss +9 -28
  3. package/actionlist/action-list.scss +0 -24
  4. package/button-refactor/ButtonsLinksAPI.md +111 -0
  5. package/button-refactor/button-group.scss +0 -0
  6. package/button-refactor/button.scss +245 -0
  7. package/button-refactor/icon-button.scss +14 -0
  8. package/button-refactor/link-styled-as-button.scss +75 -0
  9. package/button-refactor/link.scss +25 -0
  10. package/color-modes/native.scss +0 -11
  11. package/core/index.scss +5 -1
  12. package/dist/actionlist.css +1 -1
  13. package/dist/actionlist.css.map +1 -1
  14. package/dist/alerts.css.map +1 -1
  15. package/dist/autocomplete.css.map +1 -1
  16. package/dist/avatars.css.map +1 -1
  17. package/dist/base.css.map +1 -1
  18. package/dist/blankslate.css.map +1 -1
  19. package/dist/box.css.map +1 -1
  20. package/dist/branch-name.css.map +1 -1
  21. package/dist/breadcrumb.css.map +1 -1
  22. package/dist/buttons.css.map +1 -1
  23. package/dist/color-modes.css +1 -1
  24. package/dist/color-modes.css.map +1 -1
  25. package/dist/core.css +1 -1
  26. package/dist/core.css.map +1 -1
  27. package/dist/dropdown.css.map +1 -1
  28. package/dist/forms.css.map +1 -1
  29. package/dist/header.css.map +1 -1
  30. package/dist/labels.css.map +1 -1
  31. package/dist/layout.css +1 -1
  32. package/dist/layout.css.map +1 -1
  33. package/dist/links.css.map +1 -1
  34. package/dist/loaders.css.map +1 -1
  35. package/dist/markdown.css.map +1 -1
  36. package/dist/marketing-buttons.css.map +1 -1
  37. package/dist/marketing-links.css.map +1 -1
  38. package/dist/marketing-type.css.map +1 -1
  39. package/dist/marketing-utilities.css.map +1 -1
  40. package/dist/meta.json +75 -75
  41. package/dist/navigation.css.map +1 -1
  42. package/dist/pagination.css +1 -1
  43. package/dist/pagination.css.map +1 -1
  44. package/dist/popover.css.map +1 -1
  45. package/dist/primer.css +2 -2
  46. package/dist/primer.css.map +1 -1
  47. package/dist/progress.css.map +1 -1
  48. package/dist/select-menu.css.map +1 -1
  49. package/dist/stats/actionlist.json +1 -1
  50. package/dist/stats/color-modes.json +1 -1
  51. package/dist/stats/core.json +1 -1
  52. package/dist/stats/layout.json +1 -1
  53. package/dist/stats/pagination.json +1 -1
  54. package/dist/stats/primer.json +1 -1
  55. package/dist/subhead.css.map +1 -1
  56. package/dist/timeline.css.map +1 -1
  57. package/dist/toasts.css.map +1 -1
  58. package/dist/tooltips.css.map +1 -1
  59. package/dist/truncate.css.map +1 -1
  60. package/dist/utilities.css.map +1 -1
  61. package/layout/layout.scss +1 -2
  62. package/package.json +1 -3
  63. package/pagination/pagination.scss +1 -38
  64. package/support/mixins/misc.scss +7 -0
package/CHANGELOG.md CHANGED
@@ -1,20 +1,6 @@
1
1
  # @primer/css
2
2
 
3
- ## 0.0.0-20220120162542
4
-
5
- ### Patch Changes
6
-
7
- - [#1892](https://github.com/primer/css/pull/1892) [`b8605906`](https://github.com/primer/css/commit/b86059064fed80bfdb337df27633e1f722da10f2) 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-20220120184157
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
 
@@ -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,111 @@
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
+ | | | | |
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?
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?
File without changes
@@ -0,0 +1,245 @@
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
+
19
+ // define grid slots and layout for standard button contents
20
+ // &:not(.Button--iconOnly) {
21
+ display: flex;
22
+ flex-direction: row;
23
+ justify-content: space-between;
24
+ align-items: center;
25
+ gap: $spacer-2;
26
+
27
+ // base states
28
+
29
+ &:hover,
30
+ [open] > & {
31
+ transition-duration: 0.1s;
32
+ }
33
+
34
+ &:active,
35
+ &.Button--active {
36
+ transition: none;
37
+ }
38
+
39
+ &:disabled,
40
+ &.Button--disabled,
41
+ &[aria-disabled='true'] {
42
+ cursor: not-allowed;
43
+ box-shadow: none;
44
+ }
45
+
46
+ &:focus {
47
+ @include focusOutline;
48
+ }
49
+ }
50
+
51
+ // wrap grid content to allow trailingAction to lock-right
52
+ .Button-content {
53
+ flex: 1 0 auto;
54
+ display: grid;
55
+ grid-template-areas: 'leadingVisual text trailingVisual';
56
+ grid-template-columns: min-content minmax(0, auto) min-content;
57
+ align-items: center;
58
+
59
+ > :not(:last-child) {
60
+ margin-right: $spacer-2;
61
+ }
62
+ }
63
+
64
+ // center child elements for fullWidth
65
+ .Button-content--visualFixed {
66
+ place-content: center;
67
+ }
68
+
69
+ // button child elements
70
+
71
+ // align svg
72
+ .Button-visual {
73
+ display: flex;
74
+ }
75
+
76
+ .Button-label {
77
+ grid-area: text;
78
+ white-space: nowrap;
79
+ }
80
+
81
+ .Button-leadingVisual {
82
+ grid-area: leadingVisual;
83
+ }
84
+
85
+ .Button-trailingVisual {
86
+ grid-area: trailingVisual;
87
+ }
88
+
89
+ .Button-trailingAction {
90
+ margin-right: -8px;
91
+ }
92
+
93
+ // sizes
94
+
95
+ .Button--small {
96
+ height: 28px;
97
+ font-size: $font-size-small;
98
+ }
99
+
100
+ .Button--large {
101
+ height: 44px;
102
+ }
103
+
104
+ .Button--fullWidth {
105
+ width: 100%;
106
+ }
107
+
108
+ // variants
109
+
110
+ // primary
111
+ .Button--primary {
112
+ color: var(--color-btn-primary-text);
113
+ fill: var(--color-btn-primary-icon);
114
+ background-color: var(--color-btn-primary-bg);
115
+ border-color: var(--color-btn-primary-border);
116
+ box-shadow: var(--color-btn-primary-shadow), var(--color-btn-primary-inset-shadow);
117
+
118
+ &:hover,
119
+ [open] > & {
120
+ background-color: var(--color-btn-primary-hover-bg);
121
+ border-color: var(--color-btn-primary-hover-border);
122
+ }
123
+
124
+ &:active,
125
+ &[aria-pressed='true'],
126
+ &.Button--pressed {
127
+ background-color: var(--color-btn-primary-selected-bg);
128
+ box-shadow: var(--color-btn-primary-selected-shadow);
129
+ }
130
+
131
+ &:disabled,
132
+ &.Button--disabled,
133
+ &[aria-disabled='true'] {
134
+ color: var(--color-btn-primary-disabled-text);
135
+ background-color: var(--color-btn-primary-disabled-bg);
136
+ border-color: var(--color-btn-primary-disabled-border);
137
+ fill: var(--color-btn-primary-disabled-text);
138
+ }
139
+ }
140
+
141
+ // default (secondary)
142
+ .Button--secondary {
143
+ color: var(--color-btn-text);
144
+ fill: var(--color-fg-muted); // help this
145
+ background-color: var(--color-btn-bg);
146
+ border: $border-width $border-style;
147
+ border-color: var(--color-btn-border);
148
+ box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
149
+
150
+ &:hover,
151
+ [open] > & {
152
+ background-color: var(--color-btn-hover-bg);
153
+ border-color: var(--color-btn-hover-border);
154
+ }
155
+
156
+ &:active,
157
+ &.Button--active {
158
+ background-color: var(--color-btn-active-bg);
159
+ border-color: var(--color-btn-active-border);
160
+ }
161
+
162
+ &[aria-pressed='true'],
163
+ &.Button--pressed {
164
+ background-color: var(--color-btn-selected-bg);
165
+ box-shadow: var(--color-primer-shadow-inset);
166
+ }
167
+
168
+ &:disabled,
169
+ &.Button--disabled,
170
+ &[aria-disabled='true'] {
171
+ color: var(--color-primer-fg-disabled);
172
+ background-color: var(--color-btn-bg);
173
+ border-color: var(--color-btn-border);
174
+ fill: var(--color-primer-fg-disabled);
175
+ }
176
+ }
177
+
178
+ .Button--invisible {
179
+ color: var(--color-btn-outline-text);
180
+ fill: var(--color-btn-outline-text);
181
+ background-color: var(--color-canvas-default);
182
+ border: $border-width $border-style;
183
+ border-color: var(--color-canvas-default);
184
+
185
+ &:hover,
186
+ [open] > & {
187
+ background-color: var(--color-btn-hover-bg);
188
+ border-color: var(--color-btn-hover-bg);
189
+ }
190
+
191
+ &[aria-pressed='true'],
192
+ &:active,
193
+ &.Button--active,
194
+ &.Button--pressed {
195
+ background-color: var(--color-btn-selected-bg);
196
+ box-shadow: var(--color-primer-shadow-inset);
197
+ }
198
+
199
+ &:disabled,
200
+ &.Button--disabled,
201
+ &[aria-disabled='true'] {
202
+ color: var(--color-primer-fg-disabled);
203
+ background-color: var(--color-btn-bg);
204
+ border-color: var(--color-btn-border);
205
+ fill: var(--color-primer-fg-disabled);
206
+ }
207
+ }
208
+
209
+ // danger
210
+ .Button--danger {
211
+ color: var(--color-btn-danger-text);
212
+ fill: var(--color-btn-danger-icon);
213
+ background-color: var(--color-btn-bg);
214
+ border: $border-width $border-style;
215
+ border-color: var(--color-btn-border);
216
+ box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
217
+
218
+ &:hover,
219
+ [open] > & {
220
+ color: var(--color-btn-danger-hover-text);
221
+ fill: var(--color-btn-danger-hover-text);
222
+ background-color: var(--color-btn-danger-hover-bg);
223
+ border-color: var(--color-btn-danger-hover-border);
224
+ box-shadow: var(--color-btn-danger-hover-shadow), var(--color-btn-danger-hover-inset-shadow);
225
+ }
226
+
227
+ &:active,
228
+ &[aria-pressed='true'],
229
+ &.Button--pressed {
230
+ color: var(--color-btn-danger-selected-text);
231
+ fill: var(--color-btn-danger-selected-text);
232
+ background-color: var(--color-btn-danger-selected-bg);
233
+ border-color: var(--color-btn-danger-selected-border);
234
+ box-shadow: var(--color-btn-danger-selected-shadow);
235
+ }
236
+
237
+ &:disabled,
238
+ &.disabled,
239
+ &[aria-disabled='true'] {
240
+ color: var(--color-btn-danger-disabled-text);
241
+ fill: var(--color-btn-danger-disabled-text);
242
+ background-color: var(--color-btn-danger-disabled-bg);
243
+ border-color: var(--color-btn-border);
244
+ }
245
+ }
@@ -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
+ }
@@ -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
+ }
@@ -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';