@primer/css 0.0.0-20220420162120 → 0.0.0-20220420163721

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 (97) hide show
  1. package/CHANGELOG.md +5 -3
  2. package/actionlist/action-list-item.scss +10 -7
  3. package/autocomplete/autocomplete.scss +3 -7
  4. package/base/base.scss +63 -3
  5. package/base/normalize.scss +12 -52
  6. package/buttons/button.scss +54 -27
  7. package/buttons/misc.scss +25 -19
  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.map +1 -1
  40. package/dist/marketing-utilities.css.map +1 -1
  41. package/dist/marketing.css +1 -1
  42. package/dist/marketing.css.map +1 -1
  43. package/dist/meta.json +82 -82
  44. package/dist/navigation.css +1 -1
  45. package/dist/navigation.css.map +1 -1
  46. package/dist/pagination.css +1 -1
  47. package/dist/pagination.css.map +1 -1
  48. package/dist/popover.css.map +1 -1
  49. package/dist/primer.css +3 -3
  50. package/dist/primer.css.map +1 -1
  51. package/dist/product.css +1 -1
  52. package/dist/product.css.map +1 -1
  53. package/dist/progress.css.map +1 -1
  54. package/dist/select-menu.css.map +1 -1
  55. package/dist/stats/actionlist.json +1 -1
  56. package/dist/stats/autocomplete.json +1 -1
  57. package/dist/stats/base.json +1 -1
  58. package/dist/stats/buttons.json +1 -1
  59. package/dist/stats/core.json +1 -1
  60. package/dist/stats/dropdown.json +1 -1
  61. package/dist/stats/forms.json +1 -1
  62. package/dist/stats/links.json +1 -1
  63. package/dist/stats/marketing-buttons.json +1 -1
  64. package/dist/stats/marketing-links.json +1 -1
  65. package/dist/stats/marketing.json +1 -1
  66. package/dist/stats/navigation.json +1 -1
  67. package/dist/stats/pagination.json +1 -1
  68. package/dist/stats/primer.json +1 -1
  69. package/dist/stats/product.json +1 -1
  70. package/dist/stats/toasts.json +1 -1
  71. package/dist/stats/utilities.json +1 -1
  72. package/dist/subhead.css.map +1 -1
  73. package/dist/timeline.css.map +1 -1
  74. package/dist/toasts.css +1 -1
  75. package/dist/toasts.css.map +1 -1
  76. package/dist/tooltips.css.map +1 -1
  77. package/dist/truncate.css.map +1 -1
  78. package/dist/utilities.css +1 -1
  79. package/dist/utilities.css.map +1 -1
  80. package/dropdown/dropdown.scss +0 -2
  81. package/forms/form-control.scss +23 -5
  82. package/forms/form-group.scss +38 -13
  83. package/forms/input-group.scss +8 -0
  84. package/links/link.scss +5 -0
  85. package/marketing/buttons/button.scss +32 -26
  86. package/marketing/links/link.scss +5 -5
  87. package/navigation/filter-list.scss +18 -0
  88. package/navigation/menu.scss +6 -8
  89. package/navigation/sidenav.scss +1 -10
  90. package/navigation/subnav.scss +18 -0
  91. package/navigation/tabnav.scss +7 -2
  92. package/navigation/underline-nav.scss +51 -45
  93. package/package.json +1 -1
  94. package/pagination/pagination.scss +24 -3
  95. package/support/mixins/misc.scss +27 -5
  96. package/toasts/toasts.scss +7 -4
  97. package/utilities/details.scss +81 -4
@@ -1,3 +1,4 @@
1
+ // stylelint-disable selector-max-specificity
1
2
  $nav-height: $spacer-3 * 3 !default; // 48px
2
3
 
3
4
  .UnderlineNav {
@@ -34,56 +35,61 @@ $nav-height: $spacer-3 * 3 !default; // 48px
34
35
  border-radius: $border-radius;
35
36
  align-items: center;
36
37
 
37
- // renders a visibly hidden "copy" of the label in bold, reserving box space for when label becomes bold on selected
38
- [data-content]::before {
39
- display: block;
40
- height: 0;
41
- font-weight: $font-weight-bold;
42
- visibility: hidden;
43
- content: attr(data-content);
44
- }
45
-
46
- // increase touch target area
47
- &::before {
48
- @include minTouchTarget($min-height: $nav-height);
49
- }
50
-
51
- // hover state was "sticking" on mobile after click
52
- @media (pointer: fine) {
53
- &:hover {
54
- color: var(--color-fg-default);
55
- text-decoration: none;
56
- background: var(--color-action-list-item-default-hover-bg);
57
- transition: background 0.12s ease-out;
38
+ &:hover,
39
+ &:focus,
40
+ &:focus-visible {
41
+ color: var(--color-fg-default);
42
+ text-decoration: none;
43
+ border-bottom-color: var(--color-neutral-muted);
44
+ outline-offset: -8px;
45
+ 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);
58
54
  }
59
- }
60
55
 
61
- &.selected,
62
- &[role='tab'][aria-selected='true'],
63
- &[aria-current]:not([aria-current='false']) {
64
- font-weight: $font-weight-bold;
65
- color: var(--color-fg-default);
56
+ // increase touch target area
57
+ &::before {
58
+ @include minTouchTarget($min-height: $nav-height);
59
+ }
66
60
 
67
- // current/selected underline
68
- &::after {
69
- position: absolute;
70
- right: 50%;
71
- // 48px total height / 2 (24px) + 1px
72
- bottom: calc(50% - 25px);
73
- width: 100%;
74
- height: 2px;
75
- content: '';
76
- background: var(--color-primer-border-active);
77
- border-radius: $border-radius;
78
- transform: translate(50%, -50%);
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
+ }
79
69
  }
80
- }
81
70
 
82
- // remove when global focus state is merged
83
- &.focus,
84
- &:focus {
85
- @include focusOutline;
86
- outline-offset: -2px;
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
+ }
87
93
  }
88
94
 
89
95
  .Counter {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/css",
3
- "version": "0.0.0-20220420162120",
3
+ "version": "0.0.0-20220420163721",
4
4
  "description": "The CSS implementation of GitHub's Primer Design System",
5
5
  "homepage": "https://primer.style/css",
6
6
  "author": "GitHub, Inc.",
@@ -24,7 +24,6 @@
24
24
  &:focus {
25
25
  text-decoration: none;
26
26
  border-color: var(--color-border-default);
27
- outline: 0;
28
27
  transition-duration: 0.1s;
29
28
  }
30
29
 
@@ -74,13 +73,35 @@
74
73
  // chevron-left
75
74
  .previous_page::before {
76
75
  margin-right: $spacer-1;
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);
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
+ );
78
88
  }
79
89
 
80
90
  // chevron-right
81
91
  .next_page::after {
82
92
  margin-left: $spacer-1;
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);
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
+ );
84
105
  }
85
106
  }
86
107
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  &::after {
18
18
  // stylelint-disable-next-line primer/spacing
19
- margin-left: 1px;
19
+ margin-left: 2px;
20
20
  background-color: var(--color-canvas-default);
21
21
  background-image: linear-gradient($background, $background);
22
22
  }
@@ -28,10 +28,32 @@
28
28
 
29
29
  // global focus styles
30
30
 
31
- @mixin focusOutline {
32
- z-index: 1;
33
- outline: 2px solid var(--color-accent-fg);
34
- outline-offset: 2px;
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);
35
57
  }
36
58
 
37
59
  // if min-width is undefined, return only min-height
@@ -40,9 +40,7 @@
40
40
  background-color: transparent;
41
41
  border: 0;
42
42
 
43
- &:focus,
44
43
  &:hover {
45
- outline: none;
46
44
  opacity: 0.7;
47
45
  }
48
46
 
@@ -119,6 +117,11 @@
119
117
  }
120
118
 
121
119
  @keyframes Toast--spinner {
122
- from { transform: rotate(0deg); }
123
- to { transform: rotate(360deg); }
120
+ from {
121
+ transform: rotate(0deg);
122
+ }
123
+
124
+ to {
125
+ transform: rotate(360deg);
126
+ }
124
127
  }
@@ -1,4 +1,4 @@
1
- // stylelint-disable selector-max-type
1
+ // stylelint-disable selector-max-type, selector-max-specificity, max-nesting-depth, selector-no-qualifying-type
2
2
 
3
3
  .details-overlay[open] > summary::before {
4
4
  position: fixed;
@@ -20,9 +20,86 @@
20
20
 
21
21
  .details-reset {
22
22
  // Remove marker added by the display: list-item browser default
23
- > summary { list-style: none; }
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
+ }
24
60
  // Remove marker added by details polyfill
25
- > summary::before { display: none; }
61
+ > summary::before {
62
+ display: none;
63
+ }
26
64
  // Remove marker added by Chrome
27
- > summary::-webkit-details-marker { display: none; }
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
+ }
28
105
  }