0.6.8 • Published 6 months ago

@fabric-ds/icons v0.6.8

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Fabric Icons

The icon set for Fabric, imported from the Figma project.

Note that the icons in the "raw" folder in this repository should never be used directly, as they aren't optimized.

Usage

Elements

Using NPM package

Install dependencies

You will need to install both Fabric Elements and Lit Element which is the library we use for custom elements

npm install lit @fabric-ds/icons
Import elements

Import the individual element file, importing will load the component. Once imported, run your script through whatever bundling process your app uses (Rollup, Esbuild, etc) after which the component can be used in the page.

import '@fabric-ds/icons/elements/attachment-16';
import '@fabric-ds/icons/elements/attachment-24';
<f-icon-attachment16></f-icon-attachment16>
<f-icon-attachment24></f-icon-attachment24>

Development

Updating the icons

Icons should never be added or edited manually in this repository, as the source of truth is in Figma.

Figma access token

If you are running the import script for the first time, it will prompt your for a Figma access token. The token is is required to access Figma's API. It can be generated on your Figma account settings page.

The import script may store the token to a local file, so you won't have to supply the token again on subsequent runs.

Import script

To update the icons, run the following script. If it has a valid Figma access token (see above), it will proceed to download all the icons as SVG files.

./scripts/figma-import.js

Local preview

You can open a local preview of the icons. Use this to verify that the icons looks as they should. Run the following command.

npm run start

Publishing

If everything looks correct, publish the changes.

npm publish
git push --follow-tags

Eik

Eik versions for each of Vue, Elements and React icons are automatically created in the ./dist folder when builds are run. Eik configuration is based on values in package.json (name, version and eik keys) and running Eik publish will publish everything in the dist folder to Eik under the path https://assets.finn.no/pkg/{name}/{version}/.

Example Paths:

  • React: https://assets.finn.no/pkg/@fabric-ds/icons/v1/react/icons.min.js
  • Vue: https://assets.finn.no/pkg/@fabric-ds/icons/v1/vue/icons.min.js
  • Custom Elements: https://assets.finn.no/pkg/@fabric-ds/icons/v1/elements/icons.min.js
  • Raw ads svg at size 16: https://assets.finn.no/pkg/@fabric-ds/icons/v1/16/ads.svg
  • Raw air con svg at size 24: https://assets.finn.no/pkg/@fabric-ds/icons/v1/24/air-con.svg

Troubleshooting

Auth

If the scripts authentication issues, you could try to create a new access token and delete the local file .FIGMA_TOKEN before running the script again.

Figma project structure

The script is probably not resilient to changes in the structure of the Figma project. Changes there will probably require an update of the import script.

0.6.8

6 months ago

0.6.7

1 year ago

0.6.6

1 year ago

0.6.5

1 year ago

0.6.3

2 years ago

0.5.4

2 years ago

0.6.2

2 years ago

0.5.3

2 years ago

0.6.4

1 year ago

0.5.5

2 years ago

0.6.1

2 years ago

0.5.2

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.5.1

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.0

2 years ago

0.3.18

2 years ago

0.3.17

2 years ago

0.3.16

2 years ago

0.3.15

2 years ago

0.3.14

2 years ago

0.3.12

3 years ago

0.3.11

3 years ago

0.3.9

3 years ago

0.3.10

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago