@primer/css 0.0.0-20220420163721 → 0.0.0-20220420184728

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 (100) hide show
  1. package/CHANGELOG.md +1 -11
  2. package/actionlist/action-list-item.scss +7 -10
  3. package/autocomplete/autocomplete.scss +7 -3
  4. package/base/base.scss +3 -63
  5. package/base/normalize.scss +52 -12
  6. package/buttons/button.scss +27 -54
  7. package/buttons/misc.scss +19 -25
  8. package/dist/actionlist.css +1 -1
  9. package/dist/actionlist.css.map +1 -1
  10. package/dist/alerts.css.map +1 -1
  11. package/dist/autocomplete.css +1 -1
  12. package/dist/autocomplete.css.map +1 -1
  13. package/dist/avatars.css.map +1 -1
  14. package/dist/base.css +1 -1
  15. package/dist/base.css.map +1 -1
  16. package/dist/blankslate.css.map +1 -1
  17. package/dist/box.css.map +1 -1
  18. package/dist/branch-name.css.map +1 -1
  19. package/dist/breadcrumb.css.map +1 -1
  20. package/dist/buttons.css +1 -1
  21. package/dist/buttons.css.map +1 -1
  22. package/dist/core.css +1 -1
  23. package/dist/core.css.map +1 -1
  24. package/dist/dropdown.css +1 -1
  25. package/dist/dropdown.css.map +1 -1
  26. package/dist/forms.css +1 -1
  27. package/dist/forms.css.map +1 -1
  28. package/dist/header.css.map +1 -1
  29. package/dist/labels.css.map +1 -1
  30. package/dist/layout.css.map +1 -1
  31. package/dist/links.css +1 -1
  32. package/dist/links.css.map +1 -1
  33. package/dist/loaders.css.map +1 -1
  34. package/dist/markdown.css.map +1 -1
  35. package/dist/marketing-buttons.css +1 -1
  36. package/dist/marketing-buttons.css.map +1 -1
  37. package/dist/marketing-links.css +1 -1
  38. package/dist/marketing-links.css.map +1 -1
  39. package/dist/marketing-type.css +1 -1
  40. package/dist/marketing-type.css.map +1 -1
  41. package/dist/marketing-utilities.css.map +1 -1
  42. package/dist/marketing.css +1 -1
  43. package/dist/marketing.css.map +1 -1
  44. package/dist/meta.json +88 -88
  45. package/dist/navigation.css +1 -1
  46. package/dist/navigation.css.map +1 -1
  47. package/dist/pagination.css +1 -1
  48. package/dist/pagination.css.map +1 -1
  49. package/dist/popover.css.map +1 -1
  50. package/dist/primer.css +3 -3
  51. package/dist/primer.css.map +1 -1
  52. package/dist/product.css +1 -1
  53. package/dist/product.css.map +1 -1
  54. package/dist/progress.css.map +1 -1
  55. package/dist/select-menu.css.map +1 -1
  56. package/dist/stats/actionlist.json +1 -1
  57. package/dist/stats/autocomplete.json +1 -1
  58. package/dist/stats/base.json +1 -1
  59. package/dist/stats/buttons.json +1 -1
  60. package/dist/stats/core.json +1 -1
  61. package/dist/stats/dropdown.json +1 -1
  62. package/dist/stats/forms.json +1 -1
  63. package/dist/stats/links.json +1 -1
  64. package/dist/stats/marketing-buttons.json +1 -1
  65. package/dist/stats/marketing-links.json +1 -1
  66. package/dist/stats/marketing-type.json +1 -1
  67. package/dist/stats/marketing.json +1 -1
  68. package/dist/stats/navigation.json +1 -1
  69. package/dist/stats/pagination.json +1 -1
  70. package/dist/stats/primer.json +1 -1
  71. package/dist/stats/product.json +1 -1
  72. package/dist/stats/toasts.json +1 -1
  73. package/dist/stats/utilities.json +1 -1
  74. package/dist/subhead.css.map +1 -1
  75. package/dist/timeline.css.map +1 -1
  76. package/dist/toasts.css +1 -1
  77. package/dist/toasts.css.map +1 -1
  78. package/dist/tooltips.css.map +1 -1
  79. package/dist/truncate.css.map +1 -1
  80. package/dist/utilities.css +1 -1
  81. package/dist/utilities.css.map +1 -1
  82. package/dropdown/dropdown.scss +2 -0
  83. package/forms/form-control.scss +5 -23
  84. package/forms/form-group.scss +13 -38
  85. package/forms/input-group.scss +0 -8
  86. package/links/link.scss +0 -5
  87. package/marketing/buttons/button.scss +26 -32
  88. package/marketing/links/link.scss +5 -5
  89. package/marketing/type/typography.scss +29 -0
  90. package/navigation/filter-list.scss +0 -18
  91. package/navigation/menu.scss +8 -6
  92. package/navigation/sidenav.scss +10 -1
  93. package/navigation/subnav.scss +0 -18
  94. package/navigation/tabnav.scss +2 -7
  95. package/navigation/underline-nav.scss +28 -79
  96. package/package.json +4 -5
  97. package/pagination/pagination.scss +3 -24
  98. package/support/mixins/misc.scss +1 -47
  99. package/toasts/toasts.scss +4 -7
  100. package/utilities/details.scss +4 -81
@@ -1,105 +1,50 @@
1
- // stylelint-disable selector-max-specificity
2
- $nav-height: $spacer-3 * 3 !default; // 48px
3
-
4
1
  .UnderlineNav {
5
2
  display: flex;
6
- min-height: $nav-height;
7
3
  overflow-x: auto;
8
4
  overflow-y: hidden;
9
5
  // stylelint-disable-next-line primer/box-shadow
10
6
  box-shadow: inset 0 -1px 0 var(--color-border-muted);
11
- -webkit-overflow-scrolling: auto;
12
7
  justify-content: space-between;
13
8
  }
14
9
 
15
10
  .UnderlineNav-body {
16
11
  display: flex;
17
- align-items: center;
18
- gap: $spacer-2;
19
- list-style: none;
20
12
  }
21
13
 
22
14
  .UnderlineNav-item {
23
- position: relative;
24
- display: flex;
25
- padding: 0 $spacer-2;
15
+ padding: $spacer-2 $spacer-3;
26
16
  font-size: $body-font-size;
27
17
  // stylelint-disable-next-line primer/typography
28
18
  line-height: 30px;
29
19
  color: var(--color-fg-default);
30
20
  text-align: center;
31
21
  white-space: nowrap;
32
- cursor: pointer;
33
22
  background-color: transparent;
34
23
  border: 0;
35
- border-radius: $border-radius;
36
- align-items: center;
24
+ // stylelint-disable-next-line primer/borders
25
+ border-bottom: 2px $border-style transparent;
37
26
 
38
27
  &:hover,
39
- &:focus,
40
- &:focus-visible {
28
+ &:focus {
41
29
  color: var(--color-fg-default);
42
30
  text-decoration: none;
43
31
  border-bottom-color: var(--color-neutral-muted);
44
- outline-offset: -8px;
32
+ outline: 1px dotted transparent; // Support Firefox custom colors
33
+ outline-offset: -1px;
45
34
  transition: border-bottom-color 0.12s ease-out;
46
-
47
- // renders a visibly hidden "copy" of the label in bold, reserving box space for when label becomes bold on selected
48
- [data-content]::before {
49
- display: block;
50
- height: 0;
51
- font-weight: $font-weight-bold;
52
- visibility: hidden;
53
- content: attr(data-content);
54
- }
55
-
56
- // increase touch target area
57
- &::before {
58
- @include minTouchTarget($min-height: $nav-height);
59
- }
60
-
61
- // hover state was "sticking" on mobile after click
62
- @media (pointer: fine) {
63
- &:hover {
64
- color: var(--color-fg-default);
65
- text-decoration: none;
66
- background: var(--color-action-list-item-default-hover-bg);
67
- transition: background 0.12s ease-out;
68
- }
69
- }
70
-
71
- &.selected,
72
- &[role='tab'][aria-selected='true'],
73
- &[aria-current]:not([aria-current='false']) {
74
- font-weight: $font-weight-bold;
75
- color: var(--color-fg-default);
76
- border-bottom-color: var(--color-primer-border-active);
77
- outline-offset: -8px;
78
-
79
- // current/selected underline
80
- &::after {
81
- position: absolute;
82
- right: 50%;
83
- // 48px total height / 2 (24px) + 1px
84
- bottom: calc(50% - 25px);
85
- width: 100%;
86
- height: 2px;
87
- content: '';
88
- background: var(--color-primer-border-active);
89
- border-radius: $border-radius;
90
- transform: translate(50%, -50%);
91
- }
92
- }
93
35
  }
94
36
 
95
- .Counter {
96
- margin-left: $spacer-2;
37
+ &.selected,
38
+ &[role='tab'][aria-selected='true'],
39
+ &[aria-current]:not([aria-current='false']) {
40
+ font-weight: $font-weight-bold;
97
41
  color: var(--color-fg-default);
98
- background-color: var(--color-neutral-muted);
42
+ border-bottom-color: var(--color-primer-border-active);
43
+ outline: 1px dotted transparent; // Support Firefox custom colors
44
+ outline-offset: -1px;
99
45
 
100
- &--primary {
101
- color: var(--color-fg-on-emphasis);
102
- background-color: var(--color-neutral-emphasis);
46
+ .UnderlineNav-octicon {
47
+ color: var(--color-fg-muted);
103
48
  }
104
49
  }
105
50
  }
@@ -118,18 +63,22 @@ $nav-height: $spacer-3 * 3 !default; // 48px
118
63
 
119
64
  .UnderlineNav--full {
120
65
  display: block;
121
-
122
- // required for underline to align with additional wrapper element
123
- .UnderlineNav-body {
124
- min-height: $nav-height;
125
- }
126
66
  }
127
67
 
128
68
  .UnderlineNav-octicon {
129
- display: inline !important;
130
- margin-right: $spacer-2;
131
- color: var(--color-fg-muted);
132
- fill: var(--color-fg-muted);
69
+ margin-right: $spacer-1;
70
+ color: var(--color-fg-subtle);
71
+ }
72
+
73
+ .UnderlineNav .Counter {
74
+ margin-left: $spacer-1;
75
+ color: var(--color-fg-default);
76
+ background-color: var(--color-neutral-muted);
77
+
78
+ &--primary {
79
+ color: var(--color-fg-on-emphasis);
80
+ background-color: var(--color-neutral-emphasis);
81
+ }
133
82
  }
134
83
 
135
84
  .UnderlineNav-container {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/css",
3
- "version": "0.0.0-20220420163721",
3
+ "version": "0.0.0-20220420184728",
4
4
  "description": "The CSS implementation of GitHub's Primer Design System",
5
5
  "homepage": "https://primer.style/css",
6
6
  "author": "GitHub, Inc.",
@@ -35,7 +35,6 @@
35
35
  "prepublishOnly": "script/prepublish",
36
36
  "start": "yarn dev",
37
37
  "dev": "cd docs && yarn && yarn develop",
38
- "postinstall": "cd docs && yarn",
39
38
  "pretest": "yarn dist && script/pretest",
40
39
  "test": "NODE_OPTIONS=--experimental-vm-modules yarn jest",
41
40
  "release": "changeset publish",
@@ -46,13 +45,13 @@
46
45
  },
47
46
  "devDependencies": {
48
47
  "@changesets/changelog-github": "0.4.4",
49
- "@changesets/cli": "2.20.0",
48
+ "@changesets/cli": "2.22.0",
50
49
  "@github/prettier-config": "0.0.4",
51
50
  "@koddsson/postcss-sass": "5.0.1",
52
51
  "@primer/stylelint-config": "^12.3.3",
53
52
  "autoprefixer": "10.4.4",
54
53
  "chokidar-cli": "3.0.0",
55
- "cssstats": "4.0.2",
54
+ "cssstats": "4.0.5",
56
55
  "eslint": "8.13.0",
57
56
  "eslint-plugin-github": "4.3.6",
58
57
  "eslint-plugin-jest": "26.0.0",
@@ -65,7 +64,7 @@
65
64
  "js-yaml": "4.1.0",
66
65
  "postcss": "8.4.12",
67
66
  "postcss-calc": "8.2.4",
68
- "postcss-import": "14.0.2",
67
+ "postcss-import": "14.1.0",
69
68
  "postcss-load-config": "3.1.4",
70
69
  "postcss-scss": "4.0.3",
71
70
  "postcss-simple-vars": "6.0.3",
@@ -24,6 +24,7 @@
24
24
  &:focus {
25
25
  text-decoration: none;
26
26
  border-color: var(--color-border-default);
27
+ outline: 0;
27
28
  transition-duration: 0.1s;
28
29
  }
29
30
 
@@ -73,35 +74,13 @@
73
74
  // chevron-left
74
75
  .previous_page::before {
75
76
  margin-right: $spacer-1;
76
- clip-path:
77
- polygon(
78
- 9.8px 12.8px,
79
- 8.7px 12.8px,
80
- 4.5px 8.5px,
81
- 4.5px 7.5px,
82
- 8.7px 3.2px,
83
- 9.8px 4.3px,
84
- 6.1px 8px,
85
- 9.8px 11.7px,
86
- 9.8px 12.8px
87
- );
77
+ clip-path: polygon(9.8px 12.8px, 8.7px 12.8px, 4.5px 8.5px, 4.5px 7.5px, 8.7px 3.2px, 9.8px 4.3px, 6.1px 8px, 9.8px 11.7px, 9.8px 12.8px);
88
78
  }
89
79
 
90
80
  // chevron-right
91
81
  .next_page::after {
92
82
  margin-left: $spacer-1;
93
- clip-path:
94
- polygon(
95
- 6.2px 3.2px,
96
- 7.3px 3.2px,
97
- 11.5px 7.5px,
98
- 11.5px 8.5px,
99
- 7.3px 12.8px,
100
- 6.2px 11.7px,
101
- 9.9px 8px,
102
- 6.2px 4.3px,
103
- 6.2px 3.2px
104
- );
83
+ clip-path: polygon(6.2px 3.2px, 7.3px 3.2px, 11.5px 7.5px, 11.5px 8.5px, 7.3px 12.8px, 6.2px 11.7px, 9.9px 8px, 6.2px 4.3px, 6.2px 3.2px);
105
84
  }
106
85
  }
107
86
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  &::after {
18
18
  // stylelint-disable-next-line primer/spacing
19
- margin-left: 2px;
19
+ margin-left: 1px;
20
20
  background-color: var(--color-canvas-default);
21
21
  background-image: linear-gradient($background, $background);
22
22
  }
@@ -25,49 +25,3 @@
25
25
  background-color: $border;
26
26
  }
27
27
  }
28
-
29
- // global focus styles
30
-
31
- // inset box-shadow for form controls
32
- @mixin focusBoxShadowInset($outlineWidth: 1px, $outlineColor: var(--color-accent-fg)) {
33
- border-color: var(--color-accent-fg);
34
- outline: none;
35
- box-shadow: inset 0 0 0 $outlineWidth $outlineColor;
36
- }
37
-
38
- // box-shadow for :target styles (no inset)
39
- // !important to override PCSS utilities
40
- @mixin targetBoxShadow($outlineWidth: 2px, $outlineColor: var(--color-accent-fg)) {
41
- outline: none !important;
42
- box-shadow: 0 0 0 $outlineWidth $outlineColor !important;
43
- }
44
-
45
- // outline
46
- @mixin focusOutline($outlineOffset: -2px, $outlineColor: var(--color-accent-fg)) {
47
- outline: 2px solid $outlineColor;
48
- outline-offset: $outlineOffset;
49
- box-shadow: none;
50
- }
51
-
52
- // outline with fg box-shadow for buttons
53
- @mixin focusOutlineOnEmphasis($outlineOffset: -2px, $outlineColor: var(--color-accent-fg)) {
54
- outline: 2px solid $outlineColor;
55
- outline-offset: $outlineOffset;
56
- box-shadow: inset 0 0 0 3px var(--color-fg-on-emphasis);
57
- }
58
-
59
- // if min-width is undefined, return only min-height
60
- @mixin minTouchTarget($min-height: 32px, $min-width: '') {
61
- position: absolute;
62
- top: 50%;
63
- left: 50%;
64
- width: 100%;
65
- height: 100%;
66
- min-height: $min-height;
67
- content: '';
68
- transform: translateX(-50%) translateY(-50%);
69
-
70
- @if $min-width != '' {
71
- min-width: $min-width;
72
- }
73
- }
@@ -40,7 +40,9 @@
40
40
  background-color: transparent;
41
41
  border: 0;
42
42
 
43
+ &:focus,
43
44
  &:hover {
45
+ outline: none;
44
46
  opacity: 0.7;
45
47
  }
46
48
 
@@ -117,11 +119,6 @@
117
119
  }
118
120
 
119
121
  @keyframes Toast--spinner {
120
- from {
121
- transform: rotate(0deg);
122
- }
123
-
124
- to {
125
- transform: rotate(360deg);
126
- }
122
+ from { transform: rotate(0deg); }
123
+ to { transform: rotate(360deg); }
127
124
  }
@@ -1,4 +1,4 @@
1
- // stylelint-disable selector-max-type, selector-max-specificity, max-nesting-depth, selector-no-qualifying-type
1
+ // stylelint-disable selector-max-type
2
2
 
3
3
  .details-overlay[open] > summary::before {
4
4
  position: fixed;
@@ -20,86 +20,9 @@
20
20
 
21
21
  .details-reset {
22
22
  // Remove marker added by the display: list-item browser default
23
- > summary {
24
- list-style: none;
25
- transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
26
- transition-property: color, background-color, box-shadow, border-color;
27
- // fallback :focus state
28
- &:focus {
29
- @include focusOutline;
30
-
31
- // remove fallback :focus if :focus-visible is supported
32
- &:not(:focus-visible) {
33
- outline: solid 1px transparent;
34
- }
35
- }
36
-
37
- // default focus state
38
- &:focus-visible {
39
- @include focusOutline;
40
- }
41
-
42
- &.btn-primary {
43
- // fallback :focus state
44
- &:focus {
45
- @include focusOutlineOnEmphasis;
46
-
47
- // remove fallback :focus if :focus-visible is supported
48
- &:not(:focus-visible) {
49
- outline: solid 1px transparent;
50
- box-shadow: none;
51
- }
52
- }
53
-
54
- // default focus state
55
- &:focus-visible {
56
- @include focusOutlineOnEmphasis;
57
- }
58
- }
59
- }
23
+ > summary { list-style: none; }
60
24
  // Remove marker added by details polyfill
61
- > summary::before {
62
- display: none;
63
- }
25
+ > summary::before { display: none; }
64
26
  // Remove marker added by Chrome
65
- > summary::-webkit-details-marker {
66
- display: none;
67
- }
68
- }
69
-
70
- .details-overlay > summary {
71
- transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
72
- transition-property: color, background-color, box-shadow, border-color;
73
- // fallback :focus state
74
- &:focus {
75
- @include focusOutline;
76
-
77
- // remove fallback :focus if :focus-visible is supported
78
- &:not(:focus-visible) {
79
- outline: solid 1px transparent;
80
- }
81
- }
82
-
83
- // default focus state
84
- &:focus-visible {
85
- @include focusOutline;
86
- }
87
-
88
- &.btn-primary {
89
- // fallback :focus state
90
- &:focus {
91
- @include focusOutlineOnEmphasis;
92
-
93
- // remove fallback :focus if :focus-visible is supported
94
- &:not(:focus-visible) {
95
- outline: solid 1px transparent;
96
- box-shadow: none;
97
- }
98
- }
99
-
100
- // default focus state
101
- &:focus-visible {
102
- @include focusOutlineOnEmphasis;
103
- }
104
- }
27
+ > summary::-webkit-details-marker { display: none; }
105
28
  }