soapbox/app/styles/fonts.scss

83 wiersze
2.4 KiB
SCSS
Czysty Zwykły widok Historia

@use 'sass:math';
2020-03-27 20:59:38 +00:00
// OpenDyslexic
@font-face {
font-family: 'OpenDyslexic';
src: url('../fonts/OpenDyslexic/OpenDyslexic-Regular.woff2') format('woff2');
}
2020-03-27 20:59:38 +00:00
@font-face {
font-family: 'OpenDyslexic';
2020-04-11 19:52:41 +00:00
font-weight: bold;
src: url('../fonts/OpenDyslexic/OpenDyslexic-Bold.woff2') format('woff2');
2020-03-27 20:59:38 +00:00
}
2020-03-27 20:59:38 +00:00
@font-face {
2020-04-11 19:52:41 +00:00
font-family: 'OpenDyslexic';
font-weight: bold;
font-style: italic;
src: url('../fonts/OpenDyslexic/OpenDyslexic-Bold-Italic.woff2') format('woff2');
2020-03-27 20:59:38 +00:00
}
2020-03-27 20:59:38 +00:00
@font-face {
2020-04-11 19:52:41 +00:00
font-family: 'OpenDyslexic';
font-style: italic;
src: url('../fonts/OpenDyslexic/OpenDyslexic-Italic.woff2') format('woff2');
2020-03-27 20:59:38 +00:00
}
// TYPEOGRAPHY MIXINS
// declare the font family using these shortcuts
2022-03-21 18:09:01 +00:00
@mixin font-inter { font-family: 'Inter', Arial, sans-serif !important; }
2020-03-27 20:59:38 +00:00
// Declare font weights as a numerical value in rendered output
// Prevents certain browsers which do not play nice with "light, medium" textual declarations
// Numeical values always work more consistently across browsers
// Each font-weight is linked with the @font-face declaration to the actual font file
@mixin font-weight($weight) {
@if $weight == 'light' { font-weight: 300; }
@if $weight == 'normal' { font-weight: 400; }
@if $weight == 'medium' { font-weight: 500; }
@if $weight == 'bold' { font-weight: 700; }
@if $weight == 'extrabold' { font-weight: 800; }
2020-04-11 19:52:41 +00:00
}
2020-03-27 20:59:38 +00:00
// Use these mixins to define font-size and line-height
// html and body declaration allows developer to pass px value as argument
// Rendered css will default to "rem" and fall back to "px" for unsupported browsers
@mixin font-size($size) {
$rem: math.div($size, 10);
2020-04-11 19:52:41 +00:00
$px: $size;
font-size: #{$px + "px"};
font-size: #{$rem + "rem"};
}
2020-03-27 20:59:38 +00:00
@mixin line-height($size) {
$rem: math.div($size, 10);
2020-04-11 19:52:41 +00:00
$px: $size;
line-height: #{$px + "px"};
line-height: #{$rem + "rem"};
}
2020-03-27 20:59:38 +00:00
2020-06-10 01:14:18 +00:00
// Soapbox icon font
2020-03-27 20:59:38 +00:00
@font-face {
2020-06-10 01:14:18 +00:00
font-family: 'soapbox';
src: url('../fonts/soapbox/soapbox.eot?pryg6i');
src: url('../fonts/soapbox/soapbox.eot?pryg6i#iefix') format('embedded-opentype'),
2020-06-10 01:14:18 +00:00
url('../fonts/soapbox/soapbox.ttf?pryg6i') format('truetype'),
url('../fonts/soapbox/soapbox.woff?pryg6i') format('woff'),
url('../fonts/soapbox/soapbox.svg?pryg6i#soapbox') format('svg');
2020-03-27 20:59:38 +00:00
font-weight: normal;
font-style: normal;
}
2020-05-29 00:58:37 +00:00
.fa-fediverse::before {
font-family: 'soapbox';
2020-03-27 20:59:38 +00:00
content: "\e901";
}
.fa-spinster::before {
font-family: 'soapbox';
content: "\e900";
}