2018-11-04 22:46:42 +01:00
|
|
|
// =============================================================================
|
|
|
|
// Mixins
|
|
|
|
// =============================================================================
|
|
|
|
// Please note that the mixins partial shouldn't include any classes. This is so
|
|
|
|
// it can be included in any file without accidentally producing output
|
|
|
|
|
|
|
|
// Turns on font-smoothing when used. Use sparingly.
|
|
|
|
@mixin font-smoothing {
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin clearfix() {
|
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
content: ' ';
|
|
|
|
display: table;
|
|
|
|
}
|
2022-02-04 12:57:55 +01:00
|
|
|
|
2018-11-04 22:46:42 +01:00
|
|
|
&:after {
|
|
|
|
clear: both;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin unlist() {
|
|
|
|
margin-top: 0;
|
|
|
|
margin-bottom: 0;
|
2022-03-15 14:21:06 +01:00
|
|
|
padding-inline-start: 0;
|
2018-11-04 22:46:42 +01:00
|
|
|
list-style-type: none;
|
|
|
|
font-style: normal;
|
2022-02-04 12:57:55 +01:00
|
|
|
|
|
|
|
li {
|
2018-11-04 22:46:42 +01:00
|
|
|
list-style-type: none;
|
|
|
|
font-style: normal;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// remove list styles, but only for the immediate element -
|
|
|
|
// allow nested lists inside it to keep the default style
|
|
|
|
|
|
|
|
@mixin unlistimmediate() {
|
|
|
|
margin-top: 0;
|
|
|
|
margin-bottom: 0;
|
2022-03-15 14:21:06 +01:00
|
|
|
padding-inline-start: 0;
|
2018-11-04 22:46:42 +01:00
|
|
|
list-style-type: none;
|
|
|
|
font-style: normal;
|
2022-02-04 12:57:55 +01:00
|
|
|
|
|
|
|
> li {
|
2018-11-04 22:46:42 +01:00
|
|
|
list-style-type: none;
|
|
|
|
font-style: normal;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin transition($transition...) {
|
|
|
|
body.ready & {
|
|
|
|
transition: $transition;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin visuallyhidden {
|
|
|
|
border: 0;
|
|
|
|
clip: rect(0 0 0 0);
|
|
|
|
height: 1px;
|
|
|
|
margin: -1px;
|
|
|
|
overflow: hidden;
|
|
|
|
padding: 0;
|
|
|
|
position: absolute;
|
|
|
|
width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin visuallyvisible {
|
2019-11-12 14:43:09 +01:00
|
|
|
clip: auto;
|
2018-11-04 22:46:42 +01:00
|
|
|
height: auto;
|
|
|
|
width: auto;
|
2019-11-12 14:43:09 +01:00
|
|
|
margin: initial;
|
2018-11-04 22:46:42 +01:00
|
|
|
overflow: visible;
|
|
|
|
position: initial;
|
|
|
|
}
|
|
|
|
|
2020-06-16 11:44:08 +02:00
|
|
|
@mixin svg-icon($size: 1.5em, $position: text-top) {
|
|
|
|
width: $size;
|
|
|
|
height: $size;
|
|
|
|
vertical-align: $position;
|
|
|
|
}
|
2018-11-04 22:46:42 +01:00
|
|
|
|
|
|
|
@mixin icon() {
|
|
|
|
@include font-smoothing;
|
2021-12-23 03:42:22 +01:00
|
|
|
font-family: $font-wagtail-icons;
|
2018-11-04 22:46:42 +01:00
|
|
|
font-style: normal;
|
|
|
|
font-weight: normal;
|
|
|
|
font-variant: normal;
|
|
|
|
speak: none;
|
|
|
|
text-decoration: none;
|
|
|
|
width: 1.3em;
|
|
|
|
line-height: 1em;
|
2022-03-15 14:21:06 +01:00
|
|
|
text-align: start;
|
2018-11-04 22:46:42 +01:00
|
|
|
vertical-align: middle;
|
2022-03-15 14:21:06 +01:00
|
|
|
margin-inline-end: 0.2em;
|
2018-11-04 22:46:42 +01:00
|
|
|
}
|
|
|
|
|
2022-02-01 02:49:55 +01:00
|
|
|
// Applies given rules on hover, for devices that support hover.
|
2018-11-04 22:46:42 +01:00
|
|
|
@mixin hover {
|
2022-02-01 02:49:55 +01:00
|
|
|
@media (hover: hover) {
|
|
|
|
a:hover {
|
|
|
|
@content;
|
|
|
|
}
|
2018-11-04 22:46:42 +01:00
|
|
|
}
|
|
|
|
}
|
2019-05-23 18:51:29 +02:00
|
|
|
|
|
|
|
// Where included, show the focus outline within focusable items instead of around them.
|
|
|
|
// This is useful when focusable items are tightly packed and there is no space in-between.
|
|
|
|
@mixin show-focus-outline-inside {
|
|
|
|
outline-offset: -1 * $focus-outline-width;
|
|
|
|
}
|