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

Style nested <ul>s with circles instead of normal bullets #10358

Merged

Conversation

chrisvanpatten
Copy link
Contributor

@chrisvanpatten chrisvanpatten commented Oct 5, 2018

Discovered while working on #10303 that we style nested unordered lists with a normal bullet, instead of circle which is more typical of user agent stylesheets (aka default browser styles).

In the Chrome user agent styles, for instance, you can see the default is overridden:

devtools_-dev_tomodomo_co_wp-admin_post_php_post_78_action_edit_and_edit_page tomodomo _wordpress

This adds a rule to the editor stylesheets to handle nested styles.

Here's the before:

edit_page_ tomodomo _wordpress

And here's the after:

edit_page_ tomodomo _wordpress

One small implementation note: I've removed a :not() selector that was previously ensuring the <ul> CSS rule did not apply to .wp-block-gallery and instead placed an override in the gallery block's editor stylesheet.

I expect this to be slightly controversial, but this is intentional to avoid a selector specificity issue. Basically, ul:not(.wp-block-gallery) is more specific than ol ul. We would have had to do something like ol:not(.wp-block-gallery) ul or whatever to increase the specificity which is kind of annoying and unnecessary. To me, this feels like a case where the gallery should manage its own overrides.

@chrisvanpatten chrisvanpatten requested review from youknowriad, jasmussen and a team October 5, 2018 13:12
@chrisvanpatten chrisvanpatten added [Type] Enhancement A suggestion for improvement. [Feature] Blocks Overall functionality of blocks Needs Design Feedback Needs general design feedback. labels Oct 5, 2018
@chrisvanpatten
Copy link
Contributor Author

(As it so often is, the Travis failure seems unrelated.)

Copy link
Member

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

This makes a lot more sense to me code-wise. The editor styles specifically :not() targeting a single block's styles rather than that block managing it seems hacky/inelegant. I like this solution way more.

I haven't tested this locally but I prefer this approach. 👍 on the code aspect.

@chrisvanpatten
Copy link
Contributor Author

Thanks @tofumatt! I'll still wait for an "OK" from a design person before merging since this is technically a visual change :)

@chrisvanpatten
Copy link
Contributor Author

@jasmussen Sorry to ping just want to see if I can get a visual OK on this so I can get it in today :)

@jasmussen
Copy link
Contributor

Apologies for missing this.

I think this is good to go. No strong opinion, but also no objections. 👍 👍

@chrisvanpatten
Copy link
Contributor Author

Thanks @jasmussen and no worries for missing it! ^__^

@chrisvanpatten chrisvanpatten merged commit 69ced17 into WordPress:master Oct 8, 2018
@chrisvanpatten chrisvanpatten deleted the feature/nested-list-bullets branch October 8, 2018 13:32
@chrisvanpatten chrisvanpatten removed the Needs Design Feedback Needs general design feedback. label Oct 8, 2018
@tofumatt tofumatt added this to the 4.0 milestone Oct 8, 2018
nickcernis added a commit to studiopress/genesis-sample that referenced this pull request Oct 12, 2018
Matches new Gutenberg 4.0rc1 editor styling, and default browser styles.

See WordPress/gutenberg#10358.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants