@duetds/icons
v4.0.55
Published
This package includes Duet Design System Icons and related utilities.
Downloads
4,380
Readme
Duet Icons
This package includes Duet Icons and related tools.
Usage
For usage instructions, please see Duet Design System documentation.
Architecture
This package uses sass-lint, svglint, jsonlint to lint.
The file scripts/prepublish.js
is used to build the package for publishing.
On build, each icon under the assets
directory is converted to an individual CommonJS module. Each of these modules exports an object matching the following type:
type DuetIcon = {
tags: string // space-separated list of tags
title: string
svg: string
}
A Typescript type DuetIconName
is exposed which enumerates all icon names:
type DuetIconName = "action-add" | "action-add-small" // etc
The main
file of the package exports a single object, containing all icons, which conforms to the following type:
type DuetIcons = Record<DuetIconName, DuetIcon>
Adding new icons
- Name new SVG icons following Duet’s icon naming guidelines and put them inside
src/assets
directory. - If SVG Icon has not been optimized it must be done with either SVGO in command line or in web version of SVGO. Use default settings on web.
- Next, run
npm run tags
which will assist you in adding tags for any new icons. - Finally, run
npm run build
to generate a new build.
Copyright
Copyright © 2020 LocalTapiola/Turva.