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

Add styles for callouts to match notice blocks #429

Merged
merged 3 commits into from
Dec 13, 2023

Conversation

adamwoodnz
Copy link
Contributor

@adamwoodnz adamwoodnz commented Dec 13, 2023

Fixes #428

Adds styles matching the mu-plugins notice block as a temporary fix until we can support GitHub markdown.

Removing these old styles also means we can remove the dashicons style dependency unless we're on the dashicons page or the Code Comment bloc is rendered. The dashicon styles are already loaded if logged in.

Screenshots

Before After
Screenshot 2023-12-13 at 2 05 45 PM Screenshot 2023-12-13 at 2 05 28 PM

Testing

Callouts

Visit pages using callout markup:
http://localhost:8888/block-editor/contributors/documentation/#callout-notices
http://localhost:8888/block-editor/getting-started/devenv/
http://localhost:8888/block-editor/getting-started/devenv/get-started-with-wp-env/

Check that callouts match the design.

Dashicons

Visit the homepage and check that dashicons.css and editor.css are not loaded.

Visit http://localhost:8888/resource/dashicons/ and check that dashicons.css is loaded and the icons are displayed as expected.

Visit http://localhost:8888/reference/classes/wp_query/ and check that editor.css and dashicons.css are loaded. There was a bug with editor and dashicons styles not loading when there are multiple comment forms loaded. Test the link button in the comment rich text editor, it should open a modal. Check that this still works with 1 comment and multiple.

Without the old callouts we only need dashicons for the dashicons page, or if the Code Comments block is rendered
@adamwoodnz adamwoodnz mentioned this pull request Dec 13, 2023
Copy link
Contributor

@renintw renintw left a comment

Choose a reason for hiding this comment

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

Tested and all look as described 👍

Except for a couple of minor things:

Saw that either in
https://www.figma.com/file/2WxlJFzMJvqPfZL1EkAOVp/Developer-Resources?type=design&node-id=3735-20039&mode=design&t=hFLJ9Js5ydN24rhe-0
or
https://www.figma.com/file/HOJTpCFfa3tR0EccUlu0CM/WordPress.org-Design-Library?type=design&node-id=1264-4116&mode=design&t=X6mkiADJtXl6S0GO-0
the font size for callout content is 14px.

--

And I still can see dashicons.css being loaded on the homepage. editor.css indeed isn't loaded.
image
image

Not really a blocker IMO.

@ndiego
Copy link
Member

ndiego commented Dec 13, 2023

the font size for callout content is 14px.

Yeah, I think the font-size should be set to --wp--preset--font-size--small.

And I still can see dashicons.css being loaded on the homepage. editor.css indeed isn't loaded.

I think dashicons are always loaded by default on WP sites, so might just be that.

Looking great though! 🙌

@adamwoodnz
Copy link
Contributor Author

And I still can see dashicons.css being loaded on the homepage. editor.css indeed isn't loaded.

Yeah could be a couple of reasons for this; it's loaded if you're logged in (for the admin bar), and frontend loading seems to have changed in WP recently, as we had to patch some sites to force load it, so it could depend on your WP version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Style callouts
3 participants