-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/moose 66 update post content selector #117
Feature/moose 66 update post content selector #117
Conversation
…e admin & editor.
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.
🟢 This works for me! Thanks for tackling! 🌮
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.
One thing I just noticed while pulling this over. May have to separate these due to postcss warnings.
.wp-block-list { | ||
|
||
&::marker { | ||
font-weight: var(--font-weight-bold); | ||
} | ||
li ~ li { | ||
margin-top: var(--spacer-30); | ||
} | ||
|
||
/* ---------------------------------------------------------------------- | ||
* CASE: Ordered List | ||
* ---------------------------------------------------------------------- */ | ||
|
||
ol& { | ||
padding-inline-start: 1.2rem; | ||
|
||
li { | ||
padding-inline-start: 10px; | ||
|
||
& ~ li { | ||
margin-top: var(--spacer-30); | ||
&::marker { | ||
font-weight: var(--font-weight-bold); | ||
} | ||
} | ||
} | ||
} | ||
|
||
/* ---------------------------------------------------------------------- | ||
* Unordered List | ||
* | ||
* The first selector applies to the FE, the second in the editor. | ||
* The list block is the only block on the FE that doesn't get a class, | ||
* so we're able to apply a :not() selector for the class attribute. | ||
* While both will apply in the editor, only the second will affect | ||
* the actual list block. | ||
* ---------------------------------------------------------------------- */ | ||
|
||
.wp-site-blocks ul:not([class]), | ||
ul.wp-block-list { | ||
padding-inline-start: 10px; | ||
|
||
& li { | ||
padding-inline-start: 1.3rem; | ||
position: relative; | ||
|
||
&::marker { | ||
content: var(--icon-list-bullet); | ||
transform: translateX(10px); | ||
} | ||
/* ---------------------------------------------------------------------- | ||
* CASE: Unordered List | ||
* ---------------------------------------------------------------------- */ | ||
|
||
ul& { | ||
padding-inline-start: 10px; | ||
|
||
li { | ||
padding-inline-start: 1.3rem; | ||
position: relative; | ||
|
||
& ~ li { | ||
margin-top: var(--spacer-30); | ||
&::marker { | ||
content: var(--icon-list-bullet); | ||
transform: translateX(10px); | ||
} |
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.
@dpellenwood I'm getting some warnings in postcss when trying to use these styles due to the ul&
and ol&
not having a symbol to start:
postcss-nesting: Nested selectors must start with a symbol and "ul&" begins with a letter.
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.
Interesting. I know that this was a later change to the spec, but it is valid now. (The second code example under this heading.) I think your project may not be using the latest version of postcss-preset-env
or similar. That selector doesn't cause any errors here on Moose.
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.
👍 Looks Good!
What does this do/fix?
wp-site-blocks
in css selectors to use thewp-block-post-content
selector instead. The post-content should always appear in the editor and on the FE, so this single selector is a nice simplifier.Ticket: MOOSE-66