iconfont.scss 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. @charset "UTF-8";
  2. /*!
  3. * Tabler Icons <%= v %> by tabler - https://tabler.io
  4. * License - https://github.com/tabler/tabler-icons/blob/master/LICENSE
  5. */
  6. $ti-font-family: '<%= fileName %>' !default;
  7. $ti-font-path: './fonts' !default;
  8. $ti-font-display: null !default;
  9. $ti-prefix: 'ti' !default;
  10. @font-face {
  11. font-family: $ti-font-family;
  12. font-style: normal;
  13. font-weight: 400;
  14. font-display: $ti-font-display;
  15. src: url('#{$ti-font-path}/<%= fileName %>.woff2?v<%= v %>') format('woff2'),
  16. url('#{$ti-font-path}/<%= fileName %>.woff?') format('woff'),
  17. url('#{$ti-font-path}/<%= fileName %>.ttf?v<%= v %>') format('truetype');
  18. }
  19. .#{$ti-prefix} {
  20. font-family: $ti-font-family !important;
  21. speak: none;
  22. font-style: normal;
  23. font-weight: normal;
  24. font-variant: normal;
  25. text-transform: none;
  26. line-height: 1;
  27. /* Better Font Rendering */
  28. -webkit-font-smoothing: antialiased;
  29. -moz-osx-font-smoothing: grayscale;
  30. }
  31. @function unicode($str) {
  32. @return unquote("\"")+unquote(str-insert($str, "\\", 1))+unquote("\"")
  33. }
  34. <% glyphs.forEach(function(glyph) { %>
  35. $ti-icon-<%= glyph.name %>: unicode('<%= glyph.unicode[0].codePointAt(0).toString(16) %>');<% }); %>
  36. <% glyphs.forEach(function(glyph) { %>
  37. .#{$ti-prefix}-<%= glyph.name %>:before { content: $ti-icon-<%= glyph.name %>; }<% }); %>
  38. // Aliases
  39. <% Object.entries(aliases).forEach(function([from, to]) { %>.#{$ti-prefix}-<%= from %>:before { content: $ti-icon-<%= to %>; }
  40. <% }); %>