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

Page List: Added color support #66430

Merged

Conversation

benazeer-ben
Copy link
Contributor

@benazeer-ben benazeer-ben commented Oct 24, 2024

What?

Add color support to the Page List block.
Part of : #43245

Why?

Page List block is missing color support.

How?

Adds the color support via block.json

Testing Instructions

  • Go to the Global Styles setting ( under appearance > editor > styles > edit styles > blocks ).
  • Make sure that the Page List block's color is configurable via Global Styles.
  • Verify that Global Styles are applied correctly in the editor and frontend.
  • Edit the template/page, add Page List block and apply the color for background and links.
  • Verify that block color styles take precedence over global block colour settings.
  • Verify that block color display correctly in both the editor and frontend.

Screenshots or screencast

Backend:
pagelistcolorbackend

Frontend:
pagelistcolorfrontend

Copy link

github-actions bot commented Oct 24, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: benazeer-ben <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>
Co-authored-by: shail-mehta <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Oct 24, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @benazeer-ben! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@akasunil akasunil added [Type] Enhancement A suggestion for improvement. [Block] Page List Affects the Page List Block labels Oct 25, 2024
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @benazeer-ben 👍

This is working as advertised.

✅ Global Styles apply correctly in the editor and the frontend
✅ Block support styles override global styles in both editor and frontend

I see you chose to explicitly omit text color support. This might actually be good to add too.

If a link color hasn't been set, applying a text color will automatically set the matching link color. This would allow the page list's bullets to be updated to match link color or differ as the theme author or use might wish.

What do you think?

Without Text Support With Text Support
Screenshot 2024-11-11 at 5 45 28 pm Screenshot 2024-11-11 at 5 45 10 pm

@benazeer-ben
Copy link
Contributor Author

Thanks for the suggestion @aaronrobertshaw

Yes, you are right. If the text support added then we can use it as optional if we need. Otherwise we can just keep the link colour.

I have added text support in the recent commit.

adding default controls

Co-authored-by: Aaron Robertshaw <[email protected]>
@benazeer-ben
Copy link
Contributor Author

@aaronrobertshaw Please let me know if it need more tweaks on this.

Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

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

This is looking good @benazeer-ben

✅ Global styles apply correctly on frontend and in editor
✅ Block support styles override global styles appropriately
✅ Default controls exposed follow convention for color supports

Editor:
Screenshot 2024-11-18 at 6 16 20 pm

Frontend:
Screenshot 2024-11-18 at 6 16 31 pm

Note: For anyone else testing, there's a known issue where a gradient global style would override block instance's background color. That's due to the use of background vs background-color in those styles and isn't introduced here.

@shail-mehta
Copy link
Member

shail-mehta commented Jan 4, 2025

@benazeer-ben Could you Please rebase this PR?

@benazeer-ben
Copy link
Contributor Author

@shail-mehta Thanks for looking into this.

This PR has been rebased with the latest trunk branch.

Copy link
Member

@shail-mehta shail-mehta left a comment

Choose a reason for hiding this comment

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

✅ Global styles apply correctly on frontend and in editor
✅ Block support styles override global styles appropriately

image

@shail-mehta shail-mehta merged commit 9713af9 into WordPress:trunk Jan 6, 2025
61 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.1 milestone Jan 6, 2025
westonruter added a commit that referenced this pull request Jan 7, 2025
…ry/interactivity-lazy-hydration

* 'trunk' of https://github.com/WordPress/gutenberg: (143 commits)
  Update: Bundle upload media. (#68522)
  Add: Media field changing ui to Dataviews and content preview field to posts and pages (#67278)
  Bump the react-native group with 2 updates (#68095)
  Check Storybook build on CI for PRs (#68466)
  Bump the github-actions group across 1 directory with 2 updates (#68436)
  Classic theme preview: remove admin-bar class name (#68519)
  Remove geriux as code owner (#68523)
  Post Featured Image: Adds control to clear the the overlay color (#68525)
  Components: Standardize reduced motion handling using media queries (#68421)
  Upgrade Playwright to v1.49 (#68504)
  Document Outline: Use block client ID as unique 'key' (#68502)
  Storybook: Add UnitControl story (#67346)
  Details: Add allowedBlocks and TemplateLock attributes (#68489)
  Post Comment Link: Show Border Control By Default (#68506)
  Query Total: Show Border Controls By Default (#68507)
  RSS: Added Colour support (#66419)
  Refactor: Separate input form styles to a dedicated stylesheet (#68501)
  Code quality: Fix typos (#67304)
  Page List: Added color support (#66430)
  Fix flaky DataViews list arraow nav e2e tests (#68503)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Page List Affects the Page List Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants