1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 18:50:29 -04:00
jarv.is/assets/sass/components/_global.scss

144 lines
2.8 KiB
SCSS

@charset "UTF-8";
// Global Styles
body {
width: 100%;
height: 100%;
margin: 0 auto;
scroll-behavior: smooth;
// global base font size:
font-size: 0.975em;
}
// manually setting light/dark mode backgrounds and bulb icon
// really just the color of header & footer
body {
&.light {
background-color: map-get(map-get($themes, "light"), "background-outer");
button.dark-mode-toggle {
background-image: url($icon-bulb-on);
}
}
&.dark {
background-color: map-get(map-get($themes, "dark"), "background-outer");
button.dark-mode-toggle {
background-image: url($icon-bulb-off);
}
}
}
// stretch background for entire width of content area
main {
width: 100%;
padding: 0 1.5em;
@include colors() {
background-color: c(background-inner);
color: c(text);
}
}
// this is what's extended by different layouts (in ../pages)
div.layout {
max-width: $max-width;
margin: 0 auto;
display: block; // https://stackoverflow.com/questions/28794718/max-width-not-working-for-ie-11
}
// cool link underlines:
// https://www.dannyguo.com/blog/animated-multiline-link-underlines-with-css/
a {
text-decoration: none;
background-position: 0% 100%;
background-repeat: no-repeat;
background-size: 0% $link-underline-size;
padding-bottom: $link-underline-size;
transition: background-size 0.25s ease-in-out;
@include colors() {
color: c(links);
background-image: underline-hack(c(links));
}
&:hover {
background-size: 100% $link-underline-size;
}
&.no-underline {
background: none !important;
padding-bottom: 0;
}
}
b,
strong {
letter-spacing: 0.008em; // not sure why the discrepancy between weights
}
code,
pre,
.monospace {
letter-spacing: normal;
}
blockquote {
margin-left: 0;
padding-left: 1.5em;
border-left: 3px solid;
@include colors() {
color: c(medium-dark);
border-color: c(links);
}
}
hr {
margin: 1.5em auto;
height: 2px;
border: 0;
@include colors() {
background-color: c(light);
}
}
// make SVG twemojis relative to surrounding text
// https://github.com/twitter/twemoji#inline-styles
img.emoji {
height: 1.2em;
width: 1.2em;
margin: 0 0.05em;
vertical-align: -0.22em;
border: 0;
display: inline-block;
// have cursor act like it's hovering a regular unicode emoji, especially since twemojis can still be copied/pasted
cursor: text;
}
// need to manually unset text cursor above when emoji's within a link
a img.emoji {
cursor: inherit;
}
// Responsive
@mixin responsive--global() {
body {
// Safari iOS menu bar reappears below 44px:
// https://www.eventbrite.com/engineering/mobile-safari-why/
padding-bottom: 45px !important;
// Allows you to scroll below the viewport; default value is visible
overflow-y: scroll;
}
main {
padding-left: 1.25em;
padding-right: 1.25em;
}
}