-
Notifications
You must be signed in to change notification settings - Fork 853
Newsletter: bundle DataViews CSS to fix missing design tokens #46877
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
base: trunk
Are you sure you want to change the base?
Conversation
The DataForm component from @wordpress/dataviews expects CSS variables like --wpds-dimension-gap-md to be defined. These come from the package's stylesheet which wasn't being loaded. Import the dataviews styles via SCSS to bundle them with our assets, ensuring the CSS version matches the JS package version we're using. This made "Manage all subscribers" look far too spaced out, so addressed that too.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes missing CSS design tokens for the DataViews DataForm component in the newsletter settings by importing the required stylesheet. The DataForm component depends on CSS variables (like --wpds-dimension-gap-md) that were not being loaded, causing styling issues.
Changes:
- Import DataViews stylesheet to bundle design tokens with newsletter settings assets
- Remove excessive spacing from "Manage all subscribers" link by removing CSS class
- Add changelog entry documenting the CSS fix
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| projects/packages/newsletter/src/settings/style.scss | Adds import statement for @wordpress/dataviews styles to ensure design tokens are available |
| projects/packages/newsletter/src/settings/sections/newsletter-section.tsx | Removes newsletter-settings__link CSS class from wrapper div to reduce spacing |
| projects/packages/newsletter/changelog/fix-some-css | Adds changelog entry for the CSS fix |
| /> | ||
| { data.subscriptions && jetpackSettings && ( | ||
| <div className="newsletter-settings__link"> | ||
| <div> |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSS class "newsletter-settings__link" should not be removed here. This class is still defined in style.scss (line 59-61) with "margin-top: 2em" styling and is actively used in newsletter-categories-section.tsx (line 208). Removing it here creates an inconsistency in the codebase where the same pattern is styled differently in different sections.
If the excessive spacing is an issue, consider either:
- Keeping the class here and adjusting the margin-top value in the CSS definition to be less (e.g., 1em)
- Removing the CSS class definition entirely and updating all usages throughout the codebase
The current change creates inconsistent spacing between this section and the newsletter categories section.
| <div> | |
| <div className="newsletter-settings__link"> |
| Significance: patch | ||
| Type: changed | ||
|
|
||
| CSS: Ensure dataforms css is loaded. |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog entry does not follow the project's changelog conventions. Based on the custom coding guidelines and examples from other changelog entries in the codebase, changelog entries should:
- Use imperative mood (e.g., "Fix" instead of "Ensure")
- Start with a capital letter and end with a period
- Describe the change from a user's perspective
This entry should be rewritten to something like: "Fix missing design tokens in DataForm component."
| Significance: patch | ||
| Type: changed | ||
|
|
||
| CSS: Ensure dataforms css is loaded. |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog entry contains a spelling/grammar error. "dataforms" should be two separate words: "DataForm". Additionally, "css" should be capitalized as "CSS" since it's an acronym.
| CSS: Ensure dataforms css is loaded. | |
| CSS: Ensure DataForm CSS is loaded. |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
| @@ -1,3 +1,6 @@ | |||
| // Import dataviews styles for DataForm component | |||
| @import "@wordpress/dataviews/build-style/style.css"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the right way to go about this would be using the Theme provider; not the DataViews CSS; https://wordpress.github.io/gutenberg/?path=/docs/design-system-theme-theme-provider--docs
Even if DataViews has the style tokens now, it might not have them in future. See comments from Andrew at p1769436406520009/1768821189.724639-slack-C052XEUUBL4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...or did you need all the DataForm styles themselves, not just style tokens? In that case this might be correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter. The original issue was that the DataForm component's own layout was using gap: var(--wpds-dimension-gap-md) and that wasn't defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes https://linear.app/a8c/issue/DOTCOM-15924/fix-missing-css
Proposed changes:
The DataForm component from @wordpress/dataviews expects CSS variables like --wpds-dimension-gap-md to be defined. These come from the package's stylesheet which wasn't being loaded.
Import the dataviews styles via SCSS to bundle them with our assets, ensuring the CSS version matches the JS package version we're using.
This made "Manage all subscribers" look far too spaced out, so addressed that too.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: