[GH-ISSUE #1024] does this still function? I've installed with npm using react btw, used the classes just like in description but nothing happens. #479

Closed
opened 2026-03-03 14:38:41 +03:00 by kerem · 6 comments
Owner

Originally created by @formidabilus on GitHub (Jul 28, 2022).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/1024

I'm using it like this: <span className="fi fi-gr"></span>

Originally created by @formidabilus on GitHub (Jul 28, 2022). Original GitHub issue: https://github.com/lipis/flag-icons/issues/1024 I'm using it like this: `<span className="fi fi-gr"></span>`
kerem closed this issue 2026-03-03 14:38:41 +03:00
Author
Owner

@plneto commented on GitHub (Jul 29, 2022):

Don't forget to import the css file as well. e.g. import "/node_modules/flag-icons/css/flag-icons.min.css";

<!-- gh-comment-id:1199131338 --> @plneto commented on GitHub (Jul 29, 2022): Don't forget to import the css file as well. e.g. `import "/node_modules/flag-icons/css/flag-icons.min.css";`
Author
Owner

@m0wglii commented on GitHub (Aug 17, 2022):

I have similiar issues using flag-icons in an angular-context.

After running npm i --include=dev flag-icons I tried the following:

in Angular.json I had put the path in the styles section.
"styles": [ "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css", "./node_modules/flag-icons/css/flag-icons.min.css", "src/styles.scss" ],

Trying to get a flag visible with this, not working.

<span class="fi fi-in"></span>

Tried @import "./node_modules/flag-icons/css/flag-icons.min.css"; in my styles.scss. Tried the same in the .scss related to a specific component where I want the flags to show up. Any ideas?

<!-- gh-comment-id:1218094608 --> @m0wglii commented on GitHub (Aug 17, 2022): I have similiar issues using flag-icons in an angular-context. After running npm i --include=dev flag-icons I tried the following: in Angular.json I had put the path in the styles section. ` "styles": [ "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css", "./node_modules/flag-icons/css/flag-icons.min.css", "src/styles.scss" ], ` Trying to get a flag visible with this, not working. `<span class="fi fi-in"></span>` Tried `@import "./node_modules/flag-icons/css/flag-icons.min.css";` in my styles.scss. Tried the same in the .scss related to a specific component where I want the flags to show up. Any ideas?
Author
Owner

@karinerock commented on GitHub (Aug 17, 2022):

You also need to add a width and height on the icon.
You also need to make sure that the parent has a display: flex.
In my case, these two points was the missing CSS attribute that prevented the icon to show...

<!-- gh-comment-id:1218110107 --> @karinerock commented on GitHub (Aug 17, 2022): You also need to add a width and height on the icon. You also need to make sure that the parent has a display: flex. In my case, these two points was the missing CSS attribute that prevented the icon to show...
Author
Owner

@lipis commented on GitHub (Aug 19, 2022):

I'm not familiar with angular.. but maybe it's better to use the https://github.com/lipis/flag-icons/tree/main/sass instead? You'll need to include the flags folder and point to it via https://github.com/lipis/flag-icons/blob/main/sass/_variables.scss#L1

<!-- gh-comment-id:1220926615 --> @lipis commented on GitHub (Aug 19, 2022): I'm not familiar with angular.. but maybe it's better to use the https://github.com/lipis/flag-icons/tree/main/sass instead? You'll need to include the flags folder and point to it via https://github.com/lipis/flag-icons/blob/main/sass/_variables.scss#L1
Author
Owner

@anhtungbui commented on GitHub (Aug 24, 2022):

@m0wglii I'm Angular dev here, no problem using the library so far. The only thing I did was importing the minified CSS file into the angular.json file:

 "styles": [
              "node_modules/flag-icons/css/flag-icons.min.css",
              "src/styles.scss"
            ],

Restart the compiler and <span class="fi fi-eu"></span> should work.

<!-- gh-comment-id:1225876141 --> @anhtungbui commented on GitHub (Aug 24, 2022): @m0wglii I'm Angular dev here, no problem using the library so far. The only thing I did was importing the minified CSS file into the `angular.json` file: ``` "styles": [ "node_modules/flag-icons/css/flag-icons.min.css", "src/styles.scss" ], ``` Restart the compiler and `<span class="fi fi-eu"></span>` should work.
Author
Owner

@formidabilus commented on GitHub (Aug 24, 2022):

I didn't try anymore, I will close this issue.

<!-- gh-comment-id:1225905384 --> @formidabilus commented on GitHub (Aug 24, 2022): I didn't try anymore, I will close this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#479
No description provided.