Skip to content

Twenty Twenty: Replace the abandoned stylelint-a11y dependency - #13338

Closed
desrosj wants to merge 8 commits into
WordPress:trunkfrom
desrosj:replace/styleint-a11y
Closed

desrosj wants to merge 8 commits into
WordPress:trunkfrom
desrosj:replace/styleint-a11y

Conversation

@desrosj

@desrosj desrosj commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

The @double-great/stylelint-a11y package is a seemingly well maintained fork of the original stylelint-a11y, which has not been updated for over 7 years and is incompatible with newer versions of Stylelint and Node.js.

This PR:

  • Replaces stylelint-a11y with the latest version of @double-great/stylelint-a11y (^3.8.3).
  • Replaces the deprecated stylelint-config-wordpress with @wordpress/stylelint-config in .stylelintrc.json.
  • Disables the a11y/selector-pseudo-class-focus rule for the editor's Button and File block hover styles, which is the only violation of that rule. In the editor, these elements are RichText (contenteditable) fields, so a :focus underline would show the entire time the text is being edited, which is unnecessary in that context.
  • Updates Twenty Twenty to Node.js 24.x (.nvmrc, engines, and devEngines), bringing it in line with Core and the other default themes. This was the last remaining item for Core-65451.

The theme's build output is unchanged on Node.js 24.x. npm run lint:css now runs again, but it reports existing violations of other rules from the newer @wordpress/stylelint-config (mostly selector-class-pattern for block class names). These can be addressed in a follow-up.

Trac ticket: Core-66004.
See Core-65451.

Use of AI Tools

Cursor with Composer 2.5 was used to analyze the situation for possible ways to fix this issue. Claude Code (Claude Opus 5.5) was used to verify the editor focus behavior, update the editor styles and linting exclusion, upgrade the theme to Node.js 24.x, and update the dependency.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

🤖 Generated with Claude Code

https://claude.ai/code/session_011Y86gx8u886tnkeJXZCUR1

The `@double-great/stylelint-a11y` package is a fork of the original `stylelint-a11y` which has not been updated for over 7 years.
@desrosj desrosj self-assigned this Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props desrosj, sabernhardt.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

desrosj and others added 4 commits November 5, 2026 12:45
The front end underlines Button and File block buttons on both `:hover` and `:focus`, but the block editor styles only applied the underline on `:hover`.

In the editor, these elements are `RichText` fields (`contenteditable`) and do receive focus, so this adds the matching `:focus` selectors. This also resolves the `a11y/selector-pseudo-class-focus` linting violation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Y86gx8u886tnkeJXZCUR1
This updates the theme's `.nvmrc` file and the `engines` field in `package.json` to require Node.js `24.18.0` and npm `11.16.0`, and adds a matching `devEngines` field. This brings Twenty Twenty in line with Core and the other default themes.

Follow-up to [63539].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Y86gx8u886tnkeJXZCUR1
…rsion.

Version `3.4.15` was previously used because `3.5.0` dropped support for Node.js 20.x. Now that the theme requires Node.js 24.x, the latest version (`3.8.3`) can be used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Y86gx8u886tnkeJXZCUR1
@desrosj
desrosj requested a review from sabernhardt November 5, 2026 18:06
@desrosj

desrosj commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@sabernhardt I think this is ready to go. Do you mind giving it a review?

@desrosj
desrosj requested a balanced review from Copilot November 5, 2026 18:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@sabernhardt

Copy link
Copy Markdown

I was wrong about the .wp-block-button__link and .wp-block-file__button elements not receiving the focus state in the editor. With the patch, the text of the button-styled link is underlined as I type within a Button or File block because the div has focus (tabindex=0). This style might not be a problem, but the underline is new and unnecessary in the context.

cursor positioned inside File block's Download link, showing underline

I also ran the following commands to check for any changes: npm install, npm audit fix, npm dedupe, and npm run build. The audit fix and dedupe commands edited the package-lock.json file, which might have further updating if the commands are run again another day.

On a side note, the vendor prefix build process does not work, and I would prefer to remove those dependencies instead of trying to fix them.

In the block editor, the Button and File block buttons are editable text fields. With the `:focus` selectors, the button text was underlined the entire time it was being edited, which is new and unnecessary in that context.

This removes the `:focus` selectors and instead disables the `a11y/selector-pseudo-class-focus` rule for that rule set, with a comment explaining why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 65355
GitHub commit: 1b1fd1e

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants