Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ptsecurity/mosaic-icons) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Mosaic Icons
Installation in frontend code
Note that Mosaic Icons is optional package and it should be installed manually.
NPM
npm install @ptsecurity/mosaic-icons --save
Yarn
yarn add @ptsecurity/mosaic-icons
Then you should add icons styles:
@import "~@ptsecurity/mosaic-icons/dist/styles/mc-icons.css";
And finally import McIconModule to your component module.
import { McIconModule } from '@ptsecurity/mosaic';
@NgModule({
imports: [
McIconModule,
...
],
})
export class AppModule {}If mc-icons.css does't suit your project, you can also add:
- mc-icons.less;
- mc-icons-embed.css with embedded font included.
Variants
There are two icon usage variants:
<i mc-icon="mc-gear_16"></i>;In this case you can provide
[color]attribute. It can have following values: primary, second, error.Simply
<i class="mc mc-gear_16"></i>.
Icons pack version building and publishing (macOS)
Install some required software
Install brew (http://brew.sh/index_ru.html):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Install font tools with brew:
brew install ttfautohint fontforgeInstall node.js. Download stable LTS version from here: https://nodejs.org/en/.
Install grunt
sudo npm install -g grunt-cliYou'll be asked for the password, it's your local macOS password.
Building
- Open figma file figma.com/file/oQC47kSeukdqLMNh4IUhke/Mosaic-icons, craft icon. Make icon ready for iconpack: flatten, outline, name by convention.
- Build pack:
grunt.
Publish version to npm repository
- Open figma file figma.com/file/oQC47kSeukdqLMNh4IUhke/Mosaic-icons, craft icon. Make icon ready for iconpack: flatten, outline, name by convention.
- Build pack:
grunt. First time you will be asked to enter figma access token, you can create it in the Figma profile. (Sometimes due to some issues with network access to Amazon S3 some external VPN coudld be helpful) - Add new icon names to Gruntfile.js into codepoints section. Add synonyms to tags. Attention: all codes are hex: 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10.
- Check icons rendering in html preview. New icons must be correct both in webfont and svg sprite previews.
- Check glyph code with opentype.js (https://opentype.js.org/glyph-inspector.html). Correct: No symbols with codes F7хх.
- Add changes to CHANGELOG.md.
- Change version in package.json.
- Change version in Gruntfile.js.
- Commit svg files, package.json, Gruntfile.js and CHANGELOG.md. Commit message: Bumped version number to %version%. CI will build and publish to npm repository new package version.
You are free to drink a cup of coffee.