1
0
em.0x45.cz/sass/style.scss

264 lines
4.3 KiB
SCSS

@font-face {
font-family: spectral;
font-style: normal;
font-weight: 400;
src: url("/fonts/spectral-regular.woff2") format("woff2"),
url("/fonts/spectral-regular.woff") format("woff"),
url("/fonts/spectral-regular.ttf") format("truetype");
}
@font-face {
font-family: spectral;
font-style: normal;
font-weight: 700;
src: url("/fonts/spectral-bold.woff2") format("woff2"),
url("/fonts/spectral-bold.woff") format("woff"),
url("/fonts/spectral-bold.ttf") format("truetype");
}
@font-face {
font-family: spectral;
font-style: italic;
font-weight: 400;
src: url("/fonts/spectral-italic.woff2") format("woff2"),
url("/fonts/spectral-italic.woff") format("woff"),
url("/fonts/spectral-italic.ttf") format("truetype");
}
::selection{
background-color: #ffffb2;
color: #000;
}
.wrap {
max-width: 55rem;
margin: 0 auto;
padding: 0 1rem;
}
.grid {
display: grid;
grid-template-columns: 10em auto;
grid-column-gap: 2em;
/* Do not let wide blocks, such as pre, expand the column and overflow */
&>*{ min-width: 0 }
& nav>*:first-child,
& main>*:first-child,
& main>article:first-child h2
{ padding-top: 0; margin-top: 0; }
}
body {
font-family: spectral, serif;
text-rendering: optimizeLegibility;
font-size: 18px;
line-height: 1.5;
margin: 0;
}
header {
padding: 1rem 0;
margin-bottom: 5rem;
background-color: #000;
color: #fff;
line-height: 1;
a { color: inherit }
.wrap {
display: flex;
justify-content: space-between;
align-items: baseline;
}
.title { font-size: 1.5em; }
.title:hover { text-decoration: none }
.links { font-size: 1rem }
}
nav {
position: sticky;
align-self: start;
top: 2em;
margin-bottom: 4rem;
span.title {
display: block;
margin: 2em 0 1em 0;
font-weight: bold;
}
ul {
list-style-type: none;
padding: 0;
li a {
color: #000;
display: block;
padding: 0 .5em;
&:hover {
color: #fff;
background-color: #000;
text-decoration: none;
}
}
li.mobile-only { display: none }
}
}
main {
margin-bottom: 2rem;
h1, h2, h3, h4, h5, h6 {
margin-top: 1.5em;
padding-top: 1em;
line-height: 1;
}
article h2 { margin-top: 1em }
article h2 a { color: inherit }
.info {
border-top: 1px solid #ccc;
margin-top: 2em;
padding: 1em 0;
ul {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
font-size: .85em;
li { margin-right: 1em }
}
}
.updates ul {
margin-top: .5em;
padding: 0;
list-style-type: none;
}
img {
max-width: 100%;
box-sizing: border-box;
border: 1px solid #bbb;
border-radius: .2rem;
padding: .2rem;
& + em {
display: block;
text-align: center;
}
}
table {
display: flex;
flex-direction: column;
margin: 1.25em 0;
text-align: left;
overflow: auto;
td, th { padding-right: 2em }
}
blockquote {
margin: 1em 0;
background-color: #f5f5f5;
p {
border-left: .3em solid #729fcf;
padding: 1em 1.5em;
}
}
code { font-size: 14px }
li>code { word-wrap: break-word }
p>code {
background-color: #383838;
color: #e6e1dc;
padding: .2em .5em;
border-radius: .3em;
}
pre {
padding: 1em;
overflow: auto;
border-radius: .3em;
}
input.search {
display: none; // Hide for non-js browsers
box-sizing: border-box;
width: 100%;
border: 1px solid #ccc;
padding: .4rem .9rem;
margin: 1em 0;
outline: none;
background-color: inherit;
color: inherit;
font-family: spectral, serif;
font-size: 1rem;
}
.all-posts { text-align: right }
}
a {
text-decoration: none;
color: #e1140a;
&:hover { text-decoration: underline }
}
@media screen and (max-width: 50rem) {
.grid { grid-template-columns: auto }
nav {
position: initial;
ul { display: none }
ul.main {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
ul li.mobile-only { display: list-item }
span.title { display: none }
}
header, nav { margin-bottom: 3rem }
}
@media (prefers-color-scheme: dark) {
body {
background-color: #131516;
color: #cdcdcd;
}
header {
background-color: inherit;
color: inherit;
}
nav ul li a {
color: inherit;
&:hover {
color: #131516;
background-color: #cdcdcd;
}
}
main {
.info, input.search { border-color: #383838 }
img { border-color: #43494c }
blockquote { background-color: #383838 }
}
a {
color: #ff6e67;
}
}