mirror of
https://github.com/lipis/flag-icons.git
synced 2026-04-26 09:25:50 +03:00
[GH-ISSUE #15] Flag wrapper #7
Labels
No labels
3rd-party
3rd-party
bug
code
documentation
enhancement
fixed-in-master
flag-request
help needed
missing-flag
missing-flag
pull-request
wrong-flag
wrong-flag
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/flag-icons#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xavadu on GitHub (May 7, 2014).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/15
Hello,
There is an issue with the flag wrapper, the .flag-icon class, if you want to add a border it is bigger than the flag itself, add a border is useful when you work with white background, they are many flag that have white parts or per example, Japan flag.
At the moment i solved it overridden .flag-icon with it:
it works on all the browsers but it is not a final solution, because like the unit it em, on medium screen the with doesn't match totally.
@lipis commented on GitHub (May 7, 2014):
It's a known thingy and you can solve that with different ways..
You can change also the
background-size: contain;tobackground-size: cover;and it will try to fit the flag inside the box so instead of having double border sometimes it will just crop the flag..Or instead of the
borderyou could use thebox-shadowpropertyBut I'm leaving all that to the end user as it really depends on the project..
@xavadu commented on GitHub (May 7, 2014):
Thanks for the quickly reply @lipis
@yohan-th commented on GitHub (Jun 28, 2020):
Previous solutions didn't work on my project.
I fix it with :
@Elfayer commented on GitHub (Sep 4, 2024):
I'm putting this here if it helps, this is my React component for flags:
Basically I go for the approach of
background-size: cover;.I enforce the size to 16px (
h-4in tailwind). If I need more sizes, I'd add a propsize: 'sm' | 'md' | 'lg'maybe, or place thepropsspread on thedivinstead of theitag, will see how it scales.