Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto eol=lf
*.png binary
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run build
- name: Generated files are committed
run: git diff --exit-code -- css sass README.md
- run: npm test
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
tags: ['v*']

permissions:
contents: write
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
cache: npm
- run: npm ci
- run: npm run build && npm test
- name: Tag matches package.json
run: test "v$(node -p "require('./package.json').version")" = "${GITHUB_REF_NAME}"
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: GitHub release
run: |
zip -qr "flag-icons-${GITHUB_REF_NAME}.zip" css svg png sass flags.json LICENSE README.md
gh release create "$GITHUB_REF_NAME" "flag-icons-${GITHUB_REF_NAME}.zip" --title "$GITHUB_REF_NAME" --generate-notes
env:
GH_TOKEN: ${{ github.token }}
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/node_modules
npm-debug.log
npm-debug.log.*
node_modules/
npm-debug.log*
.DS_Store
test.html
package-lock.json
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Changelog

All notable changes to this project are documented here. The format is based on
[Keep a Changelog](https://keepachangelog.com/) and the project follows
[Semantic Versioning](https://semver.org/).

## [3.1.0] - 2026-10-22

Fully backwards compatible with 3.0.0: same files, paths and classes.

### Added
- `AQ` (Antarctica), `BQ` (Caribbean Netherlands) and `EH` (Western Sahara): every ISO 3166-1 alpha-2 code is now covered. Closes #5.
- Missing `@2x` and `@3x` png for `CAF`, `CAS`, `CNA`, `COC`, `CSA` and `WW`. Closes #4.
- `.fill` modifier to make the flag cover its box (e.g. `square fill`).
- `flags.json` with every code and name; it is the single source for the Sass lists and the README tables.
- Sass mixins (`sass/_mixins.scss`): `flag()`, `base()` and `image()`.
- Sass variables `$flag-icons-class`, `$flag-icons-height` and `$flag-icons-ratio`.
- Sass module system support (`@use ... with (...)`), keeping the legacy `@import`.
- npm package `@yammadev/flag-icons` and jsDelivr CDN instructions.
- Tests, including a 3.0.0 compatibility suite, and GitHub Actions for CI and releases.
- Demo page with search (GitHub Pages).

### Changed
- The CSS selector is now `.flag-icons` instead of `span.flag-icons, i.flag-icons`: it works on any element and is easier to override.
- SVG files optimized with SVGO (829 KB → 409 KB) with no visible change.
- Build moved from Grunt + Ruby Sass (discontinued) to Dart Sass with npm scripts.
- Country names updated: North Macedonia, Eswatini, Czechia, Türkiye, Cabo Verde.
- README rewritten; it now matches the actual Sass file and variable names.

### Fixed
- `css/` was compiled from an older version of the sources.
- Minified CSS had `@charset` after the banner, where browsers ignore it.

### Removed
- `Gruntfile.js` and its dependencies.

## [3.0.0] - 2020-04-14

### Added
- More flags (`svg` and `png`).

### Changed
- `sass` files, code cleaning and better instructions in the README.
- Title and description in `_config.yml`.
- Table rendering fix for GitHub Pages.

### Security
- Removed packages with vulnerabilities.

## [2.0.0] - 2020-03-16

### Added
- GitHub page using `jekyll-theme-cayman`.

### Changed
- README tables and dependencies updated.

### Security
- Security issues solved.

## [1.2.0] - 2017-06-27

### Added
- `grunt` build.
- `png` flags.

## [1.1.0] - 2017-06-26

### Changed
- Better `sass` approach and instructions.

## [1.0.0] - 2017-06-26

### Added
- `svg` flags, `sass` boilerplate and `css` libraries.

[3.1.0]: https://github.com/yammadev/flag-icons/compare/v3.0.0...v3.1.0
[3.0.0]: https://github.com/yammadev/flag-icons/releases/tag/v3.0.0
72 changes: 0 additions & 72 deletions Gruntfile.js

This file was deleted.

30 changes: 29 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
MIT License

Copyright (c) 2017 Yefferson
Copyright (c) 2017-present Yefferson Marín

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


---

The flag artwork is based on FlagKit (https://github.com/madebybowtie/FlagKit),
released under the following license:

The MIT License (MIT)

Copyright (c) 2016 Bowtie AB

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading