toferl/flag-icon-css

Forked from lipis/flag-icon-css

flags A collection of all country flags in SVG — plus the CSS for easier integration

http://flag-icon-css.lip.is

Language: HTML


flag-icon-css

npm version Bower version

A 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 Bower or NPM:

$ bower install flag-icon-css
$ npm install 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 npm install to install the dependencies after cloning the project and you'll be able to:

To watch for changes and live reload if served

$ grunt

To build *.less files

$ grunt build

To serve it on localhost:8000

$ grunt connect

To have only specific countries in the css file, remove the ones that you don't need from the flag-icon-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.

Project Statistics

Sourcerank 2
Repository Size 18.2 MB
Stars 1
Forks 0
Watchers 1
Open issues disabled
Dependencies 5
Tags 33
Created
Last updated
Last pushed

Recent Tags See all

2.4.0 August 14, 2016
2.3.1 May 18, 2016
2.3.0 May 18, 2016
2.2.0 May 08, 2016
2.1.0 April 26, 2016
2.0.0 April 12, 2016
1.4.0 March 06, 2016
1.3.0 February 25, 2016
1.2.0 February 13, 2016
1.1.0 January 22, 2016
1.0.0 December 25, 2015
0.8.6 December 23, 2015
0.8.5 November 15, 2015
0.8.4 October 27, 2015
0.8.3 October 26, 2015

Something wrong with this page? Make a suggestion

Last synced: 2017-12-16 08:17:56 UTC

Login to resync this repository