A beautiful svg + png + sass + css collection of 261 flags by Yefferson MarĂn.
All sketch files were pulled from madebybowtie/FlagKit.
Check out yammadev/brand-icons.
Yefferson MarĂn - (@yammadev)
1. Add the compiled css file to your html.
<!-- Use generated lib -->
<link rel="stylesheet" href="/css/flag-icons.css">
<!-- Or compressed -->
<link rel="stylesheet" href="/css/flag-icons.min.css">2. Download the svg (folder) icons in your path.
3. Use <i> or <span> tags adding the class flag-icons followed of the flag code (look Reference bellow for details) which is the ISO 3166-1-alpha-2 code for each one. The result is a rectangular flag, however, the square class can be used if a squared one is required:
<!-- Using <i> -->
<i class="flag-icons CO"></i>
<i class="flag-icons square CO"></i>
<!-- Using <span> -->
<span class="flag-icons CO"></span>
<span class="flag-icons square CO"></span>4. You can also format the default size of the flag in a custom css file:
.flag-icons, /* Format default wrapper */
.rectangle { /* Or use as new class */
height: 2em !important;
width: 2.66667em !important;
line-height: 2em !important;
}
.flag-icons, /* Format default wrapper */
.square, /* Format default square class */
.squared { /* Or use as new class */
height: 2em !important;
width: 2em !important;
line-height: 2em !important;
} <!-- Rectangle -->
<i class="flag-icons CO"></i>
<i class="flag-icons rectangle CO"></i>
<!-- Square -->
<i class="flag-icons CO"></i>
<i class="flag-icons square CO"></i>
<i class="flag-icons squared CO"></i>1. From svg folder get just the flags you need
2 Edit the library css/flag-icons.css by just leaving the classes for the selected flags.
3. Use as explained before.
1. In svg folder put just the files you need, and then edit sass/_variables.sass, where 'code' represents the name(s) of the desired flag(s).
// ...
$flags: (
'code'
...
'code'
)2. Run in terminal:
# Install dependencies
$ npm install
# Build!
$ grunt build3. It will generate:
/css <-- .css, .min.css
4. Use as usual.
Issues and pull requests are most than welcome.
Released under the MIT license.
8 flags:
| Flag | Code | Region |
|---|---|---|
| CAF | Africa | |
| CAS | Asia | |
| CNA | North America | |
| COC | Oceania | |
| CSA | South America | |
| EU | European Union | |
| WW | World | |
| LGBT | Pride |
253 flags:
All notable changes to this project are documented in this part of the file. The format is based on Keep a Changelog.
- x for major release related to major additions or changes.
- y for minor release related to minor additions or changes in current major release.
- z for minor release related to minor additions or changes in current minor release.
- Added for new features.
- Modified for changes in existing functionality.
- Deprecated for soon-to-be removed features.
- Removed for removed features.
- Fixed for any bug fixes.
- Security in case of vulnerabilities.
- Title + Description in
_config.yml.
- More flags! (
svgandpng)
sassfiles.- Better instructions in
readme. - Tables rendering problem in
readmebased on this issue / in_config.yml. - Code cleaning.
readmeedited.
- Removed some packages with vulnerabilities.
- Still trying to solve tables problem in
githubpage view.
- Trying to solve tables problem in
githubpage view.
- Minimal changes.
Githubpage added usingjekyll-theme-cayman.
- Tables modified in
readme. - Dependencies updated.
- Security issues solved.
- Code cleaning.
readmeedited.
readmeedited.
readmeedited.
- Link to ISO 3166-1-alpha-2 code updated.
readmeedited.
readmeedited.
gruntintegrated for better and cleaner approach.pngflags.
readmeedited.
sassbetter approach.- Better instructions in
readme.
svgflags.sassboilerplate.csslibraries.
- Initial commit.
readme+ license.