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

Styling the Post Terms divider #31710

Closed
jffng opened this issue May 11, 2021 · 5 comments · Fixed by #32812
Closed

Styling the Post Terms divider #31710

jffng opened this issue May 11, 2021 · 5 comments · Fixed by #32812
Assignees
Labels
[Block] Post Tags Affects the Post Tags Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@jffng
Copy link
Contributor

jffng commented May 11, 2021

It would be nice to be able to customize the divider between post terms, or at least render the divider as a pseudo element so it can be easily targeted via CSS:

Current state looks like this:

View Mark-up
Screen Shot 2021-05-11 at 10 09 10 AM Screen Shot 2021-05-11 at 10 07 41 AM
@carolinan carolinan added [Type] Enhancement A suggestion for improvement. [Block] Post Tags Affects the Post Tags Block labels May 11, 2021
@kjellr kjellr added the [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. label May 11, 2021
@kjellr
Copy link
Contributor

kjellr commented May 11, 2021

Customizing this divider should definitely be possible. It also seems weird to me that the default divider is a pipe — I feel like the vast majority of themes use a comma here.

@justintadlock
Copy link
Contributor

The term list functions already have a separator argument. Can we just expose that as an argument for the block? It doesn't necessarily have to be turned on in the block options panel, but theme authors could simply do:

<!-- wp:post-terms {"separator":", "} /--> 

Commas or no separator at all are the most common use cases in themes.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jun 18, 2021
@aristath
Copy link
Member

Pushed a PR in #32812 adding the missing separator attribute if anyone wants to test & review it 👍

@justintadlock
Copy link
Contributor

What do you think about adding a <span class="wp-block-post-terms__sep"> wrapper? I often need it for directly targeting the separator in CSS.

@aristath
Copy link
Member

What do you think about adding a <span class="wp-block-post-terms__sep"> wrapper? I often need it for directly targeting the separator in CSS.

Great idea. Added it to the PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Tags Affects the Post Tags Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants