Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix proportions of icon only rounded buttons to be perfect circles#3839

Open
bluefantail wants to merge 1 commit intojgthms:mainfrom
bluefantail:fix-proportions-of-icon-only-rounded-buttons
Open

Fix proportions of icon only rounded buttons to be perfect circles#3839
bluefantail wants to merge 1 commit intojgthms:mainfrom
bluefantail:fix-proportions-of-icon-only-rounded-buttons

Conversation

@bluefantail
Copy link
Contributor

@bluefantailbluefantail commentedJun 12, 2024
edited
Loading

This is animprovement / bugfix.

Currently, creating a button with only a single icon inside it results in a perfect square icon button, but doing the same with theis-rounded modifier doesn't result in a perfect circle because extra padding is added for rounded buttons.

Submitting as improvement / bugfix because I think it depends on how you look at it — to me the icon-only buttons should be perfect circles, but this is really a small enhancement with a minor impact to make that specific scenario true. My gut feel says the icons appearing as circles would be the expected / preferred result when adding theis-rounded modifier.

Proposed solution

Add an extra selector to move the extra padding case to happen only in the cases where a single icon isn't the sole child of the button.

This means that circular icon buttons can now be created, but adding any other content to the button still results in the exact same proportions as before.

As maybe an optional thing I put the:has() selector behind behind an@supports rule to more gracefully handle older browsers that don't support it (falling back to the same logic as before). But it has recently gained good browser support too and I see some instances of it starting to turn up in Bulma already — so unsure wether the progressive enhancement is necessary!

Tradeoffs

Adds a bit more duplicated css having the feature detection in there. But on the flipside browsers drop the whole rule set if:has() isn't supported so it feels good to have given the recency of browser support coverage.

Adds a bit more complexity to the button ruleset overall.

I don't see too many other drawbacks unless people are currently relying on the oval shaped icon buttons — seems unlikely but it could be a thing?

Testing Done

Checked all existing buttons in the docs locally, and added theis-rounded modifier to as many variations as I could find or think of, making sure that anything more than a single icon as the only child still results in the same padding behaviour as before.

Before:

image

After:

image

Changelog updated?

No.

…clesCurrently, creating a button with only a single icon inside it results ina perfect square icon button, but doing the same with the is-rounded modiferdoesn't result in a perfect circle because extra padding is added for roundedbuttons. This adds an extra selector to move that extra padding case to happenonly in the cases where a single icon isn't the sole child of the button.This means that circular icon buttons can now  be created, but adding any othercontent to the button still results in the exact same proportions as before.Since this makes use of the :has() selector which has only recently gainedgood browser support, the whole rule is behind an@supports for :has() so thatolder browsers will fall back to the same logic as before.
firdaus-aziz added a commit to firdaus-aziz/bulma that referenced this pull requestJan 29, 2026
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@bluefantail

Comments


[8]ページ先頭

©2009-2026 Movatter.jp