This library comes with own set of icons you can use in dui-button
, dui-input
and dui-icon
. All icons are available as SVGs and are compiled to a font file you should import in your angular config.
See Generate section for more information on how to add your own icons.
<dui-icon>
(source)These icons can be used right away.
To add additional icons to the set above you need to define each icon as SVG and put it all in one folder. The name of the svg file will be the name of your icon.
The structure should look like thatsrc/assets/icons ├── cluster.svg ├── dashboard.svg ├── dataset.svg ├── experiment_detail.svg ├── file.svg ├── logo.svg ├── plus.svg ├── projects.svg └── settings.svg └── 15_text-format-code.svg
15_text-format-bold
, 15_text-format-code
etc. Dui-icon automatically detects the size on that prefix. If you don't provide a prefix it uses 17px which only works correctly with 17x17 pixels, all other sizes will appear blurry. Optionally, you can specify on each dui-icon a size
input, but that is not recommended since that requires you to constantly think about the actual size of the icon, instead of the icon telling you on what pixel raster it works best. So, long story short: Use a prefix if not 17x17 px. node node_modules/@deepkit/desktop-ui/bin/create-font.js src/assets/icons
create-font.js
file generates in src/assets/fonts/
your new font files which you should import in your css: @font-face { font-family: 'Desktop UI icon Mono'; src: url("./assets/fonts/ui-icons.svg") format('svg'), url("./assets/fonts/ui-icons.woff") format('woff'), url("./assets/fonts/ui-icons.ttf") format('ttf'); font-weight: normal; font-style: normal; } .ui-icon { font-family: 'Desktop UI icon Mono' !important; font-weight: normal !important; font-style: normal !important; font-size: 17px; display: inline-block; line-height: 1; text-transform: none; letter-spacing: normal; word-wrap: normal; white-space: nowrap; direction: ltr; /* Support for all WebKit browsers. */ -webkit-font-smoothing: antialiased; /* Support for Safari and Chrome. */ text-rendering: optimizeLegibility; /* Support for Firefox. */ -moz-osx-font-smoothing: grayscale; /* Support for IE. */ font-feature-settings: 'liga'; }