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

Setting the :active state on the Navigation 'li' element in theme.json #57625

Closed
ATaylorUK opened this issue Jan 6, 2024 · 2 comments
Closed
Labels
[Type] Bug An existing feature does not function as intended

Comments

@ATaylorUK
Copy link

Description

I shared this finding on a WordPress group on Facebook and comments suggested I should raise it as a bug.

I am building an FSE WordPress theme from scratch, I am fairly new to building themes and wondering if there is an answer to the below. I can of course override using a CSS stylesheet, but I want to keep much as possible in the theme.json file.

The ":active" pseudo-class isn't working in my theme.json file. The ":hover" class is working within theme.json.

Step-by-step reproduction instructions

See screenshots, using theme.json to control the active state of the navigational 'li' element when building a custom Wordpress theme.

Screenshots, screen recording, code snippet

themejsonactive
themejsonhover
themejson

Environment info

Wordpress: 6.4.2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@ATaylorUK ATaylorUK added the [Type] Bug An existing feature does not function as intended label Jan 6, 2024
@hanneslsm
Copy link

In my theme it's working as attended.
You circled "about" in your screenshot, which makes me think that you might confuse :active (which is the state when the mouse button is still hold down) with the current menu item?
Styling the current page is not implemented yet: #42299

@ATaylorUK
Copy link
Author

ATaylorUK commented Jan 7, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants