@papillonbits/css 1.4.0 → 1.6.0

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 (126) hide show
  1. package/LICENSE +1 -1
  2. package/build/primer/autocomplete/README.md +20 -0
  3. package/build/primer/autocomplete/index.scss +3 -0
  4. package/build/primer/autocomplete/suggester.scss +101 -0
  5. package/build/primer/avatars/README.md +20 -0
  6. package/build/primer/avatars/avatar-parent-child.scss +17 -0
  7. package/build/primer/avatars/circle-badge.scss +55 -0
  8. package/build/primer/avatars/index.scss +5 -0
  9. package/build/primer/base/README.md +20 -0
  10. package/build/primer/base/base.scss +2 -5
  11. package/build/primer/base/kbd.scss +2 -6
  12. package/build/primer/base/typography-base.scss +0 -3
  13. package/build/primer/box/README.md +20 -0
  14. package/build/primer/box/box-overlay.scss +45 -0
  15. package/build/primer/box/index.scss +2 -0
  16. package/build/primer/branch-name/README.md +20 -0
  17. package/build/primer/branch-name/branch-name.scss +33 -0
  18. package/build/primer/branch-name/index.scss +3 -0
  19. package/build/primer/buttons/README.md +20 -0
  20. package/build/primer/buttons/button-group.scss +104 -0
  21. package/build/primer/buttons/button.scss +347 -0
  22. package/build/primer/buttons/index.scss +4 -0
  23. package/build/primer/buttons/misc.scss +244 -0
  24. package/build/primer/color-modes/themes/dark.scss +1 -1
  25. package/build/primer/color-modes/themes/dark_colorblind.scss +1 -1
  26. package/build/primer/color-modes/themes/dark_dimmed.scss +1 -1
  27. package/build/primer/color-modes/themes/dark_high_contrast.scss +1 -1
  28. package/build/primer/color-modes/themes/dark_tritanopia.scss +1 -1
  29. package/build/primer/color-modes/themes/light.scss +1 -1
  30. package/build/primer/color-modes/themes/light_colorblind.scss +1 -1
  31. package/build/primer/color-modes/themes/light_high_contrast.scss +1 -1
  32. package/build/primer/color-modes/themes/light_tritanopia.scss +1 -1
  33. package/build/primer/core/README.md +20 -0
  34. package/build/primer/core/index.scss +18 -0
  35. package/build/primer/docs.scss +7 -0
  36. package/build/primer/forms/README.md +20 -0
  37. package/build/primer/forms/form-control.scss +286 -0
  38. package/build/primer/forms/form-group.scss +297 -0
  39. package/build/primer/forms/form-select.scss +47 -0
  40. package/build/primer/forms/index.scss +6 -0
  41. package/build/primer/forms/input-group.scss +81 -0
  42. package/build/primer/forms/radio-group.scss +68 -0
  43. package/build/primer/header/README.md +20 -0
  44. package/build/primer/header/header.scss +51 -0
  45. package/build/primer/header/index.scss +2 -0
  46. package/build/primer/index.scss +8 -3
  47. package/build/primer/labels/README.md +20 -0
  48. package/build/primer/labels/index.scss +3 -0
  49. package/build/primer/labels/issue-labels.scss +26 -0
  50. package/build/primer/labels/mixins.scss +44 -0
  51. package/build/primer/layout/README.md +20 -0
  52. package/build/primer/layout/app-frame.scss +156 -0
  53. package/build/primer/layout/container.scss +30 -0
  54. package/build/primer/layout/grid-offset.scss +19 -0
  55. package/build/primer/layout/grid.scss +77 -0
  56. package/build/primer/layout/index.scss +7 -0
  57. package/build/primer/layout/page-layout.scss +417 -0
  58. package/build/primer/layout/stack.scss +220 -0
  59. package/build/primer/loaders/README.md +20 -0
  60. package/build/primer/loaders/index.scss +2 -0
  61. package/build/primer/loaders/loaders.scss +19 -0
  62. package/build/primer/markdown/README.md +20 -0
  63. package/build/primer/markdown/blob-csv.scss +32 -0
  64. package/build/primer/markdown/code.scss +79 -0
  65. package/build/primer/markdown/footnotes.scss +59 -0
  66. package/build/primer/markdown/headings.scss +101 -0
  67. package/build/primer/markdown/images.scss +130 -0
  68. package/build/primer/markdown/index.scss +9 -0
  69. package/build/primer/markdown/lists.scss +101 -0
  70. package/build/primer/markdown/markdown-body.scss +101 -0
  71. package/build/primer/markdown/tables.scss +46 -0
  72. package/build/primer/marketing/README.md +20 -0
  73. package/build/primer/marketing/buttons/button.scss +171 -0
  74. package/build/primer/marketing/buttons/index.scss +3 -0
  75. package/build/primer/marketing/index.scss +8 -0
  76. package/build/primer/marketing/links/index.scss +3 -0
  77. package/build/primer/marketing/links/link.scss +51 -0
  78. package/build/primer/marketing/support/index.scss +2 -0
  79. package/build/primer/marketing/support/variables.scss +140 -0
  80. package/build/primer/marketing/type/index.scss +3 -0
  81. package/build/primer/marketing/type/typography.scss +140 -0
  82. package/build/primer/marketing/utilities/animations.scss +52 -0
  83. package/build/primer/marketing/utilities/borders.scss +4 -0
  84. package/build/primer/marketing/utilities/filters.scss +3 -0
  85. package/build/primer/marketing/utilities/index.scss +6 -0
  86. package/build/primer/marketing/utilities/layout.scss +58 -0
  87. package/build/primer/navigation/README.md +20 -0
  88. package/build/primer/navigation/filter-list.scss +86 -0
  89. package/build/primer/navigation/index.scss +5 -0
  90. package/build/primer/navigation/sidenav.scss +102 -0
  91. package/build/primer/navigation/subnav.scss +154 -0
  92. package/build/primer/pagination/README.md +20 -0
  93. package/build/primer/pagination/index.scss +3 -0
  94. package/build/primer/pagination/pagination.scss +157 -0
  95. package/build/primer/primitives/index.scss +8 -19
  96. package/build/primer/primitives/temp-typography-tokens.scss +22 -0
  97. package/build/primer/product/README.md +20 -0
  98. package/build/primer/product/index.scss +13 -0
  99. package/build/primer/select-menu/README.md +20 -0
  100. package/build/primer/select-menu/index.scss +3 -0
  101. package/build/primer/select-menu/select-menu.scss +486 -0
  102. package/build/primer/support/README.md +20 -0
  103. package/build/primer/support/mixins/layout.scss +1 -1
  104. package/build/primer/support/mixins/misc.scss +2 -0
  105. package/build/primer/support/mixins/typography.scss +0 -2
  106. package/build/primer/support/variables/typography.scss +1 -1
  107. package/build/primer/table-object/index.scss +1 -0
  108. package/build/primer/table-object/table-object.scss +23 -0
  109. package/build/primer/toasts/README.md +20 -0
  110. package/build/primer/toasts/index.scss +2 -0
  111. package/build/primer/toasts/toasts.scss +129 -0
  112. package/build/primer/tooltips/README.md +20 -0
  113. package/build/primer/tooltips/index.scss +2 -0
  114. package/build/primer/tooltips/tooltips.scss +228 -0
  115. package/build/primer/utilities/README.md +20 -0
  116. package/build/primer/utilities/borders.scss +12 -3
  117. package/build/primer/utilities/box-shadow.scss +0 -2
  118. package/build/primer/utilities/colors.scss +0 -1
  119. package/build/primer/utilities/details.scss +1 -1
  120. package/build/primer/utilities/flexbox.scss +2 -1
  121. package/build/primer/utilities/layout.scss +2 -2
  122. package/build/primer/utilities/margin.scss +2 -3
  123. package/build/primer/utilities/padding.scss +2 -3
  124. package/build/primer/utilities/typography.scss +4 -3
  125. package/build/primer/utilities/visibility-display.scss +2 -1
  126. package/package.json +2 -2
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 MTS.
3
+ Copyright (c) 2025 MTS.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,20 @@
1
+ ---
2
+ bundle: "autocomplete"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `autocomplete` bundle
7
+
8
+ ## Usage
9
+
10
+ Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
11
+
12
+ ```scss
13
+ @import "@primer/css/autocomplete/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/autocomplete.css`.
19
+
20
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -0,0 +1,3 @@
1
+ // support files
2
+ @import '../support/index.scss';
3
+ @import './suggester.scss';
@@ -0,0 +1,101 @@
1
+ // Needs refactoring
2
+ // stylelint-disable selector-max-type, selector-no-qualifying-type
3
+
4
+ .suggester {
5
+ position: relative;
6
+ top: 0;
7
+ left: 0;
8
+ min-width: 180px;
9
+ padding: 0;
10
+ margin: 0;
11
+ margin-top: var(--base-size-24);
12
+ list-style: none;
13
+ cursor: pointer;
14
+ background: var(--overlay-bgColor, var(--color-canvas-overlay));
15
+ // stylelint-disable-next-line primer/borders, primer/colors
16
+ border: $border-width $border-style var(--borderColor-default, var(--color-border-default));
17
+ // stylelint-disable-next-line primer/borders
18
+ border-radius: $border-radius;
19
+ box-shadow: var(--shadow-resting-medium, var(--color-shadow-medium));
20
+
21
+ li {
22
+ display: block;
23
+ padding: var(--base-size-4) var(--base-size-8);
24
+ // stylelint-disable-next-line primer/typography
25
+ font-weight: $font-weight-semibold;
26
+ // stylelint-disable-next-line primer/borders, primer/colors
27
+ border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
28
+
29
+ small {
30
+ // stylelint-disable-next-line primer/typography
31
+ font-weight: $font-weight-normal;
32
+ color: var(--fgColor-muted, var(--color-fg-muted));
33
+ }
34
+
35
+ &:last-child {
36
+ border-bottom: 0;
37
+ // stylelint-disable-next-line primer/borders
38
+ border-bottom-right-radius: $border-radius;
39
+ // stylelint-disable-next-line primer/borders
40
+ border-bottom-left-radius: $border-radius;
41
+ }
42
+
43
+ &:first-child {
44
+ // stylelint-disable-next-line primer/borders
45
+ border-top-left-radius: $border-radius;
46
+ // stylelint-disable-next-line primer/borders
47
+ border-top-right-radius: $border-radius;
48
+ }
49
+
50
+ &:hover {
51
+ color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));
52
+ text-decoration: none;
53
+ background: var(--bgColor-accent-emphasis, var(--color-accent-emphasis));
54
+
55
+ small {
56
+ color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));
57
+ }
58
+
59
+ .octicon {
60
+ color: inherit !important;
61
+ }
62
+ }
63
+
64
+ &[aria-selected='true'],
65
+ &.navigation-focus {
66
+ color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));
67
+ text-decoration: none;
68
+ background: var(--bgColor-accent-emphasis, var(--color-accent-emphasis));
69
+
70
+ small {
71
+ color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));
72
+ }
73
+
74
+ .octicon {
75
+ color: inherit !important;
76
+ }
77
+ }
78
+ }
79
+ }
80
+
81
+ .suggester-container {
82
+ position: absolute;
83
+ top: 0;
84
+ left: 0;
85
+ z-index: 30;
86
+ }
87
+
88
+ // Responsive
89
+
90
+ .page-responsive {
91
+ @media (max-width: $width-sm) {
92
+ .suggester-container {
93
+ right: var(--base-size-8) !important;
94
+ left: var(--base-size-8) !important;
95
+ }
96
+
97
+ .suggester li {
98
+ padding: var(--base-size-8) var(--base-size-16);
99
+ }
100
+ }
101
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ bundle: "avatars"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `avatars` bundle
7
+
8
+ ## Usage
9
+
10
+ Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
11
+
12
+ ```scss
13
+ @import "@primer/css/avatars/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/avatars.css`.
19
+
20
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -0,0 +1,17 @@
1
+ // .avatar-parent-child is when you see a small avatar at the bottom right
2
+ // corner of a larger avatar.
3
+ //
4
+ // No Styleguide version
5
+ .avatar-parent-child {
6
+ position: relative;
7
+ }
8
+
9
+ .avatar-child {
10
+ position: absolute;
11
+ right: -15%;
12
+ bottom: -9%;
13
+ background-color: var(--bgColor-default, var(--color-canvas-default)); // For transparent backgrounds
14
+ // stylelint-disable-next-line primer/borders
15
+ border-radius: $border-radius-1;
16
+ box-shadow: var(--avatar-shadow, var(--color-avatar-child-shadow));
17
+ }
@@ -0,0 +1,55 @@
1
+ // Circle badge icon with drop shadow for icons and logos
2
+
3
+ .CircleBadge {
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ background-color: var(--bgColor-default, var(--color-canvas-default));
8
+ border-radius: 50%;
9
+ box-shadow: var(--shadow-resting-medium, var(--color-shadow-medium));
10
+ }
11
+
12
+ .CircleBadge-icon {
13
+ max-width: 60% !important;
14
+ height: auto !important;
15
+ max-height: 55% !important;
16
+ }
17
+
18
+ // Small badge
19
+ .CircleBadge--small {
20
+ width: 56px;
21
+ height: 56px;
22
+ }
23
+
24
+ // Medium badge
25
+ .CircleBadge--medium {
26
+ width: 96px;
27
+ height: 96px;
28
+ }
29
+
30
+ // Large badge
31
+ .CircleBadge--large {
32
+ width: 128px;
33
+ height: 128px;
34
+ }
35
+
36
+ // Dashed line that connects badges..
37
+ // Wrap around 2 or more badges to create a horizonal line:
38
+
39
+ .DashedConnection {
40
+ position: relative;
41
+
42
+ &::before {
43
+ position: absolute;
44
+ top: 50%;
45
+ left: 0;
46
+ width: 100%;
47
+ content: '';
48
+ // stylelint-disable-next-line primer/borders
49
+ border-bottom: 2px dashed var(--borderColor-default, var(--color-border-default));
50
+ }
51
+
52
+ .CircleBadge {
53
+ position: relative;
54
+ }
55
+ }
@@ -0,0 +1,5 @@
1
+ @import '../support/index.scss';
2
+
3
+ // Avatars
4
+ @import './avatar-parent-child.scss';
5
+ @import './circle-badge.scss';
@@ -0,0 +1,20 @@
1
+ ---
2
+ bundle: "base"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `base` bundle
7
+
8
+ ## Usage
9
+
10
+ Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
11
+
12
+ ```scss
13
+ @import "@primer/css/base/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/base.css`.
19
+
20
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -1,7 +1,3 @@
1
- @import "../support/mixins/misc.scss";
2
- @import "../support/variables/typography.scss";
3
- @import "../support/variables/misc.scss";
4
-
5
1
  // stylelint-disable selector-max-type, selector-no-qualifying-type, primer/typography
6
2
  * {
7
3
  box-sizing: border-box;
@@ -19,6 +15,7 @@ button {
19
15
  body {
20
16
  font-family: $body-font;
21
17
  font-size: var(--body-font-size, $body-font-size);
18
+ font-weight: var(--base-text-weight-normal, 400);
22
19
  line-height: $body-line-height;
23
20
  color: var(--fgColor-default, var(--color-fg-default));
24
21
  background-color: var(--bgColor-default, var(--color-canvas-default));
@@ -65,7 +62,7 @@ hr,
65
62
  overflow: hidden;
66
63
  background: transparent;
67
64
  border: 0;
68
- // stylelint-disable-next-line primer/borders
65
+ // stylelint-disable-next-line primer/borders, primer/colors
69
66
  border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
70
67
 
71
68
  @include clearfix();
@@ -1,21 +1,17 @@
1
- @import "../support/variables/layout.scss";
2
- @import "../support/variables/typography.scss";
3
- @import "../support/variables/misc.scss";
4
-
5
1
  // Keyboard shortcuts
6
2
  // stylelint-disable selector-max-type
7
3
 
8
4
  kbd {
9
5
  display: inline-block;
10
6
  padding: var(--base-size-4);
11
- // stylelint-disable-next-line primer/typography
7
+ // stylelint-disable-next-line primer/typography, declaration-property-value-no-unknown
12
8
  font: 11px $mono-font;
13
9
  // stylelint-disable-next-line primer/typography
14
10
  line-height: 10px;
15
11
  color: var(--fgColor-default, var(--color-fg-default));
16
12
  vertical-align: middle;
17
13
  background-color: var(--bgColor-muted, var(--color-canvas-subtle));
18
- // stylelint-disable-next-line primer/borders
14
+ // stylelint-disable-next-line primer/borders, primer/colors
19
15
  border: $border-style $border-width var(--borderColor-neutral-muted, var(--color-neutral-muted));
20
16
  border-bottom-color: var(--borderColor-neutral-muted, var(--color-neutral-muted));
21
17
  // stylelint-disable-next-line primer/borders
@@ -1,6 +1,3 @@
1
- @import "../support/variables/typography.scss";
2
- @import "../support/mixins/typography.scss";
3
-
4
1
  // Headings
5
2
  // --------------------------------------------------
6
3
  // stylelint-disable selector-max-type
@@ -0,0 +1,20 @@
1
+ ---
2
+ bundle: "box"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `box` bundle
7
+
8
+ ## Usage
9
+
10
+ Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
11
+
12
+ ```scss
13
+ @import "@primer/css/box/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/box.css`.
19
+
20
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -0,0 +1,45 @@
1
+ .Box--overlay {
2
+ // stylelint-disable-next-line primer/responsive-widths
3
+ width: 448px;
4
+ margin-right: auto;
5
+ margin-left: auto;
6
+ background-color: var(--bgColor-default, var(--color-canvas-default));
7
+ background-clip: padding-box;
8
+ border-color: var(--borderColor-default, var(--color-border-default));
9
+ // stylelint-disable-next-line primer/box-shadow
10
+ box-shadow: 0 0 18px rgba(0, 0, 0, 0.4);
11
+
12
+ .Box-header {
13
+ margin: 0;
14
+ border-width: 0;
15
+ // stylelint-disable-next-line primer/borders
16
+ border-bottom-width: $border-width;
17
+ // stylelint-disable-next-line primer/borders
18
+ border-top-left-radius: $border-radius;
19
+ // stylelint-disable-next-line primer/borders
20
+ border-top-right-radius: $border-radius;
21
+ }
22
+ }
23
+
24
+ .Box-overlay--narrow {
25
+ width: 320px;
26
+ }
27
+
28
+ .Box-overlay--wide {
29
+ // stylelint-disable-next-line primer/responsive-widths
30
+ width: 640px;
31
+ }
32
+
33
+ .Box-body {
34
+ &.scrollable-overlay {
35
+ max-height: 400px;
36
+ overflow-y: scroll;
37
+ }
38
+
39
+ .help {
40
+ padding-top: var(--base-size-8);
41
+ margin: 0;
42
+ color: var(--fgColor-muted, var(--color-fg-muted));
43
+ text-align: center;
44
+ }
45
+ }
@@ -0,0 +1,2 @@
1
+ @import '../support/index.scss';
2
+ @import './box-overlay.scss';
@@ -0,0 +1,20 @@
1
+ ---
2
+ bundle: "branch-name"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `branch-name` bundle
7
+
8
+ ## Usage
9
+
10
+ Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
11
+
12
+ ```scss
13
+ @import "@primer/css/branch-name/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/branch-name.css`.
19
+
20
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -0,0 +1,33 @@
1
+ // stylelint-disable selector-max-type, selector-no-qualifying-type
2
+
3
+ // A nice way to display branch names inside the UI. Can be a link or not.
4
+
5
+ .branch-name {
6
+ display: inline-block;
7
+ // stylelint-disable-next-line primer/spacing
8
+ padding: 2px 6px;
9
+ // stylelint-disable-next-line primer/typography, declaration-property-value-no-unknown
10
+ font: 12px $mono-font;
11
+ color: var(--fgColor-muted, var(--color-fg-muted));
12
+ word-break: break-all;
13
+ background-color: var(--bgColor-accent-muted, var(--color-accent-subtle));
14
+ // stylelint-disable-next-line primer/borders
15
+ border-radius: $border-radius;
16
+
17
+ .octicon {
18
+ // stylelint-disable-next-line primer/spacing
19
+ margin: 1px -2px 0 0;
20
+ color: var(--fgColor-muted, var(--color-fg-muted));
21
+ }
22
+ }
23
+
24
+ // When a branch name is a link
25
+
26
+ a.branch-name {
27
+ color: var(--fgColor-accent, var(--color-accent-fg));
28
+ background-color: var(--bgColor-accent-muted, var(--color-accent-subtle));
29
+
30
+ .octicon {
31
+ color: var(--fgColor-accent, var(--color-accent-fg));
32
+ }
33
+ }
@@ -0,0 +1,3 @@
1
+ // support files
2
+ @import '../support/index.scss';
3
+ @import './branch-name.scss';
@@ -0,0 +1,20 @@
1
+ ---
2
+ bundle: "buttons"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `buttons` bundle
7
+
8
+ ## Usage
9
+
10
+ Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
11
+
12
+ ```scss
13
+ @import "@primer/css/buttons/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/buttons.css`.
19
+
20
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -0,0 +1,104 @@
1
+ // Button group
2
+ //
3
+ // A button group is a series of buttons laid out next to each other, all part
4
+ // of one visual button, but separated by rules to be separate.
5
+
6
+ .BtnGroup {
7
+ display: inline-block;
8
+ vertical-align: middle;
9
+
10
+ @include clearfix();
11
+
12
+ // Proper spacing for multiple button groups (a la, gollum editor)
13
+ + .BtnGroup,
14
+ + .btn {
15
+ margin-left: var(--base-size-4);
16
+ }
17
+ }
18
+
19
+ .BtnGroup-item {
20
+ position: relative;
21
+ float: left;
22
+ border-right-width: 0;
23
+ border-radius: 0;
24
+
25
+ &:first-child {
26
+ // stylelint-disable-next-line primer/borders
27
+ border-top-left-radius: $border-radius;
28
+ // stylelint-disable-next-line primer/borders
29
+ border-bottom-left-radius: $border-radius;
30
+ }
31
+
32
+ &:last-child {
33
+ // stylelint-disable-next-line primer/borders
34
+ border-right-width: $border-width;
35
+ // stylelint-disable-next-line primer/borders
36
+ border-top-right-radius: $border-radius;
37
+ // stylelint-disable-next-line primer/borders
38
+ border-bottom-right-radius: $border-radius;
39
+ }
40
+
41
+ &.selected,
42
+ &[aria-selected='true'],
43
+ &:focus,
44
+ &:active,
45
+ &:hover {
46
+ // stylelint-disable-next-line primer/borders
47
+ border-right-width: $border-width;
48
+
49
+ + .BtnGroup-item,
50
+ + .BtnGroup-parent .BtnGroup-item {
51
+ border-left-width: 0;
52
+ }
53
+ }
54
+ }
55
+
56
+ .BtnGroup-parent {
57
+ float: left;
58
+
59
+ &:first-child .BtnGroup-item {
60
+ // stylelint-disable-next-line primer/borders
61
+ border-top-left-radius: $border-radius;
62
+ // stylelint-disable-next-line primer/borders
63
+ border-bottom-left-radius: $border-radius;
64
+ }
65
+
66
+ &:last-child .BtnGroup-item {
67
+ // stylelint-disable-next-line primer/borders
68
+ border-right-width: $border-width;
69
+ // stylelint-disable-next-line primer/borders
70
+ border-top-right-radius: $border-radius;
71
+ // stylelint-disable-next-line primer/borders
72
+ border-bottom-right-radius: $border-radius;
73
+ }
74
+
75
+ .BtnGroup-item {
76
+ border-right-width: 0;
77
+ border-radius: 0;
78
+ }
79
+
80
+ &.selected,
81
+ &[aria-selected='true'],
82
+ &:focus,
83
+ &:active,
84
+ &:hover {
85
+ .BtnGroup-item {
86
+ // stylelint-disable-next-line primer/borders
87
+ border-right-width: $border-width;
88
+ }
89
+
90
+ + .BtnGroup-item,
91
+ + .BtnGroup-parent .BtnGroup-item {
92
+ border-left-width: 0;
93
+ }
94
+ }
95
+ }
96
+
97
+ // ensure that the focus ring sits above the adjacent buttons
98
+ .BtnGroup-item,
99
+ .BtnGroup-parent {
100
+ &:focus,
101
+ &:active {
102
+ z-index: 1;
103
+ }
104
+ }