Skip to content

Commit

Permalink
Revert v8 color var fallbacks (#2113)
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron authored and langermank committed Jun 29, 2023
1 parent fe24489 commit 3822319
Show file tree
Hide file tree
Showing 40 changed files with 658 additions and 1,785 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-cats-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Revert v8 color var fallbacks (#2083)
4 changes: 1 addition & 3 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"plugins": ["@primer/stylelint-config/plugins/no-deprecated-colors"],
"ignoreFiles": ["app/**/*.css", "**/*.js", "**/*.ts"],
"rules": {
"custom-property-pattern": null,
Expand All @@ -15,7 +14,6 @@
{
"ignoreAtRules": ["mixin", "define-mixin"]
}
],
"primer/no-deprecated-colors": true
]
}
}
84 changes: 42 additions & 42 deletions app/components/primer/alpha/action_list.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
width: 100%;
height: 1px;
content: '';
background: var(--borderColor-muted);
background: var(--color-action-list-item-inline-divider);
}

/* if descriptionWrap--inline exists, move pseudo divider to wrapper */
Expand All @@ -40,7 +40,7 @@
width: 100%;
height: var(--borderWidth-thin);
content: '';
background: var(--borderColor-muted);
background: var(--color-action-list-item-inline-divider);
}

/* unset the default label pseudo */
Expand Down Expand Up @@ -75,7 +75,7 @@
.ActionListItem {
position: relative;
list-style: none;
background-color: var(--control-transparent-bgColor-rest);
background-color: transparent;
border-radius: var(--borderRadius-medium);

/* state */
Expand Down Expand Up @@ -113,12 +113,12 @@

@media (hover: hover) {
&:hover {
background-color: var(--control-transparent-bgColor-hover);
background-color: var(--color-action-list-item-default-hover-bg);
}
}

&:active {
background-color: var(--control-transparent-bgColor-active);
background-color: var(--color-action-list-item-default-active-bg);
}
}
}
Expand All @@ -130,25 +130,25 @@
@media (hover: hover) {
&:hover {
cursor: pointer;
background-color: var(--control-transparent-bgColor-hover);
background-color: var(--color-action-list-item-default-hover-bg);

&:not(.ActionListItem--navActive, :focus-visible) {
/* Support for "Windows high contrast mode" */
outline: solid var(--borderWidth-thin) transparent;
outline-offset: calc(-1 * var(--borderWidth-thin));
box-shadow: var(--boxShadow-thin) var(--control-transparent-borderColor-active);
box-shadow: var(--boxShadow-thin) var(--color-action-list-item-default-active-border);
}
}
}

&:active {
background: var(--control-transparent-bgColor-active);
background: var(--color-action-list-item-default-active-bg);

&:not(.ActionListItem--navActive) {
/* Support for "Windows high contrast mode" https:sarahmhigley.com/writing/whcm-quick-tips/ */
outline: solid var(--borderWidth-thin) transparent;
outline-offset: calc(-1 * var(--borderWidth-thin));
box-shadow: var(--boxShadow-thin) var(--control-transparent-borderColor-active);
box-shadow: var(--boxShadow-thin) var(--color-action-list-item-default-active-border);
}

& .ActionListItem-label::before,
Expand All @@ -162,11 +162,11 @@

&[aria-selected='true'] {
font-weight: var(--base-text-weight-normal);
background: var(--control-transparent-bgColor-selected);
background: var(--color-action-list-item-default-selected-bg);

@media (hover: hover) {
&:hover {
background-color: var(--control-transparent-bgColor-hover);
background-color: var(--color-action-list-item-default-hover-bg);
}
}

Expand Down Expand Up @@ -195,11 +195,11 @@
}

&:not(.ActionListItem--danger) {
background: var(--control-transparent-bgColor-selected);
background: var(--color-action-list-item-default-selected-bg);

@media (hover: hover) {
&:hover {
background-color: var(--control-transparent-bgColor-hover);
background-color: var(--color-action-list-item-default-hover-bg);
}
}

Expand All @@ -222,11 +222,11 @@
& .ActionListContent {
& .ActionListItem-label,
& .ActionListItem-description {
color: var(--control-fgColor-disabled);
color: var(--color-primer-fg-disabled);
}

& .ActionListItem-visual {
fill: var(--control-fgColor-disabled);
fill: var(--color-primer-fg-disabled);
}
}

Expand All @@ -243,31 +243,31 @@
/* danger */
&.ActionListItem--danger {
& .ActionListItem-label {
color: var(--control-danger-fgColor-rest);
color: var(--color-danger-fg);
}

& .ActionListItem-visual {
color: var(--control-danger-fgColor-rest);
color: var(--color-danger-fg);
}

@media (hover: hover) {
&:hover {
background: var(--control-danger-bgColor-hover);
background: var(--color-action-list-item-danger-hover-bg);

& .ActionListItem-label,
& .ActionListItem-visual {
color: var(--control-danger-fgColor-hover);
color: var(--color-action-list-item-danger-hover-text);
}
}
}

& .ActionListContent {
&:active {
background: var(--control-danger-bgColor-active);
background: var(--color-action-list-item-danger-active-bg);

& .ActionListItem-label,
& .ActionListItem-visual {
color: var(--control-danger-fgColor-hover);
color: var(--color-action-list-item-danger-hover-text);
}
}
}
Expand All @@ -281,7 +281,7 @@
width: 100%;
padding-block: var(--actionListContent-paddingBlock);
padding-inline: var(--control-medium-paddingInline-condensed);
color: var(--control-fgColor-rest);
color: var(--color-fg-default);
text-align: left;
user-select: none;
background-color: transparent;
Expand Down Expand Up @@ -310,11 +310,11 @@
&[aria-disabled='true'] {
& .ActionListItem-label,
& .ActionListItem-description {
color: var(--control-fgColor-disabled);
color: var(--color-primer-fg-disabled);
}

& .ActionListItem-visual {
fill: var(--control-fgColor-disabled);
fill: var(--color-primer-fg-disabled);
}

@media (hover: hover) {
Expand Down Expand Up @@ -399,7 +399,7 @@

/* show active indicator on parent collapse if child is active */
&.ActionListContent--hasActiveSubItem {
background: var(--control-transparent-bgColor-selected);
background: var(--color-action-list-item-default-selected-bg);

& .ActionListItem-label {
font-weight: var(--base-text-weight-semibold);
Expand Down Expand Up @@ -451,13 +451,13 @@
/* checkbox */
& .ActionListItem-multiSelectIcon {
& .ActionListItem-multiSelectIconRect {
fill: var(--control-checked-bgColor-rest);
stroke: var(--control-checked-bgColor-rest);
fill: var(--color-accent-fg);
stroke: var(--color-accent-fg);
stroke-width: var(--borderWidth-thin, 1px);
}

& .ActionListItem-multiSelectCheckmark {
fill: var(--fgColor-onEmphasis);
fill: var(--color-fg-on-emphasis);
}
}
}
Expand Down Expand Up @@ -494,15 +494,15 @@
/* checkbox */
& .ActionListItem-multiSelectIcon {
& .ActionListItem-multiSelectIconRect {
fill: var(--bgColor-default);
stroke: var(--control-borderColor-rest);
fill: var(--color-canvas-default);
stroke: var(--color-border-default);
stroke-width: var(--borderWidth-thin, 1px);
}
}

& .ActionListItem-multiSelectIconRect {
fill: var(--bgColor-default);
border: var(--borderWidth-thin, 1px) solid var(--control-borderColor-rest);
fill: var(--color-canvas-default);
border: var(--borderWidth-thin, 1px) solid var(--color-border-default);
}
}

Expand Down Expand Up @@ -573,7 +573,7 @@
font-size: var(--text-body-size-small);
font-weight: var(--base-text-weight-normal);
line-height: var(--text-body-lineHeight-small);
color: var(--fgColor-muted);
color: var(--color-fg-muted);
}

/* helper for grid alignment with multi-line content
Expand All @@ -582,9 +582,9 @@
.ActionListItem-action {
display: flex;
min-height: var(--control-medium-lineBoxHeight);
color: var(--fgColor-muted);
color: var(--color-fg-muted);
pointer-events: none;
fill: var(--fgColor-muted);
fill: var(--color-fg-muted);
align-items: center;
}

Expand All @@ -594,7 +594,7 @@
font-size: var(--text-body-size-medium);
font-weight: var(--base-text-weight-normal);
line-height: var(--text-body-lineHeight-medium);
color: var(--fgColor-default);
color: var(--color-fg-default);
grid-area: label;
}

Expand Down Expand Up @@ -651,7 +651,7 @@
font-size: var(--text-body-size-small);
line-height: var(--text-body-lineHeight-small);
font-weight: var(--base-text-weight-semibold);
color: var(--fgColor-muted);
color: var(--color-fg-muted);
flex-direction: column;
}

Expand All @@ -664,24 +664,24 @@
margin-block-end: var(--base-size-8);
margin-inline: calc(-1 * var(--base-size-8));
list-style: none;
background: var(--borderColor-muted);
background: var(--color-action-list-item-inline-divider);
border: 0;
}

& .ActionList-sectionDivider-title {
font-size: var(--text-body-size-small);
font-weight: var(--base-text-weight-semibold);
color: var(--fgColor-muted);
color: var(--color-fg-muted);
}
}

.ActionList-sectionDivider--filled {
margin-block-start: calc(var(--base-size-8) - var(--borderWidth-thin));
margin-block-end: var(--base-size-8);
margin-inline: calc(-1 * var(--base-size-8));
background: var(--bgColor-muted);
border-top: solid var(--borderWidth-thin) var(--borderColor-muted);
border-bottom: solid var(--borderWidth-thin) var(--borderColor-muted);
background: var(--color-canvas-subtle);
border-top: solid var(--borderWidth-thin) var(--color-action-list-item-inline-divider);
border-bottom: solid var(--borderWidth-thin) var(--color-action-list-item-inline-divider);

/* if no children, treat as divider */
&:empty {
Expand Down
20 changes: 10 additions & 10 deletions app/components/primer/alpha/auto_complete.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
align-items: center;

&:focus-within {
border-color: var(--borderColor-accent-emphasis);
border-color: var(--color-accent-fg);

@mixin focusBoxShadowInset;
}
Expand Down Expand Up @@ -68,10 +68,10 @@
overflow-y: auto;
font-size: 13px;
list-style: none;
background: var(--overlay-bgColor);
border: var(--borderWidth-thin) solid var(--borderColor-default);
background: var(--color-canvas-overlay);
border: var(--borderWidth-thin) solid var(--color-border-default);
border-radius: var(--borderRadius-medium);
box-shadow: var(--shadow-resting-medium);
box-shadow: var(--color-shadow-medium);
}

/* One of the items that appears within an autocomplete group
Expand All @@ -83,19 +83,19 @@
padding: 4px 8px;
overflow: hidden;
font-weight: var(--base-text-weight-semibold);
color: var(--fgColor-default);
color: var(--color-fg-default);
text-align: left;
text-decoration: none;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
background-color: var(--overlay-bgColor);
background-color: var(--color-canvas-overlay);
border: 0;

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

/* Inherit color on all child elements to ensure enough contrast */
& * {
Expand All @@ -106,9 +106,9 @@
&.selected,
&[aria-selected='true'],
&.navigation-focus {
color: var(--fgColor-onEmphasis);
color: var(--color-fg-on-emphasis);
text-decoration: none;
background-color: var(--bgColor-accent-emphasis);
background-color: var(--color-accent-emphasis);

/* Inherit color on all child elements to ensure enough contrast */
& * {
Expand Down
Loading

0 comments on commit 3822319

Please sign in to comment.