Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flagpack

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flagpack - npm Package Compare versions

Comparing version 0.5.2 to 1.0.0

flags.tar.gz

37

builder.js

@@ -6,17 +6,22 @@ const sass = require('node-sass');

sass.render({
file: path.join(pathToFlagStyles, 'flagpack.scss'),
outputStyle: 'compressed'
}, function (err, result) {
if (!err) {
fs.writeFile(path.join(__dirname, './dist/', 'flagpack.css'), result.css, function (err) {
if (!err) {
console.log('File written to: ', pathToFlagStyles)
} else {
console.error(err)
}
});
} else {
console.error(err)
}
})
function compileSass(input, output){
sass.render({
file: path.join(pathToFlagStyles, input + '.scss'),
outputStyle: 'compressed'
}, function (err, result) {
if (!err) {
fs.writeFile(path.join(__dirname, './dist/', output + '.css'), result.css, function (err) {
if (!err) {
console.log('File written to: ', pathToFlagStyles)
} else {
console.error(err)
}
});
} else {
console.error(err)
}
})
}
compileSass('flagpack', 'flagpack');
{
"name": "flagpack",
"version": "0.5.2",
"version": "1.0.0",
"description": "A lightweight flag icon toolkit for the web",

@@ -5,0 +5,0 @@ "main": "builder.js",

@@ -22,3 +22,3 @@ # Flagpack

**Default flag:** `bo` is the country code (Bolivia is used for the examples).
**Default flag:** `bo` is the country code (Bolivia 🇧🇴 is used in these examples).

@@ -39,5 +39,11 @@ `<span class="fp bo"></span>`

**square variant:**
_[visit the flag.pk](https://flag.pk/world) to quickly copy your countries code for you project._
`<span class="fp fp-square bo"></span>`
_[visit flag.pk](https://flag.pk/world) to quickly copy your countries code for you project._
---
### SASS

@@ -52,24 +58,42 @@ Flagpack is built with SASS (SCSS). There are a few variables that are `!default` so that you can override them easily.

**Set default icon size:** This will also mofify the `fp-md` & `fp-lg` sizes.
**Set default icon size:** This will also mofify the `fp-md`, `fp-lg` & `fp-rounded` sizes.
```
$fp-size: 1em !default;
```
**Countries:** If you would like to include only a few countries you can override this variable. Just Include the country codes you want.
```
**Flag SVG path:** You will always need to override this if you are going to use the sass files.
$fp-countries: 'ad', 'ae', 'af', 'ag', 'ai', 'al', 'am', 'ao', 'ar', 'as', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'bj', 'bl', 'bm', 'bn', 'bo', 'bq', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'cr', 'cu', 'cv', 'cw', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'ee', 'eg', 'eh', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb-eng', 'gb-nir', 'gb-sct', 'gb-wls', 'gb-zet', 'gb', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'io', 'iq', 'ir', 'is', 'it', 'je', 'jm', 'jo', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'lgbt', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'me', 'mf', 'mg', 'mh', 'mk', 'ml', 'mm', 'mn', 'mo', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nc', 'ne', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'ps', 'pt', 'pw', 'py', 'qa', 're', 'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'ss', 'st', 'sv', 'sx', 'sy', 'sz', 'tc', 'td', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tr', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'um', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'xk', 'ye', 'yt', 'za', 'zm', 'zw' !default;
```
**Flag SVG paths:** You will always need to override these variables if you are going to use the sass files.
* `$fp-4x3-path` is for the **4x3** (rectangle) formats.
* `$fp-1x1-path` is for the **1x1** (square) formats.
```
$fp-path: '../flags/' !default;
$fp-4x3-path: '../flags/4x3/' !default;
```
```
$fp-1x1-path: '../flags/1x1/' !default;
```
**Countries:** If you would like to include only a few countries you can override this variable. Just Include the country codes you want.
**Enable/Disable Formats:** You can optionally turn off flag formats if you would only like to use one format (both formats are enabled by default).
```
$fp-countries: 'ad', 'ae', 'af', 'ag', 'ai', 'al', 'am', 'ao', 'ar', 'as', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'bj', 'bl', 'bm', 'bn', 'bo', 'bq', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'cr', 'cu', 'cv', 'cw', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'ee', 'eg', 'eh', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb-eng', 'gb-nir', 'gb-sct', 'gb-wls', 'gb-zet', 'gb', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'io', 'iq', 'ir', 'is', 'it', 'je', 'jm', 'jo', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'lgbt', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'me', 'mf', 'mg', 'mh', 'mk', 'ml', 'mm', 'mn', 'mo', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nc', 'ne', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'ps', 'pt', 'pw', 'py', 'qa', 're', 'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'ss', 'st', 'sv', 'sx', 'sy', 'sz', 'tc', 'td', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tr', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'um', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'xk', 'ye', 'yt', 'za', 'zm', 'zw' !default;
$fp-enable-4x3: true !default;
```
```
$fp-enable-1x1: true !default;
```
## Why use this library?
Most flag libraries out there either use low quality png files or overly complex svg flag images. flagpack is around `62kb gzipped` this is including all the svgs and css, making it about **20x** smaller than `flag-icon-css`
Most flag libraries out there either use low quality png's or overly complex svg's. Flagpack is around `125kb gzipped` this is including all the svgs (both **1x1** and **4x3** formats) plus the css. making it about **10x** smaller than [flag-icon-css](https://github.com/lipis/flag-icon-css).
## Special thanks
Using only **1x1** or **4x3** formats will reduce the size to around `60kb`.
Special thanks to [flagkit](https://github.com/madebybowtie/FlagKit) for the best collection of svg flags out there!
## Credits
flagpack uses the [flagkit](https://github.com/madebybowtie/FlagKit) as the base for it's icons plus a few custom additions. if you are looking for flags for IOS & Android please use this library.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc