flag-icons icon indicating copy to clipboard operation
flag-icons copied to clipboard

does this still function? I've installed with npm using react btw, used the classes just like in description but nothing happens.

Open formidabilus opened this issue 2 years ago • 1 comments

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

formidabilus avatar Jul 28 '22 17:07 formidabilus

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

plneto avatar Jul 29 '22 10:07 plneto

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?

m0wglii avatar Aug 17 '22 14:08 m0wglii

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...

karinerock avatar Aug 17 '22 14:08 karinerock

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

lipis avatar Aug 19 '22 17:08 lipis

@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.

anhtungbui avatar Aug 24 '22 15:08 anhtungbui

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

formidabilus avatar Aug 24 '22 15:08 formidabilus