sass-site/source/assets/sass/visual-design/_typography.scss

223 lines
3.1 KiB
SCSS
Raw Normal View History

2023-02-21 21:44:48 +01:00
@use '../config';
2023-01-12 19:19:42 +01:00
2023-01-06 22:40:29 +01:00
$sl-font-weights: (
'light': var(--sl-font-weight--light),
'regular': var(--sl-font-weight--regular),
'bold': var(--sl-font-weight--bold),
);
$sl-font-families: (
'text': var(--sl-font-family--text),
'display': var(--sl-font-family--display),
'code': var(--sl-font-family--code),
2023-01-06 22:40:29 +01:00
);
2023-01-09 20:10:02 +01:00
@each $name, $value in $sl-font-weights {
.sl-font-weight--#{$name} {
font-weight: $value;
}
2023-01-06 22:40:29 +01:00
}
2023-01-09 20:10:02 +01:00
@each $name, $value in $sl-font-families {
.sl-font-family--#{$name} {
font-family: $value;
}
2023-01-06 22:40:29 +01:00
}
body,
h5,
2023-01-09 20:10:02 +01:00
h6 {
font-size: var(--sl-font-size--medium);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
body {
line-height: 1.5;
font-family: var(--sl-font-family--text);
2023-01-09 23:19:15 +01:00
text-rendering: optimizelegibility;
2023-01-06 22:40:29 +01:00
}
2023-01-09 20:10:02 +01:00
* {
min-width: 0;
}
2023-01-06 22:40:29 +01:00
2023-01-09 20:10:02 +01:00
a {
text-decoration: none;
}
2023-01-06 22:40:29 +01:00
strong,
b,
h5,
h6,
dt,
tbody th,
2023-01-09 20:10:02 +01:00
label {
font-weight: var(--sl-font-weight--bold);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
h1,
h2,
caption,
h3,
h4,
h5,
h6,
p,
ul,
ol,
dl,
figure,
details {
margin: var(--sl-type-margin-block, var(--sl-gutter)) 0;
2023-01-06 22:40:29 +01:00
padding: 0;
}
h2,
h3,
h4,
h5,
h6 {
margin-top: var(--sl-gutter--double-sesqui);
2023-01-06 22:40:29 +01:00
2023-01-09 20:10:02 +01:00
aside &,
nav & {
margin-top: var(--sl-gutter);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
}
ul,
ol,
2023-01-09 20:10:02 +01:00
dd {
margin-left: 1.75rem;
}
2023-01-06 22:40:29 +01:00
h1,
h2,
caption,
h3,
h4,
h5,
h6 {
font-weight: var(--sl-font-weight--regular);
2023-01-06 22:40:29 +01:00
line-height: 1.25;
}
h1,
h2,
2023-01-09 20:10:02 +01:00
caption {
2023-02-20 21:54:31 +01:00
letter-spacing: -0.03125em;
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
h1,
2023-01-09 20:10:02 +01:00
h2 {
font-weight: var(--sl-font-weight--light);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
h1 {
margin-top: 0;
2023-02-20 21:54:31 +01:00
font-size: var(--h1-size, var(--sl-font-size--xx-large));
2023-01-06 22:40:29 +01:00
line-height: 1;
text-align: center;
@include config.sl-breakpoint--medium {
2023-06-13 16:44:48 +02:00
font-size: var(
--h1-size-md,
var(--h1-size, var(--sl-font-size--xxx-large))
);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
@include config.sl-breakpoint--large {
2023-06-13 16:44:48 +02:00
font-size: var(
--h1-size-lg,
var(--h1-size, var(--sl-font-size--xxxx-large))
);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
}
h2,
caption,
legend,
h3,
2023-01-09 20:10:02 +01:00
thead th {
font-family: var(--sl-font-family--display);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
h2,
caption {
font-size: var(--h2-size, var(--sl-font-size--x-large));
2023-01-06 22:40:29 +01:00
@include config.sl-breakpoint--medium {
--h2-size: var(--sl-font-size--xx-large);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
@include config.sl-breakpoint--large {
--h2-size: var(--sl-font-size--xxx-large);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
}
h3,
2023-01-09 20:10:02 +01:00
h4 {
font-size: var(--sl-font-size--large);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
nav,
2023-01-09 20:10:02 +01:00
footer {
font-size: var(--sl-font-size--small);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
.caps {
font-size: var(--sl-font-size--caps, var(--sl-font-size--smaller));
letter-spacing: var(--sl-letter-spacing--caps, 0.0625em);
2023-01-06 22:40:29 +01:00
line-height: 0;
2023-02-21 18:40:34 +01:00
text-transform: uppercase;
2023-01-06 22:40:29 +01:00
}
code,
pre {
font-family: var(--sl-font-family--code);
2023-01-06 22:40:29 +01:00
}
code {
// Scale the code font size down, because the font itself is much larger.
2023-02-21 18:40:34 +01:00
font-size: var(--sl-font-size--smaller);
2023-01-06 22:40:29 +01:00
line-height: 1;
2023-01-09 20:10:02 +01:00
nav & {
white-space: nowrap;
}
2023-01-09 23:19:15 +01:00
2023-01-06 22:40:29 +01:00
p & {
@include config.sl-breakpoint--x-large {
2023-01-09 20:10:02 +01:00
white-space: nowrap;
}
2023-01-06 22:40:29 +01:00
}
}
pre {
font-size: var(--sl-font-size--x-small);
padding: var(--sl-gutter--minus) var(--sl-gutter);
2023-01-06 22:40:29 +01:00
overflow: auto;
white-space: pre-wrap;
code {
2023-02-21 18:26:26 +01:00
font-size: inherit;
2023-01-06 22:40:29 +01:00
line-height: inherit;
}
}
img {
display: block;
height: auto;
2023-03-24 03:30:45 +01:00
margin-left: auto;
margin-right: auto;
max-width: 100%;
2023-01-06 22:40:29 +01:00
}
hr {
2023-03-24 03:30:45 +01:00
margin-bottom: var(--sl-gutter--triple);
margin-top: var(--sl-gutter--triple);
2023-01-06 22:40:29 +01:00
}
2023-01-09 20:10:02 +01:00
dd {
margin: 0;
}