Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try/admin color lighten colors #58481

Closed
wants to merge 2 commits into from
Closed
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
@@ -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.
Copy link
Member Author

@ramonjd ramonjd Jan 31, 2024

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%))};
Original file line number Diff line number Diff line change
@@ -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;
}

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
@@ -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);
@@ -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);
}
}

4 changes: 2 additions & 2 deletions packages/components/src/button/style.scss
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions packages/dataviews/src/style.scss
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
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
@@ -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);
@@ -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;
@@ -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 {
Original file line number Diff line number Diff line change
@@ -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);
}
@@ -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;

Unchanged files with check annotations Beta

} ) => {
const el = page.getByTestId( 'island inside another island' );
const templates = el.locator( 'template' );
expect( await templates.count() ).toEqual( 1 );

Check failure on line 47 in test/e2e/specs/interactivity/tovdom-islands.spec.ts

GitHub Actions / Playwright - 7

[chromium] › interactivity/tovdom-islands.spec.ts:42:6 › toVdom - islands › directives inside islands should not be hydrated twice

1) [chromium] › interactivity/tovdom-islands.spec.ts:42:6 › toVdom - islands › directives inside islands should not be hydrated twice Error: expect(received).toEqual(expected) // deep equality Expected: 1 Received: 0 45 | const el = page.getByTestId( 'island inside another island' ); 46 | const templates = el.locator( 'template' ); > 47 | expect( await templates.count() ).toEqual( 1 ); | ^ 48 | } ); 49 | 50 | test( 'islands inside inner blocks of isolated islands should be hydrated', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/tovdom-islands.spec.ts:47:37
} );
test( 'islands inside inner blocks of isolated islands should be hydrated', async ( {