Files
LifeFaq/static/sass/base/_typography.scss

250 lines
4.6 KiB
SCSS
Raw Permalink Normal View History

2024-12-10 16:40:38 +01:00
/* Type */
body, input, select, textarea {
color: _palette(fg);
font-family: _font(family);
2024-12-12 19:55:30 +01:00
font-size: 14pt;
2024-12-10 16:40:38 +01:00
font-weight: _font(weight);
line-height: 1.65;
@include breakpoint('<=xlarge') {
2024-12-12 19:55:30 +01:00
font-size: 14pt;
2024-12-10 16:40:38 +01:00
}
@include breakpoint('<=large') {
2024-12-12 19:55:30 +01:00
font-size: 12pt;
2024-12-10 16:40:38 +01:00
}
@include breakpoint('<=xxsmall') {
2024-12-12 19:55:30 +01:00
font-size: 12pt;
2024-12-10 16:40:38 +01:00
}
}
a {
@include vendor('transition', (
'color #{_duration(transition)} ease-in-out',
'border-bottom-color #{_duration(transition)} ease-in-out'
));
border-bottom: dotted 1px;
color: _palette(accent);
text-decoration: none;
&:hover {
border-bottom-color: _palette(accent);
color: _palette(accent) !important;
strong {
color: inherit;
}
}
}
strong, b {
color: _palette(fg-bold);
font-weight: _font(weight-bold);
}
em, i {
font-style: italic;
}
p {
margin: 0 0 _size(element-margin) 0;
}
h1, h2, h3, h4, h5, h6 {
color: _palette(fg-bold);
font-family: _font(family-heading);
font-weight: _font(weight-heading);
line-height: 1.5;
margin: 0 0 (_size(element-margin) * 0.5) 0;
a {
color: inherit;
text-decoration: none;
border-bottom: 0;
}
}
h1 {
font-size: 4em;
margin: 0 0 (_size(element-margin) * 0.25) 0;
line-height: 1.3;
}
h2 {
font-size: 1.75em;
}
h3 {
font-size: 1.25em;
}
h4 {
font-size: 1.1em;
}
h5 {
font-size: 0.9em;
}
h6 {
font-size: 0.7em;
}
@include breakpoint('<=xlarge') {
h1 {
font-size: 3.5em;
}
}
@include breakpoint('<=medium') {
h1 {
font-size: 3.25em;
}
}
@include breakpoint('<=small') {
h1 {
font-size: 2em;
line-height: 1.4;
}
h2 {
font-size: 1.5em;
}
}
sub {
font-size: 0.8em;
position: relative;
top: 0.5em;
}
sup {
font-size: 0.8em;
position: relative;
top: -0.5em;
}
blockquote {
border-left: solid 3px _palette(border);
font-style: italic;
margin: 0 0 _size(element-margin) 0;
padding: (_size(element-margin) / 4) 0 (_size(element-margin) / 4) _size(element-margin);
}
code {
background: _palette(border-bg);
border-radius: _size(border-radius);
border: solid 1px _palette(border);
font-family: _font(family-fixed);
font-size: 0.9em;
margin: 0 0.25em;
padding: 0.25em 0.65em;
}
pre {
-webkit-overflow-scrolling: touch;
font-family: _font(family-fixed);
font-size: 0.9em;
margin: 0 0 _size(element-margin) 0;
code {
display: block;
line-height: 1.75;
padding: 1em 1.5em;
overflow-x: auto;
}
}
hr {
border: 0;
border-bottom: solid 1px _palette(border);
margin: _size(element-margin) 0;
&.major {
margin: (_size(element-margin) * 1.5) 0;
}
}
.align-left {
text-align: left;
}
.align-center {
text-align: center;
}
.align-right {
text-align: right;
2024-12-12 19:55:30 +01:00
}
// #################################3
// Markdown pages styling
// #################################3
// Define a mixin for shared heading styles
@mixin shared-heading-styles($font-size) {
font-size: $font-size;
margin: 0 0 (_size(element-margin) * 0.25) 0;
line-height: 1.3;
color: _palette(fg-bold); // Assuming this is in your general h1
font-family: _font(family-heading);
font-weight: _font(weight-heading);
}
// Apply the mixin for h1
main > section > div > h1 {
@include shared-heading-styles(1.5em);
}
// Apply the mixin for h2, h3, and h4 with adjusted font sizes
main > section > div > h2 {
@include shared-heading-styles(1.2em);
}
main > section > div > h3 {
@include shared-heading-styles(1.1em);
}
main > section > div > h4 {
@include shared-heading-styles(1.0em);
}
main > section > div > h4 {
}
2024-12-13 21:52:50 +01:00
small > em {
font-size: 1.4rem; // Standard size for line-height control
line-height: 1.4rem; // Maintain exact line spacing
transform: scale(0.75); // Scale text down to 75%
display: inline-block; // Required for proper box rendering
color: rgba(0, 0, 0, 0.20); // Light text color
font-family: _font(family-heading);
font-weight: 300;
font-style: italic;
max-width: 20vh;
2024-12-13 21:52:50 +01:00
// Add light borders
border: 1px solid rgba(0, 0, 0, 0.1); // Light, subtle border
border-radius: 8px;
padding: 0.25em 0.5em; // Padding inside the box
// Allow text to flow around it
float: right; // Box floats to the right
margin: 0 0 0.25em 0.25em; // Add spacing around the box
2024-12-13 21:52:50 +01:00
background-color: rgba(0, 0, 0, 0.01); // Optional: Light background for contrast
@include breakpoint('<=xlarge') {
transform: scale(0.65);
}
@include breakpoint('<=medium') {
transform: scale(0.55);
}
@include breakpoint('<=small') {
transform: scale(0.50);
}
2024-12-13 21:52:50 +01:00
}