<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pseudo-and-custom-style-states-in-wordpress-7-1-sxesxqzvd" -->

---
title: Pseudo and custom style states in WordPress 7.1 | daily.dev
description: WordPress 7.1 introduces pseudo state styling (hover, focus, focus-visible, active) for the Button and Navigation Link blocks, configurable via theme.json,...
canonical: https://daily.dev/posts/pseudo-and-custom-style-states-in-wordpress-7-1-sxesxqzvd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Pseudo and custom style states in WordPress 7.1 | daily.dev
og:description: WordPress 7.1 introduces pseudo state styling (hover, focus, focus-visible, active) for the Button and Navigation Link blocks, configurable via theme.json,...
og:url: https://daily.dev/posts/pseudo-and-custom-style-states-in-wordpress-7-1-sxesxqzvd
og:image: https://api.daily.dev/og/posts/sxESxQzVd.png
og:image:alt: Pseudo and custom style states in WordPress 7.1
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Pseudo and custom style states in WordPress 7.1

**[Make WordPress Core](https://daily.dev/sources/wordpresscore)** · 3 min read · 1 upvotes · 0 comments

## Summary

WordPress 7.1 introduces pseudo state styling (hover, focus, focus-visible, active) for the Button and Navigation Link blocks, configurable via theme.json, Global Styles, and block instance attributes. A new custom states system allows theming of special block states like the current menu item in navigation links, using a dash-prefixed convention in theme.json. Site owners can disable user-facing state editing via the blockStatesEditingEnabled editor setting, while existing saved styles remain unaffected.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://make.wordpress.org/core/2026/08/05/pseudo-and-custom-style-states-in-wordpress-7-1>

## Questions this post answers

### How do I style the hover and focus states of a WordPress button block using theme.json?

In WordPress 7.1, define pseudo states inside the block object in theme.json using properties prefixed with a colon, such as ":hover", ":focus", ":focus-visible", and ":active" nested under core/button. These can also be nested inside responsive states like "@mobile" for viewport-specific hover styling. Support is currently limited to the Button and Navigation Link blocks.

_Theme developers tracking WordPress block styling changes can follow releases like this on daily.dev._

### How can I style the current menu item in the WordPress navigation link block?

Use the "-current" custom state property nested under core/navigation-link in theme.json, which generates CSS targeting a class selector like .wp-block-navigation-link .current-menu-item. This feature is early stage and only available through theme.json definitions with no user-facing UI yet, and pseudo states like :hover can be nested inside the -current state.

_daily.dev helps developers stay current on emerging WordPress block editor capabilities like this._

### How do I disable the ability for users to edit block hover and focus styles in the WordPress block editor?

Set the blockStatesEditingEnabled editor setting to false via the block_editor_settings_all filter, which defaults to true. This hides the state dropdown in the block inspector and the pseudo state options in Global Styles, though it doesn't remove already-saved styles from theme.json or block attributes, and viewport states remain controlled separately by responsiveEditingEnabled.

_Site builders locking down editor capabilities can track settings changes like this via daily.dev._

## Similar posts on daily.dev

- [Customisable Navigation Overlays in WordPress 7.0](https://daily.dev/posts/customisable-navigation-overlays-in-wordpress-7-0-w4idk0joo) · Make WordPress Core · 2 upvotes · 0 comments
- [Styling accordions in WordPress 6.9](https://daily.dev/posts/styling-accordions-in-wordpress-6-9-fc8m7csni) · WordPress Developer · 0 upvotes · 0 comments
- [The Shifting Line Between CSS States and JavaScript Events](https://daily.dev/posts/the-shifting-line-between-css-states-and-javascript-events-m4vbjqx92) · CSS-Tricks · 38 upvotes · 7 comments

---

Tags: [#php](https://daily.dev/tags/php), [#wordpress](https://daily.dev/tags/wordpress)

[View this post on daily.dev](https://daily.dev/posts/pseudo-and-custom-style-states-in-wordpress-7-1-sxesxqzvd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Pseudo and custom style states in WordPress 7.1","url":"https://daily.dev/posts/pseudo-and-custom-style-states-in-wordpress-7-1-sxesxqzvd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/pseudo-and-custom-style-states-in-wordpress-7-1-sxesxqzvd"},"datePublished":"2026-08-05T06:52:36.137Z","dateModified":"2026-09-14T09:31:07.733Z","description":"WordPress 7.1 introduces pseudo state styling (hover, focus, focus-visible, active) for the Button and Navigation Link blocks, configurable via theme.json,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6ad4f5b66be737a1618019916626b1bd?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6ad4f5b66be737a1618019916626b1bd?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Make WordPress Core","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Make WordPress Core","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/892d1a79e30e4e8a911b5726c6fb1a06","url":"https://daily.dev/sources/wordpresscore"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/pseudo-and-custom-style-states-in-wordpress-7-1-sxesxqzvd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php,wordpress","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Make WordPress Core","item":"https://daily.dev/sources/wordpresscore"},{"@type":"ListItem","position":3,"name":"Pseudo and custom style states in WordPress 7.1"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/pseudo-and-custom-style-states-in-wordpress-7-1-sxesxqzvd#faq","mainEntity":[{"@type":"Question","name":"How do I style the hover and focus states of a WordPress button block using theme.json?","acceptedAnswer":{"@type":"Answer","text":"In WordPress 7.1, define pseudo states inside the block object in theme.json using properties prefixed with a colon, such as \":hover\", \":focus\", \":focus-visible\", and \":active\" nested under core/button. These can also be nested inside responsive states like \"@mobile\" for viewport-specific hover styling. Support is currently limited to the Button and Navigation Link blocks. Theme developers tracking WordPress block styling changes can follow releases like this on daily.dev."}},{"@type":"Question","name":"How can I style the current menu item in the WordPress navigation link block?","acceptedAnswer":{"@type":"Answer","text":"Use the \"-current\" custom state property nested under core/navigation-link in theme.json, which generates CSS targeting a class selector like .wp-block-navigation-link .current-menu-item. This feature is early stage and only available through theme.json definitions with no user-facing UI yet, and pseudo states like :hover can be nested inside the -current state. daily.dev helps developers stay current on emerging WordPress block editor capabilities like this."}},{"@type":"Question","name":"How do I disable the ability for users to edit block hover and focus styles in the WordPress block editor?","acceptedAnswer":{"@type":"Answer","text":"Set the blockStatesEditingEnabled editor setting to false via the block_editor_settings_all filter, which defaults to true. This hides the state dropdown in the block inspector and the pseudo state options in Global Styles, though it doesn't remove already-saved styles from theme.json or block attributes, and viewport states remain controlled separately by responsiveEditingEnabled. Site builders locking down editor capabilities can track settings changes like this via daily.dev."}}]}
```

