Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Icon contained in button causes FOUC #2101

Open
lonix1 opened this issue Feb 2, 2025 · 0 comments
Open

[Question] Icon contained in button causes FOUC #2101

lonix1 opened this issue Feb 2, 2025 · 0 comments

Comments

@lonix1
Copy link

lonix1 commented Feb 2, 2025

Seeking guidance regarding button styling.

This is a common use case:

<button class="btn btn-primary"><i class="bi bi-house"></i></button>

On page load, there's a FOUC (Flash of Unstyled Content) where the button is narrow, and widens only after the icon font is loaded.

The solution is to set some min-width on the button. But what value to use? I tried 1rem but that doesn't do the trick. I can use 24px but I don't want to hardcode the value as it won't be responsive. What is the correct approach?

(PS: It would be useful if the docs highlighted this obvious use case.)

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

No branches or pull requests

1 participant