erynwells.me/static/styles/main.css
Eryn Wells 501dc6ed51 Rearrange the post header
Dates will flow below the header if the header is too long.

Move the draft up to the top, above the header.
2022-03-25 23:24:29 -07:00

465 lines
7.2 KiB
CSS

/* main.css
* Global stylesheet for erynwells.me
* Eryn Wells <eryn@erynwells.me>
*/
:root {
--header: 8rem;
--footer: calc(8rem + var(--safe-bottom));
--light: white;
--dark: rgb(22, 22, 22);
--highlight-color: rgb(50, 186, 228);
--hljs-bg: #111;
--safe-bottom: 0;
--body-padding: 4rem;
--body-width: 80rem;
--body-background-color: var(--light);
--body-foreground-color: var(--dark);
--heading-color: var(--body-foreground-color);
--link-color: var(--highlight-color);
--menu-icon-size: 20px;
--social-menu-padding: 1rem;
--tag-text-color: var(--dark);
--tag-background-color: #eee;
--tag-hover-background-color: #bbb;
--separator-color: #888;
--twitter-icon: url(/icons/twitter.svg);
--github-icon: url(/icons/github.svg);
--instagram-icon: url(/icons/instagram.svg);
--rss-icon: url(/icons/rss.svg);
}
@media (prefers-color-scheme: dark) {
:root {
--body-background-color: var(--dark);
--body-foreground-color: var(--light);
--tag-text-color: #aaa;
--tag-background-color: rgb(40, 40, 40);
--tag-hover-background-color: rgb(73, 73, 73);
--twitter-icon: url(/icons/twitter-dark.svg);
--github-icon: url(/icons/github-dark.svg);
--instagram-icon: url(/icons/instagram-dark.svg);
--rss-icon: url(/icons/rss-dark.svg);
}
}
a {
color: var(--link-color);
text-decoration: none;
}
a:hover {
text-decoration: underline;
text-underline-position: from-font;
}
body {
background-color: var(--body-background-color);
color: var(--body-foreground-color);
display: flex;
flex-direction: column;
font-size: 2rem;
line-height: 1.2;
margin: 0 auto;
max-width: var(--body-width);
padding: 0 var(--body-padding);
}
figcaption h4 {
margin-bottom: 0;
}
figure {
border: 1px solid var(--separator-color);
border-radius: 0.5rem;
display: inline-block;
margin: 0;
padding: 1rem;
}
figure a,
figure a:hover {
border: 0;
}
figure img {
border-radius: 0.5rem;
height: auto;
max-width: 100%;
margin-bottom: -3px;
}
figure + p {
margin-top: 1rem;
}
figure .youtube {
line-height: 1;
overflow: hidden;
width: calc(var(--body-width) - 2rem);
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'SF Pro Rounded', ui-rounded, 'Arial Rounded MT', system-ui, -apple-system, sans-serif;
/*font-family: Palatino, Rockwell, Courier;*/
font-weight: 600;
letter-spacing: 2px;
}
html {
font-family: 'SF Pro', sans-serif;
font-size: 8px;
}
img {
height: auto;
max-width: 100%;
}
p {
line-height: 1.4;
}
.header,
.footer {
padding: 2rem 0;
}
/*
* Header
*/
.header {
align-items: baseline;
border-bottom: 1px solid var(--separator-color);
display: flex;
flex-direction: row;
}
.header h1 {
margin: 0;
margin-right: 2rem;
font-size: 4.5rem;
}
.header h1 a {
color: var(--heading-color);
text-decoration: none;
}
.header h1 a:hover {
border: 0;
}
.menu > a + a:before {
color: var(--heading-color);
content: "•";
padding: 0 0.5rem;
}
.menu menu,
.social menu {
display: inline-block;
list-style-type: none;
margin: 0;
padding: 0;
text-transform: lowercase;
}
.menu menu li,
.social menu li {
display: inline-block;
letter-spacing: 2px;
}
.menu menu li + li:before,
.social menu li + li:before {
font-size: 1.5rem;
margin-right: 0.5rem;
}
.menu menu li + li:before {
content: "•";
}
.social menu li + li {
margin-left: var(--social-menu-padding);
}
.social {
display: flex;
letter-spacing: 2px;
margin-left: auto;
}
.social a {
background-image: var(--url);
background-repeat: no-repeat;
background-size: var(--menu-icon-size);
display: block;
height: var(--menu-icon-size);
width: var(--menu-icon-size);
}
.social a span {
display: none;
}
.social > li + li:before {
color: var(--dark);
padding: 0 0.5rem;
}
.title-and-menu {
align-items: baseline;
display: flex;
flex-direction: row;
}
.youtube iframe {
aspect-ratio: 16 / 9;
margin-bottom: -3px;
width: 100%;
}
@media (max-width: 475px) {
:root {
--menu-icon-size: 18px;
--social-menu-padding: 0.5rem;
}
.menu {
margin-top: 1rem;
}
.social {
margin-top: 1rem;
}
.title-and-menu {
align-items: flex-start;
flex-direction: column;
}
}
@media (max-width: 320px) {
.header h1 {
font-size: 3.5rem;
}
}
/*
* Footer
*/
.footer {
align-items: center;
border-top: 1px solid var(--separator-color);
display: flex;
flex-direction: column;
font-size: 1.8rem;
text-align: center;
}
.footer p {
margin: 0;
}
.footer p + p {
margin-top: 0.25rem;
}
@media (max-width: 740px) {
.slogans span {
white-space: nowrap;
}
}
/*
* Main
*/
.main > header {
align-items: baseline;
display: flex;
}
.main {
margin: 3.5rem 0;
}
.main :first-child {
margin-top: 0;
}
.main h1 {
font-size: 3.5rem;
}
.main h1,
.main h2,
.main h3,
.main h4,
.main h5,
.main h6 {
margin-top: 3.5rem;
margin-bottom: 2rem;
}
.main figcaption h4 {
margin-bottom: 0;
}
.main p:last-child {
margin-bottom: 0;
}
.main .main-title {
margin-bottom: 0;
}
.post-list {
margin-top: 1rem;
}
.post-list h1,
.post-list h2,
.post-list h3,
.post-list h4,
.post-list h5,
.post-list h6 {
display: inline;
margin: 0;
}
.post-list h2 {
font-size: 2.5rem;
}
.post-list li + li {
margin-top: 2rem;
}
.post-list time {
margin-left: 1rem;
}
.post-list article {
color: gray;
font-style: oblique;
font-size: 1.8rem;
margin-top: 0.5rem;
}
.post-nav {
align-items: baseline;
display: flex;
margin-top: 3.5rem;
}
.post-nav .next {
margin-left: auto;
}
.post-single footer {
margin-block-start: 3.5rem;
}
ul.post-tags {
display: flex;
padding-inline-start: 0;
}
ul.post-tags li {
background-color: var(--tag-background-color);
border-radius: 4px;
display: inline-block;
letter-spacing: 2px;
}
ul.post-tags li:hover {
background-color: var(--tag-hover-background-color);
}
ul.post-tags li a {
color: var(--tag-text-color);
display: block;
height: 100%;
width: 100%;
padding: 1rem 1.5rem;
}
ul.post-tags li a:hover {
text-decoration: none;
}
ul.post-tags li + li {
margin-inline-start: 1rem;
}
.post-title {
align-items: baseline;
display: flex;
flex-wrap: wrap;
margin-bottom: 2rem;
}
.post-title > h1 {
flex-grow: 1;
margin-block-end: 0;
padding-bottom: 0;
}
.post-title > .post-date {
color: rgb(73, 73, 73);
display: inline-block;
font-size: 1.75rem;
inline-size: min-content;
letter-spacing: 1px;
text-transform: uppercase;
white-space: nowrap;
}
@media (max-width: 620px) {
.main h1 {
font-size: 3rem;
margin-bottom: 0.5rem;
}
.post-list {
padding-inline-start: 4rem;
}
.post-list h2 {
display: block;
font-size: 2rem;
}
.post-list time {
font-size: 1.8rem;
margin-left: 0;
}
}
@media (max-width: 704px) {
html {
font-size: 7px;
}
}