@sb1/ffe-icons 12.17.1 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -183
- package/bin/build.js +47 -59
- package/less/ffe-icons.less +2 -0
- package/less/icons.less +26 -0
- package/less/theme.less +14 -0
- package/package.json +7 -3
- package/CHANGELOG.md +0 -921
- package/dist/ffe-icons.svg +0 -10
- package/icons/atv-ikon.svg +0 -1
- package/icons/badekar-dusj-ikon.svg +0 -1
- package/icons/bamse-ikon.svg +0 -1
- package/icons/bankid-ikon.svg +0 -1
- package/icons/bat-liten-ikon.svg +0 -1
- package/icons/bat-stor-ikon.svg +0 -1
- package/icons/bestikk-ikon.svg +0 -1
- package/icons/beta-ikon.svg +0 -1
- package/icons/betaling-100-ikon.svg +0 -1
- package/icons/betaling-kontaktlos-ikon.svg +0 -1
- package/icons/betaling-kontaktlos-info-ikon.svg +0 -1
- package/icons/betalingskort-globus-ikon.svg +0 -1
- package/icons/betalingskort-hand-ikon.svg +0 -1
- package/icons/betalingskort-ikon.svg +0 -1
- package/icons/betalingskort-innpakket-ikon.svg +0 -1
- package/icons/betalingskort-kreditt-ikon.svg +0 -1
- package/icons/betalingskort-kryss-ikon.svg +0 -1
- package/icons/betalingskort-stjerne-ikon.svg +0 -1
- package/icons/bil-camping-ikon.svg +0 -1
- package/icons/bil-ikon.svg +0 -1
- package/icons/bil-pil-ikon.svg +0 -1
- package/icons/binders-ikon.svg +0 -1
- package/icons/blyant-ikon.svg +0 -1
- package/icons/boks-ikon.svg +0 -1
- package/icons/bsu-ikon.svg +0 -1
- package/icons/bygning-pluss-ikon.svg +0 -1
- package/icons/campingbil-ikon.svg +0 -1
- package/icons/campingvogn-ikon.svg +0 -1
- package/icons/chevron-ikon.svg +0 -1
- package/icons/dokument-avtalegiro-check-ikon.svg +0 -1
- package/icons/dokument-efaktura-ikon.svg +0 -1
- package/icons/dokument-hus-ikon.svg +0 -1
- package/icons/dokument-med-tekst-ikon.svg +0 -1
- package/icons/faks-printer-ikon.svg +0 -1
- package/icons/faks-printer-solid-ikon.svg +0 -1
- package/icons/familie-ikon.svg +0 -1
- package/icons/filter-ikon.svg +0 -3
- package/icons/flamme-ikon.svg +0 -1
- package/icons/fly-ikon.svg +0 -1
- package/icons/forstorrelsesglass-ikon-minus.svg +0 -1
- package/icons/forstorrelsesglass-ikon-pluss.svg +0 -1
- package/icons/forstorrelsesglass-ikon.svg +0 -1
- package/icons/fritidshus-ikon.svg +0 -1
- package/icons/gave-ikon.svg +0 -1
- package/icons/globe-ikon.svg +0 -1
- package/icons/graf-opp-enkel-ikon.svg +0 -1
- package/icons/graf-opp-ikon.svg +0 -1
- package/icons/gravemaskin-ikon.svg +0 -1
- package/icons/hake-ikon.svg +0 -1
- package/icons/hake-sirkel-ikon.svg +0 -1
- package/icons/hake-sirkel-solid-ikon.svg +0 -1
- package/icons/hake-stjerne-ikon.svg +0 -1
- package/icons/handlevogn-ikon.svg +0 -1
- package/icons/handlevogn-pakker-ikon.svg +0 -1
- package/icons/hengelas-ikon.svg +0 -1
- package/icons/hengelas-omriss-ikon.svg +0 -1
- package/icons/hjerte-ikon.svg +0 -1
- package/icons/hjerte-kardiograf-ikon.svg +0 -1
- package/icons/hus-enebolig-ikon.svg +0 -1
- package/icons/hus-hake-ikon.svg +0 -1
- package/icons/hus-hammer-ikon.svg +0 -1
- package/icons/hus-hjerte-ikon.svg +0 -1
- package/icons/hus-horisontaldelt-ikon.svg +0 -1
- package/icons/hus-ikon.svg +0 -1
- package/icons/hus-kjedet-ikon.svg +0 -1
- package/icons/hus-kr-ikon.svg +0 -1
- package/icons/hus-leilighet-ikon.svg +0 -1
- package/icons/hus-pil-opp-ikon.svg +0 -1
- package/icons/hus-pil-opp-ned-ikon.svg +0 -1
- package/icons/hus-pil-ut-ikon.svg +0 -1
- package/icons/hus-rekkehus-ikon.svg +0 -1
- package/icons/hus-stjerne-ikon.svg +0 -1
- package/icons/hus-tommer-ikon.svg +0 -1
- package/icons/hus-tre-ikon.svg +0 -1
- package/icons/hus-vertikaldelt-ikon.svg +0 -1
- package/icons/info-ikon.svg +0 -1
- package/icons/info-sirkel-ikon.svg +0 -1
- package/icons/info-sirkel-solid-ikon.svg +0 -1
- package/icons/kake-kvart-ikon.svg +0 -1
- package/icons/kakediagram-liten-bit-ikon.svg +0 -1
- package/icons/kalender-ikon.svg +0 -1
- package/icons/kalkulator-ikon.svg +0 -1
- package/icons/kartmarkor-ikon.svg +0 -1
- package/icons/katt-ikon.svg +0 -1
- package/icons/koffert-ikon.svg +0 -1
- package/icons/konfetti-ikon.svg +0 -1
- package/icons/kontorbygg-ikon.svg +0 -1
- package/icons/kontorbygg-solid-ikon.svg +0 -1
- package/icons/konvolutt-ikon.svg +0 -1
- package/icons/kopier-ikon.svg +0 -1
- package/icons/kr-armband-ikon.svg +0 -1
- package/icons/kr-hake-ikon.svg +0 -1
- package/icons/kr-klokke-ikon.svg +0 -1
- package/icons/kr-pil-ikon.svg +0 -1
- package/icons/kr-pil-solid-ikon.svg +0 -1
- package/icons/kr-pose-ikon.svg +0 -1
- package/icons/kr-sirkel-pil-ikon.svg +0 -1
- package/icons/kr-tannhjul-ikon.svg +0 -1
- package/icons/kryss-ikon.svg +0 -1
- package/icons/kryss-sirkel-ikon.svg +0 -1
- package/icons/kryss-sirkel-solid-ikon.svg +0 -1
- package/icons/laptop-ikon.svg +0 -1
- package/icons/lommebok-ikon.svg +0 -1
- package/icons/lys-mork-ikon.svg +0 -1
- package/icons/lyspare-ikon.svg +0 -1
- package/icons/mobil-a-b-c-ikon.svg +0 -1
- package/icons/mobil-ikon.svg +0 -1
- package/icons/mobil-snakkeboble-ikon.svg +0 -1
- package/icons/mobil-utropstegn-ikon.svg +0 -1
- package/icons/moped-ikon.svg +0 -1
- package/icons/motorsykkel-ikon.svg +0 -1
- package/icons/mynter-to-stabler-ikon.svg +0 -1
- package/icons/mynter-to-stabler-pluss-ikon.svg +0 -1
- package/icons/mynter-tre-stabler-ikon.svg +0 -1
- package/icons/nokkelhull-ikon.svg +0 -1
- package/icons/p-pose-ikon.svg +0 -1
- package/icons/p-pose-stjerne-ikon.svg +0 -1
- package/icons/paraply-ikon.svg +0 -1
- package/icons/pdf-ikon.svg +0 -1
- package/icons/person-brukket-arm-ikon.svg +0 -1
- package/icons/person-ikon.svg +0 -1
- package/icons/person-mikrofon-ikon.svg +0 -1
- package/icons/person-pluss-ikon.svg +0 -1
- package/icons/person-rullestol-ikon.svg +0 -1
- package/icons/person-slips-ikon.svg +0 -1
- package/icons/person-streker-ikon.svg +0 -1
- package/icons/personer-ikon.svg +0 -1
- package/icons/pil-ned-i-boks-ikon.svg +0 -1
- package/icons/pil-ned-ikon.svg +0 -1
- package/icons/pil-ut-av-boks-ikon.svg +0 -1
- package/icons/pil-ut-av-boks-skraa-ikon.svg +0 -1
- package/icons/piler-hoyre-venstre-ikon.svg +0 -1
- package/icons/plaster-ikon.svg +0 -1
- package/icons/pluss-ikon.svg +0 -1
- package/icons/pose-i-haand-ikon.svg +0 -1
- package/icons/pose-piler-hoyre-venstre-ikon.svg +0 -1
- package/icons/pose-trettien-ikon.svg +0 -1
- package/icons/robat-ikon.svg +0 -1
- package/icons/rundt-snakkeboble-ikon.svg +0 -1
- package/icons/seilbat-ikon.svg +0 -1
- package/icons/sirkel-1-2-3-ikon.svg +0 -1
- package/icons/skyskraper-ikon.svg +0 -1
- package/icons/snakkeboble-ikon.svg +0 -1
- package/icons/snoscooter-ikon.svg +0 -1
- package/icons/sofa-ikon.svg +0 -1
- package/icons/soppelkasse-ikon.svg +0 -1
- package/icons/soylediagram-ikon.svg +0 -1
- package/icons/soylediagram-med-pil-ikon.svg +0 -1
- package/icons/sparegris-ikon.svg +0 -1
- package/icons/spleis-ikon.svg +0 -1
- package/icons/sporsmalstegn-ikon.svg +0 -1
- package/icons/stetoskop-ikon.svg +0 -1
- package/icons/svar-pil-ikon.svg +0 -1
- package/icons/sykebil-ikon.svg +0 -1
- package/icons/tabell-kroner-ikon.svg +0 -1
- package/icons/taleassistent-ikon.svg +0 -1
- package/icons/tannhjul-ikon.svg +0 -1
- package/icons/tannhjul-solid-ikon.svg +0 -1
- package/icons/telefon-ikon.svg +0 -1
- package/icons/tommel-opp-ikon.svg +0 -1
- package/icons/traktor-ikon.svg +0 -1
- package/icons/tre-ikon.svg +0 -4
- package/icons/trillekoffert-ikon.svg +0 -1
- package/icons/understrek-1-2-3-ikon.svg +0 -1
- package/icons/ung-caps-ikon.svg +0 -1
- package/icons/ungdom-ikon.svg +0 -5
- package/icons/utropstegn-ikon.svg +0 -1
- package/icons/varebil-ikon.svg +0 -1
- package/icons/varsel-ikon.svg +0 -1
- package/icons/verktoy-skiftenokkel-ikon.svg +0 -1
- package/icons/widget-ikon.svg +0 -1
- package/icons/xls-ikon.svg +0 -1
package/README.md
CHANGED
|
@@ -1,187 +1,7 @@
|
|
|
1
1
|
# @sb1/ffe-icons
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Deprecated package
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package is deprecated, and will be removed from the designsystem repo.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Table of contents
|
|
10
|
-
|
|
11
|
-
- [Install](#install)
|
|
12
|
-
- [Usage](#usage)
|
|
13
|
-
- [Using the ffe-icons sprite](#using-the-ffe-icons-sprite)
|
|
14
|
-
- [Adding a new icon](#adding-a-new-icon)
|
|
15
|
-
- [Optimizing](#optimizing)
|
|
16
|
-
- [Naming](#naming)
|
|
17
|
-
- [Adding](#adding)
|
|
18
|
-
- [Useful resources](#useful-resources)
|
|
19
|
-
- [Links](#links)
|
|
20
|
-
- [Optimizing with Inkscape](#optimizing-with-inkscape)
|
|
21
|
-
- [Know issues](#known-issues)
|
|
22
|
-
|
|
23
|
-
## Install
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm install --save @sb1/ffe-icons
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
31
|
-
Full documentation on icon usage is available at https://design.sparebank1.no/komponenter/ikoner/.
|
|
32
|
-
|
|
33
|
-
See also `@sb1/ffe-icons-react`.
|
|
34
|
-
|
|
35
|
-
First add an `icons.json` file to your project where you define what icons you want. Additionally, you can
|
|
36
|
-
pass in options that [svg-sprite](https://github.com/jkphl/svg-sprite) support to override defaults.
|
|
37
|
-
|
|
38
|
-
Example `icons.json`:
|
|
39
|
-
|
|
40
|
-
```json
|
|
41
|
-
{
|
|
42
|
-
"dest": "app/",
|
|
43
|
-
"icons": [
|
|
44
|
-
"1-2-3-sirkel-ikon",
|
|
45
|
-
"bamse-ikon",
|
|
46
|
-
"dor-ikon",
|
|
47
|
-
"flamme-ikon",
|
|
48
|
-
"logo-sparebank1",
|
|
49
|
-
"twitter-ikon"
|
|
50
|
-
],
|
|
51
|
-
"config": {
|
|
52
|
-
"log": "error",
|
|
53
|
-
"mode": {
|
|
54
|
-
"symbol": {
|
|
55
|
-
"sprite": "awesome-icons.svg"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
To build your icon sprite, run the `ffe-icons` command using Node and pass the path to your `icons.json` as `--opts`.
|
|
63
|
-
It is recommended you add an npm-script to your `package.json` like so:
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"name": "awesome-client",
|
|
68
|
-
"scripts": {
|
|
69
|
-
...
|
|
70
|
-
"ffe:icons": "ffe-icons --opts=icons.json",
|
|
71
|
-
...
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Then, in your terminal:
|
|
77
|
-
|
|
78
|
-
`npm run ffe:icons`
|
|
79
|
-
|
|
80
|
-
A fresh SVG sprite should now have arrived at your destination.
|
|
81
|
-
|
|
82
|
-
Note: **it is recommended that you _not_ check the generated sprite into source control, but instead let ffe-icons
|
|
83
|
-
generate it at build-time.** This reduces the number of manual build steps, and keeps you up-to-date.
|
|
84
|
-
|
|
85
|
-
### Using the ffe-icons sprite
|
|
86
|
-
|
|
87
|
-
The primary color (royal blue) is removed from the SVG. This is so CSS can be used to override the color. To re-instate
|
|
88
|
-
royal blue as the primary color, add the following to your global icon class:
|
|
89
|
-
|
|
90
|
-
```css
|
|
91
|
-
.icon {
|
|
92
|
-
fill: '#002776'; // Or, even better:
|
|
93
|
-
fill: @ffe-blue-royal; // assuming use and import of ffe-core variables
|
|
94
|
-
|
|
95
|
-
// To add alternatives, replace the fill attribute with whatever color you need
|
|
96
|
-
&--white {
|
|
97
|
-
fill: #fff;
|
|
98
|
-
}
|
|
99
|
-
&--black {
|
|
100
|
-
fill: #000;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Non-royal blue colors are left as-is, so details in other colors are left untouched.
|
|
106
|
-
|
|
107
|
-
In your markup:
|
|
108
|
-
|
|
109
|
-
```html
|
|
110
|
-
<svg class="icon">
|
|
111
|
-
<use
|
|
112
|
-
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
113
|
-
xlink:href="/app/symbol/ffe-icons.svg#person-ikon"
|
|
114
|
-
></use>
|
|
115
|
-
<!-- <desc>Alt text goes here</desc> -->
|
|
116
|
-
</svg>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Finally, depending on the current state of browsers and support requirements you may need to include the
|
|
120
|
-
[SVG for Everybody](https://github.com/jonathantneal/svg4everybody) shim in your app.
|
|
121
|
-
|
|
122
|
-
## Adding a new icon
|
|
123
|
-
|
|
124
|
-
So you've decided to contribute to our icons collection - that's great news! However, before you get started you should always consider if your icon would be useful to others outside your app/team. If you need help making that decision, or have any other questions - feel free to reach out to us either on Slack (#ext-designsystem) or via [GitHub Issues](https://github.com/SpareBank1/designsystem/issues).
|
|
125
|
-
|
|
126
|
-
### Optimizing
|
|
127
|
-
|
|
128
|
-
Many of the most popular visual SVG editors tends to generate code that is _less than ideal_ for the web. In addition to larger files with unnecessary code, things like CSS might leak into other parts of your applications, or some wonky property might make your bundling system freak out. In other words - you should familiarize with the SVG code, and make sure you optimize it properly.
|
|
129
|
-
|
|
130
|
-
- Remove unecessary code and properties. Tools like [this online SVG editor](https://petercollingridge.appspot.com/svg-editor) might be easier than manually using your editor.
|
|
131
|
-
|
|
132
|
-
- Avoid using inline CSS. This might leak into other parts of your applications in addition to making it more complicated to control your from the outside. If you really have to use it - make sure the ID/classes you use are so unique that they wont interfer with any other styles.
|
|
133
|
-
|
|
134
|
-
- Avoid embedding the primary color, this should be controlled by CSS. Other colors that shouldn't be overridable might be emdedded in the file.
|
|
135
|
-
|
|
136
|
-
- The shape **must** fill the viewbox - minimum two edges of the square viewbox should be in contact with the shape. This is so margins can be fully controlled using CSS.
|
|
137
|
-
|
|
138
|
-
### Naming
|
|
139
|
-
|
|
140
|
-
You should **always name your icon according to what it is**, not what it will be used for. For example, let's say you have an icon picturing a wheelchair which you plan to use as a health insurance icon. Instead of naming it "health insurance" you should rather use "wheelchair". That way, another team could easilly re-use the same icon for their "accessibility" page.
|
|
141
|
-
|
|
142
|
-
### Adding
|
|
143
|
-
|
|
144
|
-
Once your icon is optimized and properly named, it's time to put it inside the `icons/` directory. At this point it might be a good idea to compare your icons to some existing ones. This might also be a good time to run `npm run build` to make sure everything works.
|
|
145
|
-
|
|
146
|
-
If you've made it this far, it's time to make a pull request. If this is your first time, you should read our [contribution guidelines](https://github.com/SpareBank1/designsystem/blob/develop/CONTRIBUTING.md) first.
|
|
147
|
-
|
|
148
|
-
## Useful resources
|
|
149
|
-
|
|
150
|
-
### Links
|
|
151
|
-
|
|
152
|
-
- [Online SVG Optimizer](https://petercollingridge.appspot.com/svg-editor)
|
|
153
|
-
- [Online SVG editor](https://github.com/SVG-Edit/svgedit)
|
|
154
|
-
- [SVGOMG](https://jakearchibald.github.io/svgomg/)
|
|
155
|
-
|
|
156
|
-
### Optimizing with Inkscape
|
|
157
|
-
|
|
158
|
-
1. Open the SVG file in Inkscape
|
|
159
|
-
2. SHIFT-CTRL-D Change the width and height to 200.
|
|
160
|
-
3. CTRL-A Select all elements.
|
|
161
|
-
4. SHIFT-CTRL-G Remove groups, (<g> elements). Repeat until no more groups.
|
|
162
|
-
5. CTRL-A and CTRL-'+' (Union) - Convert all elements to a single path. This may make the icon larger if the path is very complex.
|
|
163
|
-
6. SHIFT-CTRL-M Scale the icon until it fills the view box (vertical or horizontal), Hold SHIFT-CTRL to preserve ratio.
|
|
164
|
-
7. SHIFT-CTRL-S Save the icon as Optimized SVG
|
|
165
|
-
8. Open the icon in a text editor and check if it contains any transform attributes. If not, jump to 10.
|
|
166
|
-
9. Open the icon in http://editor.method.ac/ CTRL-A and choose Object->Reorient Path - This usually removes transforms. Save the file to disk.
|
|
167
|
-
10. Remove all metadata og unnecessary whitespace. The structure of the .svg file should be <svg viewBox="0 0 200 200" xmln"..."><path d="..."/></svg> [SVGOMG](https://jakearchibald.github.io/svgomg/) does a good job in removing cruft.
|
|
168
|
-
|
|
169
|
-
## Known issues
|
|
170
|
-
|
|
171
|
-
See the current status on browser support for SVG fragments on [caniuse.com](caniuse.com/svg-fragment).
|
|
172
|
-
|
|
173
|
-
- At time of writing, the generated SVG sprite cannot be used as a source for `background-image` in your CSS like "single" SVGs can
|
|
174
|
-
|
|
175
|
-
## Development
|
|
176
|
-
|
|
177
|
-
To start a local development server, run the following from the designsystem root folder:
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
npm install
|
|
181
|
-
npm run build
|
|
182
|
-
npm start
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
A local instance of `component-overview` with live reloading will run at http://localhost:1234/.
|
|
186
|
-
|
|
187
|
-
Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
|
|
7
|
+
To use the new set of icons, please refer to [ffe-symbols](https://github.com/SpareBank1/designsystem/tree/develop/packages/ffe-symbols) and/or [ffe-symbols-react](https://github.com/SpareBank1/designsystem/tree/develop/packages/ffe-symbols-react).
|
package/bin/build.js
CHANGED
|
@@ -1,60 +1,48 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict'; // eslint-disable-line strict
|
|
3
|
-
|
|
4
|
-
const fs = require('fs');
|
|
5
1
|
const path = require('path');
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const iconName = path.basename(fileName, '.svg');
|
|
54
|
-
sprite.add(iconName, fs.readFileSync(iconPath), 'utf-8');
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
mkdirp.sync(options.dest);
|
|
59
|
-
|
|
60
|
-
fs.writeFileSync(path.join(options.dest, 'ffe-icons.svg'), sprite.toString());
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const { makedirs } = require('./utils');
|
|
4
|
+
const { getIconNames } = require('./getIconNames');
|
|
5
|
+
const { getDownloads, downloadAll } = require('./downloadSvgs');
|
|
6
|
+
const {
|
|
7
|
+
createListOfRemovedIcons,
|
|
8
|
+
deleteRemovedIconsFiles,
|
|
9
|
+
} = require('./deleteSvg');
|
|
10
|
+
|
|
11
|
+
(async () => {
|
|
12
|
+
const weights = [300, 500];
|
|
13
|
+
const sizes = [
|
|
14
|
+
{ name: 'sm', opsz: 20 },
|
|
15
|
+
{ name: 'md', opsz: 24 },
|
|
16
|
+
{ name: 'lg', opsz: 40 },
|
|
17
|
+
{ name: 'xl', opsz: 48 },
|
|
18
|
+
];
|
|
19
|
+
const fill = [0, 1];
|
|
20
|
+
|
|
21
|
+
const iconNames = await getIconNames();
|
|
22
|
+
const listOfRemovedIcons = await createListOfRemovedIcons(iconNames);
|
|
23
|
+
let downloads = [];
|
|
24
|
+
|
|
25
|
+
for (const weight of weights) {
|
|
26
|
+
for (const fillValue of fill) {
|
|
27
|
+
const type = fillValue === 0 ? 'filled' : 'open';
|
|
28
|
+
for (const size of sizes) {
|
|
29
|
+
const dirPath = path.resolve(
|
|
30
|
+
__dirname,
|
|
31
|
+
`../icons/${weight}/${type}/${size.name}`,
|
|
32
|
+
);
|
|
33
|
+
if (!fs.existsSync(dirPath)) {
|
|
34
|
+
await makedirs(dirPath);
|
|
35
|
+
}
|
|
36
|
+
if (listOfRemovedIcons.length > 0) {
|
|
37
|
+
await deleteRemovedIconsFiles(listOfRemovedIcons, dirPath);
|
|
38
|
+
}
|
|
39
|
+
downloads = downloads.concat(
|
|
40
|
+
getDownloads(iconNames, weight, fillValue, size, dirPath),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
console.log('Downloading SVG files...');
|
|
46
|
+
await downloadAll(downloads);
|
|
47
|
+
console.log('All done!');
|
|
48
|
+
})();
|
package/less/icons.less
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.ffe-icons {
|
|
2
|
+
color: var(--ffe-v-icons-default-color);
|
|
3
|
+
mask-repeat: no-repeat;
|
|
4
|
+
background-color: currentColor;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
|
|
7
|
+
&--sm {
|
|
8
|
+
height: var(--ffe-v-icons-size-sm);
|
|
9
|
+
width: var(--ffe-v-icons-size-sm);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&--md {
|
|
13
|
+
height: var(--ffe-v-icons-size-md);
|
|
14
|
+
width: var(--ffe-v-icons-size-md);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&--lg {
|
|
18
|
+
height: var(--ffe-v-icons-size-lg);
|
|
19
|
+
width: var(--ffe-v-icons-size-lg);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--xl {
|
|
23
|
+
height: var(--ffe-v-icons-size-xl);
|
|
24
|
+
width: var(--ffe-v-icons-size-xl);
|
|
25
|
+
}
|
|
26
|
+
}
|
package/less/theme.less
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
:host {
|
|
3
|
+
--ffe-v-icons-size-sm: 20px;
|
|
4
|
+
--ffe-v-icons-size-md: 24px;
|
|
5
|
+
--ffe-v-icons-size-lg: 40px;
|
|
6
|
+
--ffe-v-icons-size-xl: 48px;
|
|
7
|
+
--ffe-v-icons-default-color: var(--ffe-farge-vann);
|
|
8
|
+
|
|
9
|
+
.native & {
|
|
10
|
+
@media (prefers-color-scheme: dark) {
|
|
11
|
+
--ffe-v-icons-default-color: var(--ffe-farge-vann-70);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-icons",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Felles Front End Icons",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
7
7
|
"bin": {
|
|
8
8
|
"ffe-icons": "bin/build.js"
|
|
9
9
|
},
|
|
10
|
+
"files": [
|
|
11
|
+
"less"
|
|
12
|
+
],
|
|
10
13
|
"repository": {
|
|
11
14
|
"type": "git",
|
|
12
15
|
"url": "ssh://git@github.com:SpareBank1/designsystem.git"
|
|
13
16
|
},
|
|
14
17
|
"scripts": {
|
|
15
|
-
"build": "
|
|
18
|
+
"build:": "",
|
|
19
|
+
"build:icons": "node bin/build.js",
|
|
16
20
|
"lint": "eslint bin",
|
|
17
21
|
"test": "npm run lint"
|
|
18
22
|
},
|
|
@@ -27,5 +31,5 @@
|
|
|
27
31
|
"publishConfig": {
|
|
28
32
|
"access": "public"
|
|
29
33
|
},
|
|
30
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "ec6e0f6b13650b53140c606652e102cb52209c2c"
|
|
31
35
|
}
|