4.1.7 • Published 3 years ago

flag-icon-css v4.1.7

Weekly downloads
161,144
License
MIT
Repository
github
Last release
3 years ago

flag-icons

A curated collection of all country flags in SVG — plus the CSS for easier integration. See the demo.

Install

You can either download the whole project as is or install it via npm or Yarn:

npm install --dev flag-icon-css
# or
yarn add --dev flag-icon-css

Usage

For using the flags inline with text add the classes .flag-icon and .flag-icon-xx (where xx is the ISO 3166-1-alpha-2 code of a country) to an empty <span>. If you want to have a squared version flag then add the class flag-icon-squared as well. Example:

<span class="flag-icon flag-icon-gr"></span>
<span class="flag-icon flag-icon-gr flag-icon-squared"></span>

You could also apply this to any element, but in that case you'll have to use the flag-icon-background instead of flag-icon and you're set. This will add the correct background with the following CSS properties:

background-size: contain;
background-position: 50%;
background-repeat: no-repeat;

Which means that the flag is just going to appear in the middle of an element, so you will have to set manually the correct size of 4 by 3 ratio or if it's squared add also the flag-icon-squared class.

Development

Run the yarn to install the dependencies after cloning the project and you'll be able to:

To build *.less files

$ yarn build

To serve it on localhost:8000

$ yarn start

To have only specific countries in the css file, remove the ones that you don't need from the flag-icons-list.less file and build it again.

Credits

This project wouldn't exist without the awesome and now deleted collection of SVG flags by koppi.

playtwo-core-cms-sectionsdemo-control-dashboardbillingman-web-customer-componentapp-flagoneview-guiadamant-angular-libraryadminlte-3-rtlmachine-finder-progreenbox_uiadamant-angular-libperfecto-ai-reports@linnworks/linn.core.clientlearning-analytics-librarysezzlestyles@doggoapp/doggo-ts-adminsimple-api-docts-basicigtb-nab-escrow-common-modules@everything-registry/sub-chunk-1678ter-kube-adminter-localization-cliwithfrontwmsman-web-componentvue-lang-code-flagssuperselectfieldstar-admin-freesportotekavue-country-flagsvue-flaggyvue-flotry-flag@digitallyhappy/backstrap@perolasoft/admin-ltecooreal-p-uiintellect-invoice-moduleintellect-liquidity-modulekilip-coreui-reactkilip-react-starterovp-uistisla-templatestisla@anvyst/vue-fieldhandlers@aiwins/flag-icon-css@alinex/gui@alinex/node-gui@burh/nuxt-core@bycore/flag-icon-css@cgdsoftware/ui@abp/flag-icon-css@adereksisusanto/iconsyawikyawik-devyxj-scafzenapi-plugin-settings-managerzhuzhuuivue-select-languagevuecidity@feedbackateng/uiux-reactjs@hanzo/react@icedesign/coreui-admin-template@etvas/etvaskit@etvas/etvaskit-2@gnosis.pm/dx-services-admin@liberu-ui/ui@entdec/satis@evirma/core-assets@enso-ui/ui@modernsoftwares/adhi-research-platform@modernsoftwares/kids-study-research-platform@jonathansadowski/wpc-test@puzzle-js/sentry-ui@ovh-ux/manager-enterprise-cloud-database@ovh-ux/manager-pci@spiregg/styleguide@simpleview/react-uimeta-proxy-managerpabmis-coreorderman-web-componento2system-venus-adminreact-continent-country-selectrcpvproductman-web-componentreact-flag-buttonreact-flag-currencyreact-flag-icon-cssreact-flags-cssreact-flags-iconng2-countriesng2-countries-trivianepttunepod-extract-credit-exemption-uiplayalong-componentsportalman-web-componentqinputexrangi-uiringa-fw-reactredesprou-phone-inputredesprouinputsfrasocgen-cbxds-account-workspacesmb-phone-number-input
4.1.7

3 years ago

4.1.6

3 years ago

4.1.4

4 years ago

4.1.3

4 years ago

4.1.5

4 years ago

4.1.0

4 years ago

4.1.1

4 years ago

4.0.0

4 years ago

3.5.0

5 years ago

3.4.6

5 years ago

3.4.5

6 years ago

3.4.2

6 years ago

3.4.0

6 years ago

3.3.0

6 years ago

3.2.1

7 years ago

3.2.0

7 years ago

3.0.0

7 years ago

2.9.0

7 years ago

2.8.0

9 years ago

2.4.0

9 years ago

2.3.0

9 years ago

2.2.0

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.3.0

9 years ago

1.0.0

9 years ago

0.8.6

9 years ago

0.8.4

9 years ago

0.8.2

10 years ago

0.7.1

10 years ago