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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Forms dashboard: reference the new WPDS color token names (--wpds-color-background-*/--wpds-color-foreground-*) with a fallback to the current names, so theming keeps working both before and after the @wordpress/theme 0.16 token rename.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems kind of verbose for end users. What do you think of something like this instead?

Suggested change
Forms dashboard: reference the new WPDS color token names (--wpds-color-background-*/--wpds-color-foreground-*) with a fallback to the current names, so theming keeps working both before and after the @wordpress/theme 0.16 token rename.
Forms dashboard: Improve compatibility with latest Gutenberg theming library.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// Jetpack Forms specific additions (match Inbox).
position: sticky;
left: 0;
background: var(--wpds-color-bg-surface-neutral-strong, #fff);
background: var(--wpds-color-background-surface-neutral-strong, var(--wpds-color-bg-surface-neutral-strong, #fff));
justify-content: space-between;
gap: 8px;
flex-direction: column;
Expand All @@ -52,14 +52,14 @@
button[role="tab"] {
margin: 0;
padding: 12px 0;
color: var(--wpds-color-fg-interactive-neutral);
color: var(--wpds-color-foreground-interactive-neutral, var(--wpds-color-fg-interactive-neutral));

&[data-active="true"] {
color: var(--wpds-color-fg-interactive-neutral-active);
color: var(--wpds-color-foreground-interactive-neutral-active, var(--wpds-color-fg-interactive-neutral-active));
}

&:hover:not([data-active="true"]) {
color: var(--wpds-color-fg-interactive-neutral-active);
color: var(--wpds-color-foreground-interactive-neutral-active, var(--wpds-color-fg-interactive-neutral-active));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

// Individual comment (item)
.jp-forms__feedback-comments-comment {
background-color: var(--jp-forms-white-off, var(--wpds-color-bg-surface-neutral-weak, #e7e7e7));
background-color: var(--jp-forms-white-off, var(--wpds-color-background-surface-neutral-weak, var(--wpds-color-bg-surface-neutral-weak, #e7e7e7)));
border-radius: var(--jp-forms-border-radius, 4px);
padding: 12px;

Expand All @@ -75,7 +75,7 @@
.jp-forms__feedback-comments-comment-author {
font-size: 14px;
font-weight: 600;
color: var(--jp-forms-color-darker-20, var(--wpds-color-fg-content-neutral, #1e1e1e));
color: var(--jp-forms-color-darker-20, var(--wpds-color-foreground-content-neutral, var(--wpds-color-fg-content-neutral, #1e1e1e)));
}

.jp-forms__feedback-comments-comment-date {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

.jp-forms__field-preview-label {
color: var(--wpds-color-fg-content-neutral-weak, #6d6d6d);
color: var(--wpds-color-foreground-content-neutral-weak, var(--wpds-color-fg-content-neutral-weak, #6d6d6d));
font-weight: 300;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body.jetpack_page_jetpack-forms-admin {
height: 100%;
display: flex;
flex-direction: column;
color: var(--wpds-color-fg-content-neutral);
color: var(--wpds-color-foreground-content-neutral, var(--wpds-color-fg-content-neutral));

// Create an separate stacking context for Base UI portal rendering.
// See: https://base-ui.com/react/overview/quick-start#set-up-portals
Expand Down Expand Up @@ -66,8 +66,8 @@ body.jetpack_page_jetpack-forms-admin {
left: 0;
right: 0;
bottom: 0;
color: var(--wpds-color-fg-content-neutral);
background: var(--wpds-color-bg-surface-neutral);
color: var(--wpds-color-foreground-content-neutral, var(--wpds-color-fg-content-neutral));
background: var(--wpds-color-background-surface-neutral, var(--wpds-color-bg-surface-neutral));

&.is-inspector {
z-index: 3; // Medium surface priority
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
}

.admin-ui-page {
color: var(--wpds-color-fg-content-neutral);
background: var(--wpds-color-bg-surface-neutral-strong);
color: var(--wpds-color-foreground-content-neutral, var(--wpds-color-fg-content-neutral));
background: var(--wpds-color-background-surface-neutral-strong, var(--wpds-color-bg-surface-neutral-strong));
height: 100%;
display: flex;
flex-direction: column;
Expand All @@ -29,7 +29,7 @@
padding: variables.$grid-unit-10 variables.$grid-unit * 2.5;
position: sticky;
top: 0;
background: var(--wpds-color-bg-surface-neutral-strong);
background: var(--wpds-color-background-surface-neutral-strong, var(--wpds-color-bg-surface-neutral-strong));
transition: padding ease-out 0.1s;
flex-shrink: 0;
z-index: 10;
Expand All @@ -38,7 +38,7 @@

.admin-ui-page__header-subtitle {
padding-block-end: variables.$grid-unit-10;
color: var(--wpds-color-fg-content-neutral-weak);
color: var(--wpds-color-foreground-content-neutral-weak, var(--wpds-color-fg-content-neutral-weak));

@include mixins.body-medium();
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/forms/src/dashboard/inbox/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
flex-grow: 1;
display: flex;
flex-direction: column;
background-color: var(--wpds-color-bg-surface-neutral-strong, #fff);
background-color: var(--wpds-color-background-surface-neutral-strong, var(--wpds-color-bg-surface-neutral-strong, #fff));
}

/*
Expand Down
17 changes: 17 additions & 0 deletions stylelint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
*/
const config = {
extends: 'jetpack-js-tools/stylelint.config.base.mjs',
overrides: [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if it would be better to put this into a projects/packages/forms/stylelint.config.mjs file instead of the root.

I suppose, if it's really temporary, it doesn't matter much. Don't forget to clean this up though!

{
// Transitional: the Forms dashboard references the @wordpress/theme 0.16
// color token names (--wpds-color-background-*/--wpds-color-foreground-*)
// with a fallback to the current 0.15 names, so theming keeps working both
// before and after the bundled @wordpress/* monorepo bump. The DS-token
// linter only knows one token vocabulary at a time (it reads the installed
// @wordpress/theme via @wordpress/stylelint-config), so it can't validate a
// line that intentionally references both. Disable it for these files until
// the bump (theme 0.16 + @wordpress/stylelint-config 23.41) lands on trunk;
// then this override and the old-name fallbacks can be removed.
files: [ 'projects/packages/forms/src/dashboard/**/*.scss' ],
rules: {
'plugin-wpds/no-unknown-ds-tokens': null,
},
},
],
};

export default config;
Loading