0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
wagtail/client/scss/components/_icons.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

171 lines
3.2 KiB
SCSS
Raw Normal View History

@use 'sass:string';
@font-face {
font-family: $font-wagtail-icons;
src: url('../fonts/wagtail.woff') format('woff');
font-weight: normal;
font-style: normal;
}
// Set SVG icons to use the current text color in the location they appear as
// their default fill color. Can be overridden for a specific icon by either
// the color or fill properties.
.icon {
fill: currentColor;
}
.icon.teal {
color: $color-teal-darker;
}
2015-11-03 13:15:33 +01:00
.icon.white {
color: $color-white;
}
.icon:before,
2022-01-30 11:26:20 +01:00
.icon:after {
@include icon(); // from _mixins.scss
}
2015-11-03 13:15:33 +01:00
2022-01-30 11:26:20 +01:00
.icon:after {
text-align: end;
}
// =============================================================================
// Icon factory methods
// =============================================================================
2015-11-03 13:15:33 +01:00
@each $icon, $content in $icons {
.icon-#{$icon}:before {
content: string.quote(#{$content});
}
}
2015-11-03 13:15:33 +01:00
@each $icon, $content in $icons-after {
.icon-#{$icon}:after {
content: string.quote(#{$content});
}
}
2015-11-03 13:15:33 +01:00
// =============================================================================
// Custom config for various icons
// =============================================================================
.icon-download {
// Credit: Icon made by Freepik from Flaticon.com
2014-03-07 16:41:17 +01:00
}
2015-11-03 13:15:33 +01:00
.icon-view:before,
2020-06-15 13:31:05 +02:00
.icon-no-view:before {
// icon-font
vertical-align: -3.5px;
font-size: 1.1rem;
}
2015-11-03 13:15:33 +01:00
.icon-spinner:after,
2020-06-15 13:31:05 +02:00
.icon-spinner:before {
// iconfont
width: 1em;
animation: spin-wag 0.5s infinite linear;
display: inline-block;
}
2015-11-03 13:15:33 +01:00
// For SVG icons, add spinner styles onto the use element,
// so an icon can be turned into a spinner by changing the href only.
// This allows us to switch any icon to a spinner with much less boilerplate.
use[href='#icon-spinner'] {
animation: spin-wag 0.5s infinite linear;
transform-origin: center;
2020-06-15 13:31:05 +02:00
}
.icon-horizontalrule:before {
font-family: $font-sans;
}
2015-11-03 13:15:33 +01:00
.icon-larger:before {
font-size: 1.5em;
2015-02-13 11:38:40 +01:00
}
2020-06-15 12:06:29 +02:00
.icon.text-replace {
// iconfont
font-size: 0;
line-height: 0;
overflow: hidden;
&:before {
margin-inline-end: 0;
font-size: 1rem;
display: inline-block;
width: 100%;
line-height: 1.2em;
text-align: center;
vertical-align: middle;
}
}
2020-06-15 12:06:29 +02:00
.text-replace {
font-size: 0;
line-height: 0;
overflow: hidden;
.icon {
@include svg-icon(1rem, middle);
}
}
@keyframes spin-wag {
0% {
transform: rotate(0deg);
}
2015-11-03 13:15:33 +01:00
100% {
transform: rotate(360deg);
}
}
2015-11-19 07:05:57 +01:00
.icon-spinner:after {
display: inline-block;
line-height: 1;
}
// CSS-only circled question mark.
// <span class="icon-help-inverse" aria-hidden="true"></span>
.icon-help-inverse {
2018-02-14 09:16:01 +01:00
$size: 15px;
&:before {
2018-02-14 09:16:01 +01:00
display: inline-block;
width: $size;
height: $size;
line-height: $size;
font-size: 1.1em;
2018-02-14 09:16:01 +01:00
text-align: center;
border-radius: 100%;
color: $color-grey-2;
border: 1px solid currentColor;
}
}
2020-06-09 12:28:18 +02:00
// stylelint-disable-next-line no-duplicate-selectors
2020-06-09 12:28:18 +02:00
.icon {
&.initial {
@include svg-icon(1em);
vertical-align: initial;
}
&.default {
@include svg-icon(1.5em);
}
&--flipped {
transform: scaleX(-1);
}
2020-06-09 12:28:18 +02:00
}
2020-07-22 16:46:55 +02:00
.icon.locale-error {
vertical-align: text-top;
margin-inline-end: 0.5em;
2020-07-22 16:46:55 +02:00
width: 1.5em;
height: 1.5em;
color: theme('colors.critical.200');
2020-07-22 16:46:55 +02:00
}