@primer/css 0.0.0-20220422221626 → 0.0.0-20220426005808

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 (140) hide show
  1. package/CHANGELOG.md +50 -4
  2. package/DEVELOP.md +26 -21
  3. package/actionlist/action-list-item.scss +10 -7
  4. package/actionlist/action-list-tree.scss +22 -91
  5. package/autocomplete/autocomplete.scss +50 -1
  6. package/base/base.scss +63 -3
  7. package/base/normalize.scss +12 -52
  8. package/box/box-overlay.scss +2 -0
  9. package/branch-name/branch-name.scss +1 -0
  10. package/buttons/button.scss +54 -27
  11. package/buttons/misc.scss +25 -19
  12. package/color-modes/index.scss +2 -0
  13. package/color-modes/themes/dark_tritanopia.scss +6 -0
  14. package/color-modes/themes/light_tritanopia.scss +6 -0
  15. package/core/index.scss +0 -2
  16. package/dist/actionlist.css +1 -1
  17. package/dist/actionlist.css.map +1 -1
  18. package/dist/alerts.css +1 -1
  19. package/dist/alerts.css.map +1 -1
  20. package/dist/autocomplete.css +1 -1
  21. package/dist/autocomplete.css.map +1 -1
  22. package/dist/avatars.css.map +1 -1
  23. package/dist/base.css +1 -1
  24. package/dist/base.css.map +1 -1
  25. package/dist/blankslate.css.map +1 -1
  26. package/dist/box.css.map +1 -1
  27. package/dist/branch-name.css +1 -1
  28. package/dist/branch-name.css.map +1 -1
  29. package/dist/breadcrumb.css.map +1 -1
  30. package/dist/buttons.css +1 -1
  31. package/dist/buttons.css.map +1 -1
  32. package/dist/color-modes.css +1 -1
  33. package/dist/color-modes.css.map +1 -1
  34. package/dist/core.css +1 -1
  35. package/dist/core.css.map +1 -1
  36. package/dist/dropdown.css +1 -1
  37. package/dist/dropdown.css.map +1 -1
  38. package/dist/forms.css +1 -1
  39. package/dist/forms.css.map +1 -1
  40. package/dist/header.css.map +1 -1
  41. package/dist/labels.css.map +1 -1
  42. package/dist/layout.css.map +1 -1
  43. package/dist/links.css +1 -1
  44. package/dist/links.css.map +1 -1
  45. package/dist/loaders.css.map +1 -1
  46. package/dist/markdown.css.map +1 -1
  47. package/dist/marketing-buttons.css +1 -1
  48. package/dist/marketing-buttons.css.map +1 -1
  49. package/dist/marketing-links.css +1 -1
  50. package/dist/marketing-links.css.map +1 -1
  51. package/dist/marketing-type.css +1 -1
  52. package/dist/marketing-type.css.map +1 -1
  53. package/dist/marketing-utilities.css.map +1 -1
  54. package/dist/marketing.css +1 -1
  55. package/dist/marketing.css.map +1 -1
  56. package/dist/meta.json +62 -84
  57. package/dist/navigation.css +1 -1
  58. package/dist/navigation.css.map +1 -1
  59. package/dist/pagination.css +1 -1
  60. package/dist/pagination.css.map +1 -1
  61. package/dist/popover.css.map +1 -1
  62. package/dist/primer.css +4 -4
  63. package/dist/primer.css.map +1 -1
  64. package/dist/product.css +1 -1
  65. package/dist/product.css.map +1 -1
  66. package/dist/progress.css.map +1 -1
  67. package/dist/select-menu.css.map +1 -1
  68. package/dist/stats/actionlist.json +1 -1
  69. package/dist/stats/alerts.json +1 -1
  70. package/dist/stats/autocomplete.json +1 -1
  71. package/dist/stats/base.json +1 -1
  72. package/dist/stats/branch-name.json +1 -1
  73. package/dist/stats/buttons.json +1 -1
  74. package/dist/stats/color-modes.json +1 -1
  75. package/dist/stats/core.json +1 -1
  76. package/dist/stats/dropdown.json +1 -1
  77. package/dist/stats/forms.json +1 -1
  78. package/dist/stats/links.json +1 -1
  79. package/dist/stats/marketing-buttons.json +1 -1
  80. package/dist/stats/marketing-links.json +1 -1
  81. package/dist/stats/marketing-type.json +1 -1
  82. package/dist/stats/marketing.json +1 -1
  83. package/dist/stats/navigation.json +1 -1
  84. package/dist/stats/pagination.json +1 -1
  85. package/dist/stats/primer.json +1 -1
  86. package/dist/stats/product.json +1 -1
  87. package/dist/stats/toasts.json +1 -1
  88. package/dist/stats/tooltips.json +1 -1
  89. package/dist/stats/utilities.json +1 -1
  90. package/dist/subhead.css.map +1 -1
  91. package/dist/timeline.css.map +1 -1
  92. package/dist/toasts.css +1 -1
  93. package/dist/toasts.css.map +1 -1
  94. package/dist/tooltips.css +1 -1
  95. package/dist/tooltips.css.map +1 -1
  96. package/dist/truncate.css.map +1 -1
  97. package/dist/utilities.css +1 -1
  98. package/dist/utilities.css.map +1 -1
  99. package/dist/variables.json +27 -27
  100. package/dropdown/dropdown.scss +0 -2
  101. package/forms/form-control.scss +23 -5
  102. package/forms/form-group.scss +46 -13
  103. package/forms/input-group.scss +18 -0
  104. package/links/link.scss +5 -0
  105. package/marketing/buttons/button.scss +32 -26
  106. package/marketing/links/link.scss +5 -5
  107. package/marketing/type/typography.scss +18 -29
  108. package/marketing/utilities/layout.scss +1 -1
  109. package/navigation/filter-list.scss +18 -0
  110. package/navigation/menu.scss +6 -8
  111. package/navigation/sidenav.scss +1 -10
  112. package/navigation/subnav.scss +19 -0
  113. package/navigation/tabnav.scss +7 -2
  114. package/navigation/underline-nav.scss +79 -28
  115. package/package.json +20 -18
  116. package/pagination/pagination.scss +24 -3
  117. package/popover/popover.scss +1 -0
  118. package/product/index.scss +1 -1
  119. package/support/mixins/color-modes.scss +2 -0
  120. package/support/mixins/layout.scss +1 -0
  121. package/support/mixins/misc.scss +47 -1
  122. package/support/variables/layout.scss +1 -0
  123. package/timeline/timeline-item.scss +2 -0
  124. package/toasts/toasts.scss +7 -4
  125. package/tooltips/tooltips.scss +0 -7
  126. package/utilities/details.scss +81 -4
  127. package/utilities/visibility-display.scss +49 -0
  128. package/dialog/dialog.scss +0 -88
  129. package/dialog/index.scss +0 -2
  130. package/dist/dialog.css +0 -2
  131. package/dist/dialog.css.map +0 -1
  132. package/dist/dialog.js +0 -1
  133. package/dist/overlay.css +0 -2
  134. package/dist/overlay.css.map +0 -1
  135. package/dist/overlay.js +0 -1
  136. package/dist/stats/dialog.json +0 -1
  137. package/dist/stats/overlay.json +0 -1
  138. package/overlay/README.md +0 -24
  139. package/overlay/index.scss +0 -2
  140. package/overlay/overlay.scss +0 -365
package/CHANGELOG.md CHANGED
@@ -1,16 +1,62 @@
1
1
  # @primer/css
2
2
 
3
- ## 0.0.0-20220422221626
3
+ ## 0.0.0-20220426005808
4
+
5
+ ### Major Changes
6
+
7
+ - [#1744](https://github.com/primer/css/pull/1744) [`942f65a4`](https://github.com/primer/css/commit/942f65a45a18b7042ba1ce2703688b62d874cf18) Thanks [@langermank](https://github.com/langermank)! - Global CSS focus styles
8
+
9
+ * [#1767](https://github.com/primer/css/pull/1767) [`7e01db97`](https://github.com/primer/css/commit/7e01db97f3f2b9d9383f66385ca16f0bdc06abd1) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Marketing: Remove unused pullquote selector
10
+
11
+ - [#1821](https://github.com/primer/css/pull/1821) [`daa2685c`](https://github.com/primer/css/commit/daa2685c596d894b3bae1896bf97c3319cd9816c) Thanks [@jonrohan](https://github.com/jonrohan)! - UnderlineNav `:focus` styles
12
+ Refactor selected state and spacing
13
+ Add selected bold state override from github/github
14
+
15
+ ### Patch Changes
16
+
17
+ - Fake entry to force publishing
18
+
19
+ ## 19.8.2
20
+
21
+ ### Patch Changes
22
+
23
+ - [#2019](https://github.com/primer/css/pull/2019) [`57be2d50`](https://github.com/primer/css/commit/57be2d50212b71f87ce612039375bcd5273eca53) Thanks [@langermank](https://github.com/langermank)! - [Bug] TreeView animation and padding fix
24
+
25
+ ## 19.8.1
26
+
27
+ ### Patch Changes
28
+
29
+ - [#1996](https://github.com/primer/css/pull/1996) [`a4293bf9`](https://github.com/primer/css/commit/a4293bf921ebcb74c6973e3f50f07e470f495bd0) Thanks [@langermank](https://github.com/langermank)! - TreeView: remove bold active items + markup changes
30
+
31
+ ## 19.8.0
4
32
 
5
33
  ### Minor Changes
6
34
 
7
- - [#1998](https://github.com/primer/css/pull/1998) [`a2ac9394`](https://github.com/primer/css/commit/a2ac939475a9b01374b57b251fbd27f7ab71652e) Thanks [@bolonio](https://github.com/bolonio)! - Styles for the new Dialog Component
35
+ - [#1997](https://github.com/primer/css/pull/1997) [`9806b54b`](https://github.com/primer/css/commit/9806b54b3829219c9ad141efd2fcd99fc5c08751) Thanks [@simurai](https://github.com/simurai)! - Add Tritanopia theme
8
36
 
9
37
  ### Patch Changes
10
38
 
11
- - [#1991](https://github.com/primer/css/pull/1991) [`5e87effa`](https://github.com/primer/css/commit/5e87effa671b194e188f699a79b246bdf61bd191) Thanks [@simurai](https://github.com/simurai)! - Fix `btn-primary` in flash alerts
39
+ - [#2002](https://github.com/primer/css/pull/2002) [`a3bc51f6`](https://github.com/primer/css/commit/a3bc51f6c4af0d45a9ce39f00c3cf3297b090067) Thanks [@simurai](https://github.com/simurai)! - Always break long `branch-name`s
40
+
41
+ ## 19.7.1
42
+
43
+ ### Patch Changes
44
+
45
+ - [#2001](https://github.com/primer/css/pull/2001) [`47cec404`](https://github.com/primer/css/commit/47cec40472173b412df59e6990c0ac1b1ed43d04) Thanks [@jdanyow](https://github.com/jdanyow)! - Remove IE11 support in tooltip
46
+
47
+ * [#1995](https://github.com/primer/css/pull/1995) [`557b100a`](https://github.com/primer/css/commit/557b100a77a4befe6d07fac14cb48b08bed18356) Thanks [@vdepizzol](https://github.com/vdepizzol)! - Add narrow/regular/wide viewport range utilities
48
+
49
+ - [#2000](https://github.com/primer/css/pull/2000) [`264a89a5`](https://github.com/primer/css/commit/264a89a51a75eefa6a371e6ad11518519cd98b36) Thanks [@khiga8](https://github.com/khiga8)! - More CSS updates to `Autocomplete`
12
50
 
13
- * Fake entry to force publishing
51
+ ## 19.7.0
52
+
53
+ ### Minor Changes
54
+
55
+ - [#1994](https://github.com/primer/css/pull/1994) [`69fe8c65`](https://github.com/primer/css/commit/69fe8c6512a3f0bbdbfdf7080b916a39173c2df9) Thanks [@khiga8](https://github.com/khiga8)! - Add support for inline, stack label in autocomplete
56
+
57
+ ### Patch Changes
58
+
59
+ - [#1991](https://github.com/primer/css/pull/1991) [`5e87effa`](https://github.com/primer/css/commit/5e87effa671b194e188f699a79b246bdf61bd191) Thanks [@simurai](https://github.com/simurai)! - Fix `btn-primary` in flash alerts
14
60
 
15
61
  ## 19.6.0
16
62
 
package/DEVELOP.md CHANGED
@@ -3,29 +3,32 @@
3
3
  If you've made it this far, **thank you**! We appreciate your contribution, and hope that this document helps you along the way. If you have any questions or problems, don't hesitate to [file an issue](https://github.com/primer/css/issues/new).
4
4
 
5
5
  ## Structure
6
+
6
7
  Primer CSS is published to [npm] as [@primer/css]. Each of Primer CSS's "modules" lives in a subfolder under `src/` with an `index.scss` in it. Generally speaking, the styles are divided into three primary themes:
7
8
 
8
- * **Core** styles (in `core/`) are common dependencies, which include support variables, native element and typography styles, buttons, navigation, tooltips, etc.
9
- * **Product** styles (in `product/`) are specific to github.com, and include components such as avatars, labels, markdown styles, popovers, and progress indicators.
10
- * **Marketing** styles (in `marketing/`) are specific to GitHub marketing efforts, including international and event-focused sites as well as the more design-heavy feature pages on github.com. Marketing styles include new colors and button styles, and extend the core typography and whitespace scales.
9
+ - **Core** styles (in `core/`) are common dependencies, which include support variables, native element and typography styles, buttons, navigation, tooltips, etc.
10
+ - **Product** styles (in `product/`) are specific to github.com, and include components such as avatars, labels, markdown styles, popovers, and progress indicators.
11
+ - **Marketing** styles (in `marketing/`) are specific to GitHub marketing efforts, including international and event-focused sites as well as the more design-heavy feature pages on github.com. Marketing styles include new colors and button styles, and extend the core typography and whitespace scales.
11
12
 
12
13
  ### Paths
13
- Here's what you need to know about how the files are structured in both git and in the published npm module:
14
14
 
15
- * In git, all of the SCSS source files live in the `src/` directory.
16
- * When published, all of the files in `src/` are "hoisted" to the package root so that you can import, say, utilities with:
15
+ Here's what you need to know about how the files are structured in both git and in the published npm module:
17
16
 
18
- ```scss
19
- @import "@primer/css/utilities/index.scss";
20
- ```
17
+ - In git, all of the SCSS source files live in the `src/` directory.
18
+ - When published, all of the files in `src/` are "hoisted" to the package root so that you can import, say, utilities with:
21
19
 
22
- * All bundle interdependencies within Primer CSS are defined as relative imports (e.g. with `../`), so everything should work fine as long as the `@primer/css` directory is in one of your Sass include paths (i.e. `node_modules`).
20
+ ```scss
21
+ @import '@primer/css/utilities/index.scss';
22
+ ```
23
23
 
24
+ - All bundle interdependencies within Primer CSS are defined as relative imports (e.g. with `../`), so everything should work fine as long as the `@primer/css` directory is in one of your Sass include paths (i.e. `node_modules`).
24
25
 
25
26
  ## Install
27
+
26
28
  Run `npm install` to install the npm dependencies.
27
29
 
28
30
  ## Docs site
31
+
29
32
  The Primer CSS docs are built with React using [Doctocat](https://primer.style/doctocat) and automatically deployed on every push to this repo with [Now]. You can run the server locally with:
30
33
 
31
34
  ```sh
@@ -35,41 +38,43 @@ npm start
35
38
  Then visit http://localhost:8000 to view the site.
36
39
 
37
40
  ### The docs directory
38
- The [docs directory](../docs/) contains all of the documentation files in our docs site. Files are nested in the `/content` folder.
39
41
 
42
+ The [docs directory](../docs/) contains all of the documentation files in our docs site. Files are nested in the `/content` folder.
40
43
 
41
44
  ### Code blocks
45
+
42
46
  All `html` fenced code blocks in `src/**/*.md` will be rendered as stories and listed under the relevant module's name in the left-hand nav. File changes should trigger a live reload automatically (after a brief delay).
43
47
 
44
48
  ## Storybook
45
49
 
46
- Primer CSS Storybook is used for designing and prototyping components. Stories are written in HTML and leverage the Storybook API for configuring conditional logic.
50
+ Primer CSS Storybook is used for designing and prototyping components. Stories are written in HTML and leverage the Storybook API for configuring conditional logic.
47
51
 
48
52
  ```sh
49
53
  npm run storybook
50
54
  ```
51
55
 
52
56
  ### The Storybook directory
57
+
53
58
  Storybook configuration files live in [.storybook](../docs/.storybook). Addons and additional global config can be added to [main.js](../docs/.storybook/main.js) or [preview.js](../docs/.storybook/preview.js)
54
59
 
55
60
  ### Stories
61
+
56
62
  Stories are individual `.jsx` or `.mdx` files that contain component HTML for prototyping, typically showcasing all possible variations of a component. Stories can be found in the [stories directory](../docs/src/stories/components) and are organized by component. Storybook will build and deploy a preview on any open Pull Request.
57
63
 
58
64
  ## Scripts
65
+
59
66
  Our [`package.json`](package.json) houses a collection of [run-scripts] that we use to maintain, test, build, and publish Primer CSS. Run `npm run <script>` with any of the following values for `<script>`:
60
67
 
61
- * `dist` runs `script/dist`, which creates CSS bundles of all the `index.scss` files in `src/`.
62
- * `check-links` runs a link checker on your local development server (`localhost:3000`, started with `npm start`).
63
- * `stylelint` lints the CSS source files.
64
- * `eslint` lints the JavaScript source files.
65
- * `now-build` and `now-start` are run on [Now] to build and start the docs site server. `now-test` runs them both in order.
66
- * `start` runs the documentation site locally (alias: `dev`).
67
- * `test` runs our test suite.
68
- * `storybook` runs storybook local development server.
68
+ - `dist` runs `script/dist`, which creates CSS bundles of all the `index.scss` files in `src/`.
69
+ - `check-links` runs a link checker on your local development server (`localhost:3000`, started with `npm start`).
70
+ - `stylelint` lints the CSS source files.
71
+ - `eslint` lints the JavaScript source files.
72
+ - `start` runs the documentation site locally (alias: `dev`).
73
+ - `test` runs our test suite.
74
+ - `storybook` runs storybook local development server.
69
75
 
70
76
  The above list may not always be up-to-date. You can list all of the available scripts by calling `npm run` with no other arguments.
71
77
 
72
-
73
78
  [@primer/css]: https://www.npmjs.com/package/@primer/css
74
79
  [run-scripts]: https://docs.npmjs.com/cli/run-script
75
80
  [now]: https://zeit.co/now
@@ -1,12 +1,5 @@
1
1
  // stylelint-disable max-nesting-depth, selector-max-specificity, selector-max-compound-selectors
2
2
 
3
- @mixin focusOutline {
4
- position: relative;
5
- z-index: 1;
6
- outline: none;
7
- box-shadow: 0 0 0 2px var(--color-accent-fg); // this color breaks convention
8
- }
9
-
10
3
  @mixin activeIndicatorLine {
11
4
  position: absolute;
12
5
  top: calc(50% - 12px);
@@ -314,6 +307,16 @@
314
307
  text-decoration: none;
315
308
  }
316
309
 
310
+ &:focus {
311
+ @include focusOutline;
312
+
313
+ // remove fallback :focus if :focus-visible is supported
314
+ &:not(:focus-visible) {
315
+ outline: solid 1px transparent;
316
+ }
317
+ }
318
+
319
+ // default focus state
317
320
  &:focus-visible {
318
321
  @include focusOutline;
319
322
  }
@@ -1,21 +1,10 @@
1
- // stylelint-disable max-nesting-depth, selector-max-compound-selectors, selector-max-specificity, no-duplicate-selectors, selector-max-type
1
+ // stylelint-disable max-nesting-depth, selector-max-compound-selectors, selector-max-specificity, selector-max-type, primer/spacing
2
2
  // tree-view variant
3
3
  // renders ActionList with default styling for tree-view
4
4
  // collapse/expand icons presents as leadingActions, rotate 90deg
5
5
  // connecting vertical lines between collapse groups
6
6
  // consistent font-size between nested groups
7
7
 
8
- @mixin activeIndicatorLine {
9
- position: absolute;
10
- top: calc(50% - 12px);
11
- left: -$actionList-item-padding-horizontal;
12
- width: $spacer-1;
13
- height: $spacer-4;
14
- content: '';
15
- background: var(--color-accent-fg);
16
- border-radius: $border-radius;
17
- }
18
-
19
8
  @mixin treeConnectingLine($left) {
20
9
  position: absolute;
21
10
  left: $left;
@@ -40,96 +29,25 @@
40
29
  }
41
30
  }
42
31
 
43
- // start: copy from ActionList proper- backwards compatible for treeview with different markup structure
44
- &[aria-expanded] {
45
- .ActionList--subGroup {
46
- @media screen and (prefers-reduced-motion: no-preference) {
47
- transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
48
- }
49
-
50
- .ActionList-content {
51
- padding-left: $spacer-4;
52
- }
53
- }
54
-
55
- // has 16px leading visual
56
- .ActionList-content--visual16 + .ActionList--subGroup {
57
- .ActionList-content {
58
- padding-left: $spacer-5;
59
- }
60
- }
61
-
62
- // has 20px leading visual
63
- .ActionList-content--visual20 + .ActionList--subGroup {
64
- .ActionList-content {
65
- padding-left: $spacer-2 * 4.5; // 36px
66
- }
67
- }
68
-
69
- // has 24px leading visual
70
- .ActionList-content--visual24 + .ActionList--subGroup {
71
- .ActionList-content {
72
- padding-left: $spacer-6;
73
- }
74
- }
75
- }
76
-
77
- &[aria-expanded='true'] {
78
- .ActionList-item-collapseIcon {
79
- transition: transform 120ms linear;
80
- transform: scaleY(-1);
81
- }
82
-
83
- .ActionList--subGroup {
84
- height: auto;
85
- overflow: visible;
86
- visibility: visible;
87
- opacity: 1;
88
- transform: translateY(0);
89
- }
90
- }
91
-
92
- &[aria-expanded='false'] {
93
- .ActionList-item-collapseIcon {
94
- transition: transform 120ms linear;
95
- transform: scaleY(1);
96
- }
97
-
98
- .ActionList--subGroup {
99
- height: 0;
100
- overflow: hidden;
101
- visibility: hidden;
102
- opacity: 0;
103
- transform: translateY(-$spacer-3);
104
- }
105
-
106
- // show active indicator on parent collapse if child is active
107
- // this class changed in ActionList proper
108
- &.ActionList-item--hasActiveSubItem {
109
- background: var(--color-action-list-item-default-selected-bg);
110
-
111
- &::before,
112
- + .ActionList-item::before {
113
- visibility: hidden;
114
- }
115
-
116
- // blue accent line
117
- &::after {
118
- @include activeIndicatorLine;
32
+ // normal font-weight for any active item
33
+ &.ActionList-item--navActive {
34
+ &:not(.ActionList-item--subItem) {
35
+ .ActionList-item-label {
36
+ font-weight: $font-weight-normal;
119
37
  }
120
38
  }
121
39
  }
122
- // end copy
40
+ }
123
41
 
42
+ .ActionList-content {
124
43
  // nesting (infinite levels)
125
44
  // target items inside expanded subgroup
126
45
  &[aria-expanded] {
127
- .ActionList--subGroup {
46
+ + .ActionList--subGroup {
128
47
  position: relative;
129
48
 
130
49
  // --ActionList-tree-depth is defined as an inline style referencing the aria-level of each item ie: aria-level="2"
131
50
  .ActionList-content {
132
- // stylelint-disable-next-line primer/spacing
133
51
  padding-left: calc(#{$spacer-2} * var(--ActionList-tree-depth));
134
52
  }
135
53
  }
@@ -141,6 +59,13 @@
141
59
  transition: transform 120ms linear;
142
60
  transform: rotate(0deg);
143
61
  }
62
+
63
+ // normal weight for parent folder containing active child
64
+ &.ActionList-content--hasActiveSubItem {
65
+ > .ActionList-item-label {
66
+ font-weight: $font-weight-normal;
67
+ }
68
+ }
144
69
  }
145
70
 
146
71
  &[aria-expanded='false'] {
@@ -148,6 +73,12 @@
148
73
  transition: transform 120ms linear;
149
74
  transform: rotate(-90deg);
150
75
  }
76
+
77
+ &.ActionList-content--hasActiveSubItem {
78
+ > .ActionList-item-label {
79
+ font-weight: $font-weight-normal;
80
+ }
81
+ }
151
82
  }
152
83
  }
153
84
 
@@ -1,8 +1,57 @@
1
+ // Stacked label (default)
2
+ .autocomplete-label-stacked {
3
+ display: block;
4
+ margin-bottom: $spacer-2 * 0.75;
5
+ }
6
+
7
+ // Inline label (non-default)
8
+ .autocomplete-label-inline {
9
+ display: inline;
10
+ margin-right: $spacer-2 * 0.75;
11
+ }
12
+
13
+ // Switch to stacked at smaller viewport
14
+ @media (max-width: $width-sm) {
15
+ .autocomplete-label-inline {
16
+ display: block;
17
+ margin-bottom: $spacer-2 * 0.75;
18
+ }
19
+ }
20
+
21
+ // Wrapper for the input and result elements to ensure alignment
22
+ .autocomplete-body {
23
+ position: relative;
24
+ display: inline;
25
+ }
26
+
27
+ // Wrapper and conditional styles for when an icon is added
28
+ .autocomplete-embedded-icon-wrap {
29
+ display: inline-flex;
30
+ padding: $spacer-1 $spacer-2;
31
+ align-items: center;
32
+
33
+ &:focus-within {
34
+ border-color: var(--color-accent-fg);
35
+
36
+ @include focusBoxShadowInset;
37
+ }
38
+
39
+ .form-control {
40
+ padding: 0;
41
+ margin-left: $spacer-2;
42
+ // stylelint-disable-next-line
43
+ border: none;
44
+ box-shadow: none;
45
+ }
46
+ }
47
+
1
48
  // A pop up list of items used to show autocompleted results
2
49
  .autocomplete-results {
3
50
  position: absolute;
51
+ left: 0;
4
52
  z-index: 99;
5
- width: 100%;
53
+ width: max-content;
54
+ min-width: 100%;
6
55
  max-height: 20em;
7
56
  overflow-y: auto;
8
57
  // stylelint-disable-next-line primer/typography
package/base/base.scss CHANGED
@@ -1,4 +1,4 @@
1
- // stylelint-disable selector-max-type
1
+ // stylelint-disable selector-max-type, selector-no-qualifying-type
2
2
  * {
3
3
  box-sizing: border-box;
4
4
  }
@@ -77,10 +77,70 @@ button {
77
77
  }
78
78
 
79
79
  details {
80
- summary { cursor: pointer; }
80
+ summary {
81
+ cursor: pointer;
82
+ }
81
83
 
82
84
  &:not([open]) {
83
85
  // Set details content hidden by default for browsers that don't do this
84
- > *:not(summary) { display: none !important; }
86
+ > *:not(summary) {
87
+ display: none !important;
88
+ }
89
+ }
90
+ }
91
+
92
+ // global focus styles
93
+
94
+ a,
95
+ button,
96
+ [role='button'],
97
+ input[type='radio'],
98
+ input[type='checkbox'] {
99
+ transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
100
+ transition-property: color, background-color, box-shadow, border-color;
101
+ // fallback :focus state
102
+ &:focus {
103
+ @include focusOutline;
104
+
105
+ // remove fallback :focus if :focus-visible is supported
106
+ &:not(:focus-visible) {
107
+ outline: solid 1px transparent;
108
+ }
109
+ }
110
+
111
+ // default focus state
112
+ &:focus-visible {
113
+ @include focusOutline;
114
+ }
115
+ }
116
+
117
+ a:not([class]),
118
+ input[type='radio'],
119
+ input[type='checkbox'] {
120
+ &:focus,
121
+ &:focus-visible {
122
+ outline-offset: 0;
123
+ }
124
+ }
125
+
126
+ // for handling focus conditionally
127
+ .focus {
128
+ @include focusBoxShadowInset;
129
+ }
130
+
131
+ // Windows High Contrast mode
132
+ @media (forced-colors: active) {
133
+ *:focus,
134
+ *:focus-visible {
135
+ outline: solid 1px transparent;
136
+ }
137
+
138
+ input:not([type='radio'], [type='checkbox']),
139
+ textarea,
140
+ select {
141
+ &:focus,
142
+ &:focus-visible {
143
+ outline-offset: 2px;
144
+ }
85
145
  }
86
146
  }
@@ -39,7 +39,8 @@ header,
39
39
  main, /* 2 */
40
40
  menu,
41
41
  nav,
42
- section { /* 1 */
42
+ section {
43
+ /* 1 */
43
44
  display: block;
44
45
  }
45
46
 
@@ -96,16 +97,6 @@ a {
96
97
  background-color: transparent; /* 1 */
97
98
  }
98
99
 
99
- /**
100
- * Remove the outline on focused links when they are also active or hovered
101
- * in all browsers (opinionated).
102
- */
103
-
104
- a:active,
105
- a:hover {
106
- outline-width: 0;
107
- }
108
-
109
100
  /* Text-level semantics
110
101
  ========================================================================== */
111
102
 
@@ -278,7 +269,8 @@ optgroup {
278
269
  */
279
270
 
280
271
  button,
281
- input { /* 1 */
272
+ input {
273
+ /* 1 */
282
274
  overflow: visible;
283
275
  }
284
276
 
@@ -288,7 +280,8 @@ input { /* 1 */
288
280
  */
289
281
 
290
282
  button,
291
- select { /* 1 */
283
+ select {
284
+ /* 1 */
292
285
  text-transform: none;
293
286
  }
294
287
 
@@ -305,29 +298,6 @@ html [type="button"], /* 1 */
305
298
  -webkit-appearance: button; /* 2 */
306
299
  }
307
300
 
308
- /**
309
- * Remove the inner border and padding in Firefox.
310
- */
311
-
312
- button::-moz-focus-inner,
313
- [type="button"]::-moz-focus-inner,
314
- [type="reset"]::-moz-focus-inner,
315
- [type="submit"]::-moz-focus-inner {
316
- border-style: none;
317
- padding: 0;
318
- }
319
-
320
- /**
321
- * Restore the focus styles unset by the previous rule.
322
- */
323
-
324
- button:-moz-focusring,
325
- [type="button"]:-moz-focusring,
326
- [type="reset"]:-moz-focusring,
327
- [type="submit"]:-moz-focusring {
328
- outline: 1px dotted ButtonText;
329
- }
330
-
331
301
  /**
332
302
  * Change the border, margin, and padding in all browsers (opinionated).
333
303
  */
@@ -367,8 +337,8 @@ textarea {
367
337
  * 2. Remove the padding in IE 10-.
368
338
  */
369
339
 
370
- [type="checkbox"],
371
- [type="radio"] {
340
+ [type='checkbox'],
341
+ [type='radio'] {
372
342
  box-sizing: border-box; /* 1 */
373
343
  padding: 0; /* 2 */
374
344
  }
@@ -377,27 +347,17 @@ textarea {
377
347
  * Correct the cursor style of increment and decrement buttons in Chrome.
378
348
  */
379
349
 
380
- [type="number"]::-webkit-inner-spin-button,
381
- [type="number"]::-webkit-outer-spin-button {
350
+ [type='number']::-webkit-inner-spin-button,
351
+ [type='number']::-webkit-outer-spin-button {
382
352
  height: auto;
383
353
  }
384
354
 
385
- /**
386
- * 1. Correct the odd appearance in Chrome and Safari.
387
- * 2. Correct the outline style in Safari.
388
- */
389
-
390
- [type="search"] {
391
- -webkit-appearance: textfield; /* 1 */
392
- outline-offset: -2px; /* 2 */
393
- }
394
-
395
355
  /**
396
356
  * Remove the inner padding and cancel buttons in Chrome and Safari on OS X.
397
357
  */
398
358
 
399
- [type="search"]::-webkit-search-cancel-button,
400
- [type="search"]::-webkit-search-decoration {
359
+ [type='search']::-webkit-search-cancel-button,
360
+ [type='search']::-webkit-search-decoration {
401
361
  -webkit-appearance: none;
402
362
  }
403
363
 
@@ -1,4 +1,5 @@
1
1
  .Box--overlay {
2
+ // stylelint-disable-next-line primer/responsive-widths
2
3
  width: 448px;
3
4
  margin-right: auto;
4
5
  margin-left: auto;
@@ -22,6 +23,7 @@
22
23
  }
23
24
 
24
25
  .Box-overlay--wide {
26
+ // stylelint-disable-next-line primer/responsive-widths
25
27
  width: 640px;
26
28
  }
27
29
 
@@ -8,6 +8,7 @@
8
8
  padding: 2px 6px;
9
9
  font: 12px $mono-font;
10
10
  color: var(--color-fg-muted);
11
+ word-break: break-all;
11
12
  background-color: var(--color-accent-subtle);
12
13
  border-radius: $border-radius;
13
14