feat(newspack-ui): add stack layout and color utility classes#4600
Open
thomasguillot wants to merge 5 commits intotrunkfrom
Open
feat(newspack-ui): add stack layout and color utility classes#4600thomasguillot wants to merge 5 commits intotrunkfrom
thomasguillot wants to merge 5 commits intotrunkfrom
Conversation
Introduces reusable `newspack-ui__stack` layout primitive and `newspack-ui__color--*` text utilities. Adds missing `--newspack-ui-spacer-1` token. Uses new utilities in the IP access verification page.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds reusable layout/color utility systems to newspack-ui and applies them to the IP access verification loading page to reduce one-off styling.
Changes:
- Add
newspack-ui__stackflexbox “stack” utility with alignment/justification/wrap/gap modifiers. - Add token-driven text color utilities (
newspack-ui__color--{scale}-{step}) and the missing--newspack-ui-spacer-1token. - Refactor the IP access verification page markup/styles to use the new utilities and adjust spinner spacing + image sizing.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/newspack-ui/scss/variables/_spacing.scss | Adds missing --newspack-ui-spacer-1 spacing token. |
| src/newspack-ui/scss/elements/forms/_spinner.scss | Updates spinner gap and refines which <p> gets bold weight. |
| src/newspack-ui/scss/elements/_stack.scss | Introduces stack layout utility classes and child margin suppression rules. |
| src/newspack-ui/scss/elements/_index.scss | Registers new stack and colors element modules. |
| src/newspack-ui/scss/elements/_colors.scss | Introduces token-based text color utility classes. |
| includes/content-gate/class-ip-access-rule.php | Refactors IP check loading page to use stack + color utilities and updates image constraints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Adds reusable utility systems to
newspack-uiand normalises the spacing token/class conventions:newspack-ui__stack): flexbox-based layout component with modifier classes for direction (--vertical,--horizontal), alignment (--align-*), justification (--justify-*), wrapping, and gap (--gap-1through--gap-12).newspack-ui__color--{scale}-{step}): token-driven text color helpers for all defined color scales (neutral, primary, success, error, warning).--newspack-ui-spacer-1token added (8px) to complete the spacing scale; all consumer styles updated from--newspack-ui-spacer-baseto--newspack-ui-spacer-1.newspack-ui__spacing-{side}--{n}) refactored to use a SCSS map loop and switched to index-based suffixes (--1through--12) consistent with the stack and spacer token naming.These utilities are used to clean up the IP access verification page: layout and color are now expressed via composable utility classes instead of one-off inline styles and bespoke class names. The spinner gap and bold-text selector are also refined.
Several of these improvements were highlighted during the review of #4593.
How to test the changes in this Pull Request:
/newspack-access-check) in a browser.n build newspack-plugin) and confirm no compilation errors.--spacing-top--16→--spacing-top--3).Other information: