Giter Site home page Giter Site logo

lfui-icons's Introduction

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.

lfui-icons's People

Contributors

johanahlin avatar antontrollback avatar tornqvist avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.