_icons.scss 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. // The wagtail font isn't available in WOFF2, so a @font-face is set here without a mixin.
  2. @font-face {
  3. font-family: 'wagtail';
  4. src: url('#{$font-root}wagtail.woff') format('woff');
  5. font-weight: normal;
  6. font-style: normal;
  7. }
  8. // Set SVG icons to use the current text color in the location they appear as
  9. // their default fill color. Can be overridden for a specific icon by either
  10. // the color or fill properties.
  11. .icon {
  12. fill: currentColor;
  13. }
  14. .icon.teal {
  15. color: $color-teal;
  16. }
  17. .icon.white {
  18. color: #fff;
  19. }
  20. .icon:before,
  21. .icon:after,
  22. .hallotoolbar [class^='icon-'],
  23. .hallotoolbar [class*=' icon-']:before,
  24. .hallotoolbar [class^='icon-']:before {
  25. @include icon(); // from _mixins.scss
  26. }
  27. .icon:after,
  28. .hallotoolbar [class^='icon-']:after,
  29. .hallotoolbar [class^='icon-']:after {
  30. text-align: right;
  31. }
  32. .hallotoolbar [class^='icon-'],
  33. .hallotoolbar [class*=' icon-']:before,
  34. .hallotoolbar [class*=' icon-']:before,
  35. .hallotoolbar [class^='icon-']:before {
  36. vertical-align: -10%;
  37. margin-right: 0;
  38. }
  39. // =============================================================================
  40. // Icon factory methods
  41. // =============================================================================
  42. @each $icon, $content in $icons {
  43. .icon-#{$icon}:before {
  44. content: quote(#{$content});
  45. }
  46. }
  47. @each $icon, $content in $icons-after {
  48. .icon-#{$icon}:after {
  49. content: quote(#{$content});
  50. }
  51. }
  52. // =============================================================================
  53. // Custom config for various icons
  54. // =============================================================================
  55. .icon-download {
  56. // Credit: Icon made by Freepik from Flaticon.com
  57. }
  58. .icon-view:before,
  59. .icon-no-view:before { // icon-font
  60. vertical-align: -3.5px;
  61. font-size: 1.1rem;
  62. }
  63. .icon-spinner:after,
  64. .icon-spinner:before { // iconfont
  65. width: 1em;
  66. animation: spin-wag 0.5s infinite linear;
  67. display: inline-block;
  68. }
  69. svg.icon-spinner { // TODO: leave only class when iconfont styles are removed
  70. animation: spin-wag 0.5s infinite linear;
  71. }
  72. .icon-horizontalrule:before {
  73. font-family: Open Sans, Arial, sans-serif;
  74. }
  75. .icon-larger:before {
  76. font-size: 1.5em;
  77. }
  78. .icon.text-replace { // iconfont
  79. font-size: 0;
  80. line-height: 0;
  81. overflow: hidden;
  82. &:before {
  83. margin-right: 0;
  84. font-size: 1rem;
  85. display: inline-block;
  86. width: 100%;
  87. line-height: 1.2em;
  88. text-align: center;
  89. vertical-align: middle;
  90. }
  91. }
  92. .text-replace {
  93. font-size: 0;
  94. line-height: 0;
  95. overflow: hidden;
  96. .icon {
  97. @include svg-icon(1rem, middle);
  98. }
  99. }
  100. @keyframes spin-wag {
  101. 0% {
  102. transform: rotate(0deg);
  103. }
  104. 100% {
  105. transform: rotate(360deg);
  106. }
  107. }
  108. .icon-spinner:after {
  109. display: inline-block;
  110. line-height: 1;
  111. }
  112. // CSS-only circled question mark.
  113. // <span class="icon-help-inverse" aria-hidden="true"></span>
  114. .icon-help-inverse {
  115. $size: 15px;
  116. &:before {
  117. display: inline-block;
  118. width: $size;
  119. height: $size;
  120. line-height: $size;
  121. font-size: 1.1em;
  122. text-align: center;
  123. border-radius: 100%;
  124. color: $color-grey-2;
  125. border: 1px solid currentColor;
  126. }
  127. }
  128. .icon {
  129. &.initial {
  130. @include svg-icon(1em);
  131. vertical-align: initial;
  132. }
  133. &.default {
  134. @include svg-icon(1.5em);
  135. }
  136. &--flipped {
  137. transform: scaleX(-1);
  138. }
  139. }
  140. .icon.locale-error {
  141. vertical-align: text-top;
  142. margin-right: 0.5em;
  143. width: 1.5em;
  144. height: 1.5em;
  145. color: $color-red;
  146. }
  147. // Media for Windows High Contrast mode
  148. @media (forced-colors: $media-forced-colours) {
  149. .icon {
  150. fill: $system-color-link-text;
  151. }
  152. }