iconfont.scss 1.6 KB

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