Skip to content

Icon block: Add CSS to preserve stroke-scaling#79116

Open
jasmussen wants to merge 1 commit into
trunkfrom
update/icon-block-stroke-rule
Open

Icon block: Add CSS to preserve stroke-scaling#79116
jasmussen wants to merge 1 commit into
trunkfrom
update/icon-block-stroke-rule

Conversation

@jasmussen

Copy link
Copy Markdown
Contributor

What?

Related to #78808 (comment)

This PR explicitly sets the stroke-scaling effect of icons in the Icon block to be default, that strokes are maintained.

There is no visual effect of applying this at the moment, but it adds a safeguard so that if/when #78808 lands, icons in the icon block retain their same visual effect. Without this, icons could look like this:

image

With this CSS in place, they would instead look like this

image

Why?

Converting the icon library to be stroke-based would still be beneficial for the icon block. We could add a togglecontrol on whether to maintain the stroke-width or not, and even a slider to define the thickness of the stroke.

But for now, it would keep the visuals identical.

Testing Instructions

Test the icon block with icons at various sizes. There should be no visual changes.

@jasmussen jasmussen self-assigned this Jun 11, 2026
@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Block] Icon Affects the Icon block labels Jun 11, 2026
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jun 11, 2026
@github-actions

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: jasmussen <joen@git.wordpress.org>

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

@github-actions

Copy link
Copy Markdown

Size Change: +395 B (0%)

Total Size: 8.59 MB

📦 View Changed
Filename Size Change
build/styles/block-library/icon/style-rtl.css 268 B +50 B (+22.94%) 🚨
build/styles/block-library/icon/style-rtl.min.css 201 B +47 B (+30.52%) 🚨
build/styles/block-library/icon/style.css 268 B +50 B (+22.94%) 🚨
build/styles/block-library/icon/style.min.css 201 B +47 B (+30.52%) 🚨
build/styles/block-library/style-rtl.css 21.7 kB +56 B (+0.26%)
build/styles/block-library/style-rtl.min.css 18.2 kB +46 B (+0.25%)
build/styles/block-library/style.css 21.8 kB +53 B (+0.24%)
build/styles/block-library/style.min.css 18.2 kB +46 B (+0.25%)

compressed-size-action

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

Labels

[Block] Icon Affects the Icon block [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant