Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/base-styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,14 @@
// Hexadecimal css vars do not work in the rgba function.
--wp-admin-theme-color: #{$color-primary};
--wp-admin-theme-color--rgb: #{hex-to-rgb($color-primary)};

// Lighter shades.

@ramonjd ramonjd Jan 31, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking, the easier path forward would be to use rgba(var(--wp-admin-theme-color--rgb), 0.08) directly.

Example:

  --wp-admin-theme-color-opaque-04:rgba(var(--wp-admin-theme-color--rgb), 0.04);
  --wp-admin-theme-color-opaque-08:rgba(var(--wp-admin-theme-color--rgb), 0.08);

This means no color changes, but the vars are a bit clunky.

--wp-admin-theme-color-lighter-120: #{lighten($color-primary, 61%)};
--wp-admin-theme-color-lighter-120--rgb: #{hex-to-rgb(lighten($color-primary, 61%))};

--wp-admin-theme-color-lighter-125: #{lighten($color-primary, 62%)};
--wp-admin-theme-color-lighter-125--rgb: #{hex-to-rgb(lighten($color-primary, 62%))};

// Darker shades.
--wp-admin-theme-color-darker-10: #{darken($color-primary, 5%)};
--wp-admin-theme-color-darker-10--rgb: #{hex-to-rgb(darken($color-primary, 5%))};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

&:hover:not(.is-dragging-blocks):not(.is-multi-selected)::before {
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-125);
box-shadow: 0 0 0 $border-width var(--wp-admin-theme-color) inset;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/block-editor/src/components/list-view/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
border-bottom-right-radius: $radius-block-ui;
}
&.is-branch-selected:not(.is-selected):not(.is-synced-branch) {
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-125);
}
&.is-synced-branch.is-branch-selected {
background: rgba(var(--wp-block-synced-color--rgb), 0.04);
Expand Down Expand Up @@ -521,14 +521,14 @@ $block-navigation-max-indent: 8;
}

.block-editor-list-view-drop-indicator__line {
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-125);
height: 36px;
border-radius: 4px;
overflow: hidden;
}

.block-editor-list-view-drop-indicator__line--darker {
background: rgba(var(--wp-admin-theme-color--rgb), 0.09);
background: var(--wp-admin-theme-color-lighter-120);
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@
&:hover:not(:disabled, [aria-disabled="true"]) {
// TODO: Prepare for theming (https://github.com/WordPress/gutenberg/pull/45466/files#r1030872724)
/* stylelint-disable-next-line declaration-property-value-disallowed-list */
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-125);
}

&:active:not(:disabled, [aria-disabled="true"]) {
// TODO: Prepare for theming (https://github.com/WordPress/gutenberg/pull/45466/files#r1030872724)
/* stylelint-disable-next-line declaration-property-value-disallowed-list */
background: rgba(var(--wp-admin-theme-color--rgb), 0.08);
background: var(--wp-admin-theme-color-lighter-120);
}

// Pull left if the tertiary button stands alone after a description, so as to vertically align with items above.
Expand Down
4 changes: 2 additions & 2 deletions packages/dataviews/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@
}

&.is-selected {
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background-color: var(--wp-admin-theme-color-lighter-125);
color: $gray-700;

&:hover {
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.08);
background-color: var(--wp-admin-theme-color-lighter-120);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/edit-site/src/components/add-new-template/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}

&:hover {
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-125);

* {
color: var(--wp-admin-theme-color);
Expand Down Expand Up @@ -156,7 +156,7 @@

.edit-site-add-new-template__template-icon {
padding: $grid-unit-10;
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-120);
border-radius: 100%;
max-height: $grid-unit-50;
max-width: $grid-unit-50;
Expand Down Expand Up @@ -186,7 +186,7 @@

&:hover {
color: var(--wp-admin-theme-color-darker-10);
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-120);
border-color: transparent;

span {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
flex-direction: column;

&:hover {
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-125);
.edit-site-global-styles-screen-revisions__date {
color: var(--wp-admin-theme-color);
}
Expand Down Expand Up @@ -50,7 +50,7 @@
outline-offset: -2px;

color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
background: var(--wp-admin-theme-color-lighter-120);

.edit-site-global-styles-screen-revisions__revision-button {
opacity: 1;
Expand Down