Skip to content

Tighten [style*="border-color"] selector to avoid matching URLs in inline styles - #77555

Closed
benniledl wants to merge 1 commit into
WordPress:trunkfrom
benniledl:patch-3
Closed

benniledl wants to merge 1 commit into
WordPress:trunkfrom
benniledl:patch-3

Conversation

@benniledl

@benniledl benniledl commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

This change fixes an issue where the selector [style*="border-color"] was too broad and matched unintended cases.

On the WordCamp Europe site, an inline style contained a background image URL with border-color in the filename. This caused the rule to incorrectly apply borders, resulting in random borders appearing across the site.

The selector is now tightened to [style*="border-color:"] to ensure it only targets actual CSS declarations, not substrings inside URLs.

Related #75546
@aaronrobertshaw
AI Note: PR Title and Description written by AI

Tighten selectors to avoid matching URLs in inline styles
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Apr 22, 2026
@github-actions

github-actions Bot commented Apr 22, 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. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: benniledl <benniledl@git.wordpress.org>
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: Rishit30G <rishit30g@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: mateuswetah <tainacan@git.wordpress.org>
Co-authored-by: firdaus666 <firdaus666@git.wordpress.org>

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

@benniledl benniledl changed the title This change fixes an issue where the selector [style*="border-color"] was too broad and matched unintended cases. On the WordCamp Europe site, an inline style contained a background image URL with border-color in the filename. This caused the rule to incorrectly apply borders, resulting in random borders appearing across the site. The selector is now tightened to [style*="border-color:"] to ensure it only targets actual CSS declarations, not substrings inside URLs. Tighten [style*="border-color"] selector to avoid matching URLs in inline styles Apr 22, 2026
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Apr 22, 2026
@t-hamano t-hamano linked an issue Apr 22, 2026 that may be closed by this pull request
3 of 6 tasks
@aaronrobertshaw

Copy link
Copy Markdown
Contributor

@benniledl Thanks for the PR it would be great if you could update the PR description to follow the Gutenberg project's template as it will provide a better path to review, provide required context and in this particular case help evaluate alternative solutions e.g. #77476

@talldan

talldan commented May 22, 2026

Copy link
Copy Markdown
Contributor

I think this fix might still match css vars, so it'd be good to avoid that, as it's the main issue reported in #70211

@aaronrobertshaw

Copy link
Copy Markdown
Contributor

As the approach in this PR doesn't solve the primary issue being reported. I'll close this in favour of alternative approaches already noted in this PR discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The common.css file [style*=border-width] selector is applying unwanted styles

4 participants