_icons.styl 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. $font-path?= '<%= fontPath %>';
  2. $font-path= replace('\\', '/', $font-path);
  3. $font-path= replace('(\/|\\)+$', '', $font-path) + '/';
  4. @font-face
  5. font-family: "<%= fontName %>";
  6. src: url($font-path + '<%= fontName %>.eot?v=<%= fileVersion %>');
  7. src: url($font-path + '<%= fontName %>.eot?#iefix&v=<%= fileVersion %>') format('embedded-opentype'),
  8. url($font-path + '<%= fontName %>.woff2?v=<%= fileVersion %>') format('woff2'),
  9. url($font-path + '<%= fontName %>.woff?v=<%= fileVersion %>') format('woff'),
  10. url($font-path + '<%= fontName %>.ttf?v=<%= fileVersion %>') format('truetype'),
  11. url($font-path + '<%= fontName %>.svg#<%= fontName %>?v=<%= fileVersion %>') format('svg');
  12. font-weight: normal;
  13. font-style: normal;
  14. $framework ?= ''
  15. $prefix ?= '<%= prefix %>'
  16. if $framework == 'marxco'
  17. $fw-base-font-size-px = $base-font-size-px;
  18. $fw-base-font-size-em = $base-font-size-em;
  19. $fw-base-font-units = $base-font-units;
  20. $fw-border-radius = $border-radius;
  21. $fw-accent-color = $palette.accent;
  22. else if $framework == 'bulma-stylus-plus'
  23. $fw-base-font-size-px = $body-size;
  24. $fw-base-font-size-em = $body-font-size;
  25. $fw-base-font-units = unit($body-font-size);
  26. $fw-border-radius = $radius;
  27. $fw-accent-color = $primary;
  28. else
  29. $fw-base-font-size-px = 16px;
  30. $fw-base-font-size-em = 1em;
  31. $fw-base-font-units = 'em';
  32. $fw-border-radius = 3px;
  33. $fw-accent-color = #DF3132;
  34. _bfs9w0Lbt?= $conversion-ratios is defined ? unit($fw-base-font-size-px / $conversion-ratios['scale']['px'][$fw-base-font-units], $fw-base-font-units) : 1em;
  35. $ic-li-width?= 2 * _bfs9w0Lbt; //2em
  36. $ic-fw-width?= (1280 / 1024) * _bfs9w0Lbt; //1.25em
  37. $fw-icon-inverse= $framework == 'marxco' ? $palette.ic-inverse : #D8D8D8;
  38. .{$prefix}<%= selector %>
  39. display: inline-block;
  40. font-weight: normal !important;
  41. font-style: normal !important;
  42. font-variant: normal !important;
  43. font-family: '<%= fontName %>' !important;
  44. line-height: 1;
  45. text-rendering: auto;
  46. -webkit-font-smoothing: antialiased;
  47. -moz-osx-font-smoothing: grayscale;
  48. &--lg
  49. font-size: (($fw-base-font-size-em * 4) / 3);
  50. line-height: (($fw-base-font-size-em * 3) / 4);
  51. vertical-align: -0.0667em;
  52. &--xs
  53. font-size: $fw-base-font-size-em * .75;
  54. &--sm
  55. font-size: $fw-base-font-size-em * .875;
  56. if $framework == 'marxco'
  57. m_modular-steps();
  58. else
  59. &--footnotesize
  60. font-size: 0.5em;
  61. line-height: 0.75;
  62. &--small
  63. font-size: 0.7071em;
  64. line-height: 1.0607;
  65. &--big
  66. font-size: 1.4142em;
  67. line-height: 1.0607;
  68. &--large
  69. font-size: 2em;
  70. line-height: 0.9375;
  71. &--huge
  72. font-size: 2.8284em;
  73. line-height: 1.0607;
  74. &--great
  75. font-size: 4em;
  76. line-height: 1.0312;
  77. &--bizzaro
  78. font-size: 5.6569em;
  79. line-height: 0.9944;
  80. for i in 1..10
  81. &--{i}x { font-size: i * $fw-base-font-size-em; }
  82. // Fixed Width Icons
  83. &--fw
  84. width: $ic-fw-width;
  85. text-align: center;
  86. &--ul
  87. list-style-type: none;
  88. margin-left: 2.5rem;
  89. padding-left: 0rem;
  90. & > li
  91. position: relative;
  92. &--li
  93. left: -2em;
  94. position: absolute;
  95. text-align: center;
  96. width: 2em;
  97. line-height: inherit;
  98. // Bordered
  99. &--border
  100. border: solid .08em $fw-accent-color;
  101. border-radius: $fw-border-radius;
  102. padding: .2em .25em .15em;
  103. // Pulled
  104. &--pull
  105. &-left { float: left; }
  106. &-right { float: right; }
  107. ^[0]&-left { margin-right: .3em; }
  108. ^[0]&-right { margin-left: .3em; }
  109. // Stacked
  110. &-stack
  111. $stackMaxSteps = 2;
  112. display: inline-block;
  113. height: $fw-base-font-size-em * $stackMaxSteps;
  114. line-height: $fw-base-font-size-em * $stackMaxSteps;
  115. position: relative;
  116. vertical-align: middle;
  117. width: ($ic-fw-width * 2);
  118. $stackSteps = ()
  119. $rootName = selector();
  120. $commonStackStyle
  121. left: 0;
  122. position: absolute;
  123. text-align: center;
  124. width: 100%;
  125. for i in 1..$stackMaxSteps
  126. &-{i}x
  127. @extend {$rootName} $commonStackStyle;
  128. if i == 1
  129. line-height: inherit;
  130. else
  131. font-size: $fw-base-font-size-em * i;
  132. &-inverse
  133. color: $fw-icon-inverse;
  134. <% _.each(glyphs, function(glyph) { %> &-<%= glyph.name %>:before { content: "\<%= glyph.unicode[0].charCodeAt(0).toString(16).toUpperCase() %>" }
  135. <% }); %>