Skip to content

Commit

Permalink
Use @primer/primitives v8 colors with fallbacks (#2466)
Browse files Browse the repository at this point in the history
* bump

* run stylelint

* lint

* bump release

* Create tidy-brooms-search.md
  • Loading branch information
langermank authored Jun 21, 2023
1 parent 24c66b5 commit 9204701
Show file tree
Hide file tree
Showing 43 changed files with 428 additions and 417 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-brooms-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": patch
---

Use `@primer/primitives` v8 colors with fallbacks
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@changesets/cli": "2.26.1",
"@csstools/postcss-sass": "5.0.1",
"@github/prettier-config": "0.0.6",
"@primer/stylelint-config": "^12.4.0",
"@primer/stylelint-config": "^12.7.1",
"autoprefixer": "10.4.13",
"chokidar-cli": "3.0.0",
"cssstats": "4.0.5",
Expand Down
22 changes: 11 additions & 11 deletions src/autocomplete/suggester.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
margin-top: $spacer-4;
list-style: none;
cursor: pointer;
background: var(--color-canvas-overlay);
border: $border-width $border-style var(--color-border-default);
background: var(--overlay-bgColor, var(--color-canvas-overlay));
border: $border-width $border-style var(--borderColor-default, var(--color-border-default));
border-radius: $border-radius;
box-shadow: var(--color-shadow-medium);
box-shadow: var(--shadow-resting-medium, var(--color-shadow-medium));

li {
display: block;
padding: $spacer-1 $spacer-2;
font-weight: $font-weight-semibold;
border-bottom: $border-width $border-style var(--color-border-muted);
border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));

small {
font-weight: $font-weight-normal;
color: var(--color-fg-muted);
color: var(--fgColor-muted, var(--color-fg-muted));
}

&:last-child {
Expand All @@ -39,12 +39,12 @@
}

&:hover {
color: var(--color-fg-on-emphasis);
color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));
text-decoration: none;
background: var(--color-accent-emphasis);
background: var(--bgColor-accent-emphasis, var(--color-accent-emphasis));

small {
color: var(--color-fg-on-emphasis);
color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));
}

.octicon {
Expand All @@ -54,12 +54,12 @@

&[aria-selected='true'],
&.navigation-focus {
color: var(--color-fg-on-emphasis);
color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));
text-decoration: none;
background: var(--color-accent-emphasis);
background: var(--bgColor-accent-emphasis, var(--color-accent-emphasis));

small {
color: var(--color-fg-on-emphasis);
color: var(--fgColor-onEmphasis, var(--color-fg-on-emphasis));
}

.octicon {
Expand Down
4 changes: 2 additions & 2 deletions src/avatars/avatar-parent-child.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
position: absolute;
right: -15%;
bottom: -9%;
background-color: var(--color-canvas-default); // For transparent backgrounds
background-color: var(--bgColor-default, var(--color-canvas-default)); // For transparent backgrounds
// stylelint-disable-next-line primer/borders
border-radius: $border-radius-1;
box-shadow: var(--color-avatar-child-shadow);
box-shadow: var(--avatar-shadow, var(--color-avatar-child-shadow));
}
6 changes: 3 additions & 3 deletions src/avatars/circle-badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
display: flex;
align-items: center;
justify-content: center;
background-color: var(--color-canvas-default);
background-color: var(--bgColor-default, var(--color-canvas-default));
border-radius: 50%;
box-shadow: var(--color-shadow-medium);
box-shadow: var(--shadow-resting-medium, var(--color-shadow-medium));
}

.CircleBadge-icon {
Expand Down Expand Up @@ -46,7 +46,7 @@
width: 100%;
content: '';
// stylelint-disable-next-line primer/borders
border-bottom: 2px dashed var(--color-border-default);
border-bottom: 2px dashed var(--borderColor-default, var(--color-border-default));
}

.CircleBadge {
Expand Down
12 changes: 6 additions & 6 deletions src/base/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

*::selection {
background-color: var(--color-accent-subtle);
background-color: var(--bgColor-accent-muted, var(--color-accent-subtle));
}

input,
Expand All @@ -20,12 +20,12 @@ body {
font-family: $body-font;
font-size: var(--body-font-size, $body-font-size);
line-height: $body-line-height;
color: var(--color-fg-default);
background-color: var(--color-canvas-default);
color: var(--fgColor-default, var(--color-fg-default));
background-color: var(--bgColor-default, var(--color-canvas-default));
}

a {
color: var(--color-accent-fg);
color: var(--fgColor-accent, var(--color-accent-fg));
text-decoration: none;

&:hover {
Expand All @@ -50,7 +50,7 @@ label {

// Custom styling for HTML5 validation bubbles (WebKit only)
::placeholder {
color: var(--color-fg-subtle);
color: var(--fgColor-muted, var(--color-fg-subtle));
opacity: 1; // override opacity in normalize.css
}

Expand All @@ -65,7 +65,7 @@ hr,
overflow: hidden;
background: transparent;
border: 0;
border-bottom: $border-width $border-style var(--color-border-muted);
border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));

@include clearfix();
}
Expand Down
10 changes: 5 additions & 5 deletions src/base/kbd.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ kbd {
font: 11px $mono-font;
// stylelint-disable-next-line primer/typography
line-height: 10px;
color: var(--color-fg-default);
color: var(--fgColor-default, var(--color-fg-default));
vertical-align: middle;
background-color: var(--color-canvas-subtle);
background-color: var(--bgColor-muted, var(--color-canvas-subtle));
// stylelint-disable-next-line primer/borders
border: $border-style $border-width var(--color-neutral-muted);
border-bottom-color: var(--color-neutral-muted);
border: $border-style $border-width var(--borderColor-neutral-muted, var(--color-neutral-muted));
border-bottom-color: var(--borderColor-neutral-muted, var(--color-neutral-muted));
border-radius: $border-radius;
// stylelint-disable-next-line primer/box-shadow
box-shadow: inset 0 -1px 0 var(--color-neutral-muted);
box-shadow: inset 0 -1px 0 var(--borderColor-neutral-muted, var(--color-neutral-muted));
}
4 changes: 2 additions & 2 deletions src/base/normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ h1 {
*/

mark {
background-color: var(--color-attention-subtle);
color: var(--color-fg-default);
background-color: var(--bgColor-attention-muted, var(--color-attention-subtle));
color: var(--fgColor-default, var(--color-fg-default));
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/box/box-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
width: 448px;
margin-right: auto;
margin-left: auto;
background-color: var(--color-canvas-default);
background-color: var(--bgColor-default, var(--color-canvas-default));
background-clip: padding-box;
border-color: var(--color-border-default);
border-color: var(--borderColor-default, var(--color-border-default));
// stylelint-disable-next-line primer/box-shadow
box-shadow: 0 0 18px rgba(0, 0, 0, 0.4);

Expand Down Expand Up @@ -36,7 +36,7 @@
.help {
padding-top: $spacer-2;
margin: 0;
color: var(--color-fg-muted);
color: var(--fgColor-muted, var(--color-fg-muted));
text-align: center;
}
}
12 changes: 6 additions & 6 deletions src/branch-name/branch-name.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
// stylelint-disable-next-line primer/spacing
padding: 2px 6px;
font: 12px $mono-font;
color: var(--color-fg-muted);
color: var(--fgColor-muted, var(--color-fg-muted));
word-break: break-all;
background-color: var(--color-accent-subtle);
background-color: var(--bgColor-accent-muted, var(--color-accent-subtle));
border-radius: $border-radius;

.octicon {
// stylelint-disable-next-line primer/spacing
margin: 1px -2px 0 0;
color: var(--color-fg-muted);
color: var(--fgColor-muted, var(--color-fg-muted));
}
}

// When a branch name is a link

a.branch-name {
color: var(--color-accent-fg);
background-color: var(--color-accent-subtle);
color: var(--fgColor-accent, var(--color-accent-fg));
background-color: var(--bgColor-accent-muted, var(--color-accent-subtle));

.octicon {
color: var(--color-accent-fg);
color: var(--fgColor-accent, var(--color-accent-fg));
}
}
Loading

0 comments on commit 9204701

Please sign in to comment.