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

Pseudo selectors: allow in blocks and expose more in the UI #53890

Closed
oandregal opened this issue Aug 23, 2023 · 3 comments
Closed

Pseudo selectors: allow in blocks and expose more in the UI #53890

oandregal opened this issue Aug 23, 2023 · 3 comments
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@oandregal
Copy link
Member

What problem does this address?

This is the current state of pseudo selectors in the WordPress design system:

Element Theme (theme.json) User (UI)
link All style properties. Only color.text.
h1 All style properties. -
h2 All style properties. -
h3 All style properties. -
h4 All style properties. -
h5 All style properties. -
h6 All style properties. -
heading All style properties. -
button All style properties. -
caption All style properties. -

What is your proposed solution?

The UI does not need to replicate all and every style implemented by theme.json. However, there are common use cases for pseudo-selectors that we don't support yet. See, for example, this hover effect for containers:

Gravacao.do.ecra.2023-08-23.as.14.48.55.mov

What if we:

  • enabled pseudo-selectors for any block via theme.json (connected to the block supports as well)
  • allowed users to switch the background color on hover for container blocks
@oandregal oandregal added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Aug 23, 2023
@oandregal
Copy link
Member Author

cc @aaronrobertshaw as I remember you having worked in this area and may have thoughts or past conversations to link to.

@aaronrobertshaw
Copy link
Contributor

Thanks for the ping @oandregal 👍

I haven't done a whole lot with the pseudo-selectors as they were being added by others around the time the Selectors API was being stabilized.

For me, the main issue has been how we incorporate configuring different sets of styles, into the UI. The main issue I'm aware of that is exploring this is #38277.

Another one that might be worth noting is #48581. It introduces the concept of element variations or "color sets", and might involve an overhaul to the information architecture in the sidebar. Both in global styles, and the block inspector.

I'd be glad to see progress on the interactive state styling as things like link hover styles can get in the way of custom button text colors etc.

@jordesign jordesign added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Aug 24, 2023
@oandregal
Copy link
Member Author

There's better issues the reflect the priorities and direction of the project, so I'm closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants