Skip to content

Commit

Permalink
Prefer currentColor over base/contrast color defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrtashjian committed May 24, 2023
1 parent d785392 commit 195979a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
1 change: 1 addition & 0 deletions packages/block-library/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
gap: 0.5em;
word-break: normal;
box-sizing: border-box;
border-color: currentcolor;

@include focus-styles;

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/input/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ input[type="radio"].wp-block-omniform-input:checked {
height: auto;
width: auto;
margin: 0;
background-color: #{$contrast-color};
background-color: currentcolor;
}

&:checked::before {
Expand Down
28 changes: 3 additions & 25 deletions packages/block-library/shared/mixins.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/**
* Color fallback chain:
*
* BASE:
* 1. --wp--preset--color--base
* 2. --wp--preset--color--background
* 3. transparent
*
* CONTRAST:
* 1. --wp--preset--color--contrast
* 2. --wp--preset--color--foreground
* 3. currentColor
*/

$base-color: var(--wp--preset--color--base, var(--wp--preset--color--background, transparent));
$contrast-color: var(--wp--preset--color--contrast, var(--wp--preset--color--foreground, currentColor));

@mixin field-label {

.omniform-field-label,
Expand Down Expand Up @@ -59,7 +42,7 @@ $contrast-color: var(--wp--preset--color--contrast, var(--wp--preset--color--for
outline-offset: -2px;

&:focus {
outline: 2px solid #{$contrast-color};
outline: 2px solid currentcolor;
outline-offset: 2px;
}

Expand All @@ -77,7 +60,7 @@ $contrast-color: var(--wp--preset--color--contrast, var(--wp--preset--color--for
// Base styles for all fields controls.
@mixin field-control {
appearance: none;
background-color: #{$base-color};
background-color: transparent;
border-radius: 0.25em;
border-width: 1px;
border-style: solid;
Expand All @@ -90,12 +73,7 @@ $contrast-color: var(--wp--preset--color--contrast, var(--wp--preset--color--for
min-height: auto;
padding: 0.5em 0.75em;
margin: 0;
color: #{$contrast-color};
color: currentcolor;

@include focus-styles;

&.is-style-inverted {
color: #{$base-color};
background-color: #{$contrast-color};
}
}

0 comments on commit 195979a

Please sign in to comment.