3.9.1 • Published 3 days ago

@lansforsakringar/icons v3.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

Länsförsäkringar Icons

SVG icon library for Länsförsäkringar web development.

Full icon reference →

Table of contents

Getting started

npm install @lansforsakringar/icons

Usage

The library provides a set of SVG sprites, each containing a comprehensive list of icons. The sprites act as categories: different icon sizes, mono-color, or multi-color.

Because of CORS, the sprites will need to be self-hosted in your project. After installation, you need to copy the icon sprites to your code base from this package and make sure they are HTTP served. While the copy part can be done manually, it's easily done with a small script:

npm install copyfiles --save-dev

Add a script to your package.json.

"script": {
 "copy:icons": "copyfiles copyfiles -u 4 node_modules/@lansforsakringar/icons/dist/sprite/**/* src/icons"
}

Now, use the icons in your project.

<svg role="presentation" class="icon" width="20" height="20">
  <use xlink:href="{{path-to-icons}}/sprite/20/icons.svg#icon-wallet-20"></use>
</svg>

The .icon CSS class is part of Components and helps with sizing and alignment. Colors are controlled with the native CSS keyword currentColor.

Bugs and feature requests

If you wish to report a bug or submit a feature request, feel free to open an issue.

Contributing

After cloning the repo, install the dependencies and build the icons.

npm install
npm run build

Working with branches and pull requests

The latest and stable version is always in the main branch. New features and patches are then added through dedicated branches and pull requests.

When working on a new feature, begin by creating a new branch from main. After finishing your work, squash merge main into your branch and then create a pull request.

Please document the changes that you make in the pull request, along with potential changes to existing classes or variables that are to be added to a migration guide later on.

Adding an icon

Export your icon from Sketch or Figma. Make sure to use only filled outlines and in color #ff0000. The build script will replace that exact HEX with currentColor.

Place the new icon in src/{size} and build, npm run build.

Linting

The project uses standard. There are no automated tests beyond that.

npm test

Making a release

Releases to npm are manually done. Don't forget to run the build script before publishing a new release.

3.9.1

3 days ago

3.9.0

1 month ago

2.6.0

2 months ago

3.8.0

2 months ago

2.5.2

3 months ago

3.7.1

3 months ago

2.5.1

3 months ago

3.7.0

3 months ago

2.5.0

3 months ago

3.6.0

6 months ago

3.4.2

9 months ago

3.5.0

7 months ago

2.4.1

5 months ago

2.4.0

5 months ago

2.3.1

6 months ago

2.3.0-v9-patch

6 months ago

3.4.0

11 months ago

3.4.1

11 months ago

3.3.1

1 year ago

3.3.0

1 year ago

3.0.2

1 year ago

3.1.0

1 year ago

3.0.1

2 years ago

2.0.1

2 years ago

3.0.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago