new_blog/static/css/layout.css
2025-07-10 23:58:20 -04:00

305 lines
6.3 KiB
CSS

@layer pre-load, reset, baseline, overload-1, print;
@import url("/static/css/reset.css") layer(reset);
/*
* saving this for when doing a table of contents, position: sticky isn't good enough
*https://lea.verou.me/blog/2020/06/hybrid-positioning-with-css-variables-and-max/
* will also need to make use of container queries to shift it into static positioning when the screen isn't wide enough
*nav{
border: dashed lime 3px;
position:fixed;
left: 20px;
top: 100px;
min-width:200px;
}
* */
@layer overload-1{
dt{
font-weight:normal;
}
}
@layer baseline {
:root {
--base-text-size: 1.1rem;
font-size: 18px;
}
body {
padding: 0px;
margin: 0px;
font-family: "Atkinson Hyperlegible", sans-serif;
-webkit-font-smoothing: antialiased;
/*make the width and scrolling behavior correct
* If horizontal scrolling is needed the layout broke*/
width: 100vw;
overflow: hidden scroll;
}
.dt-subtitle {
margin-left:0px;
}
figure {
background: hsla(0, 0%, 30%, 50%);
border-radius: 0.5rem;
}
figcaption {
text-align: center;
}
a {
font-weight: bold;
text-decoration: none;
width: fit-content;
height: fit-content;
}
#github_shrink {
transform: scale(0.37);
transform-origin: top left;
}
a.obj-wrapper{
display: block;
}
a:hover {
text-decoration: underline;
}
footer {
width: 100%;
/*using grid instead of flexbox due to greater flexibility in case I wanna add stuff to the layout for some reason*/
display: grid;
justify-content: center;
align-content: center;
/*footer isn't a keyword it's just the string I chose*/
grid-template-areas: "footer"
grid-template-columns: 1fr;
grid-template-rows: 1fr;
}
.socials {
display: flex;
flex-flow: row wrap;
gap: 1rem;
align-items: center;
justify-content: center;
max-height: 2rem;
}
.nav-link{
font-size: 2rem;
padding: 0em 0.25em;
border-radius: 0.5rem;
font-variant: small-caps;
font-family: "Courier Prime", serif;
}
dt {
font-family: "Courier Prime", Georgia, serif;
text-overflow: ellipsis;
white-space: nowrap;
overflow:hidden;
/*needed to fix the outline vanishing due to overflow hidden*/
padding: 2px;
}
h1, h2, h3, h4, h5, h6 {
font-family: "Courier Prime", Georgia, serif;
/* Default bold hurt Banan's eyes*/
font-weight: normal;
text-align: center;
}
p{
text-wrap: pretty;
}
a {
font-size: inherit;
}
pre {
font-size: inherit;
}
time {
font-size: inherit;
}
.sourceCode {
font-size: inherit;
}
.info {
font-size: inherit;
}
header#header {
box-sizing: border-box;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-between;
width: 100vw;
padding: 0.5em 1em;
}
article {
max-width: 66ch;
}
main {
box-sizing: border-box;
display: block flex;
margin-top: 1rem;/*calc(24px + 3rem) 1rem 1rem 1rem;*/
padding: 1rem;
/* needed due to flex parent*/
width: 100%;
/*https://ux.stackexchange.com/a/34125*/
/*https://ux.stackexchange.com/a/34148*/
/*https://pearsonified.com/golden-ratio-typography-intro/*/
/*https://grtcalculator.com/*/
/*or maybe not, https://en.wikipedia.org/wiki/Line_length#Electronic_text*/
& > header {
box-sizing: border-box;
padding: 0rem 1rem;
max-width: 66ch;
}
/* needed due to being flex itself*/
flex-direction:column;
/* put things in center*/
/* not sure if I want everything centered or just code blocks but I like everything centered atm*/
justify-content: center;
align-items: center;
}
header#article-header {
/*max-width: -moz-available;
max-width: -webkit-fill-available;
max-width: fill-available;*/
display: block flex;
flex-direction:column;
/* put things in center*/
/* not sure if I want everything centered or just code blocks but I like everything centered atm*/
justify-content: center;
align-items: center;
}
dl {
max-width: -moz-available;
max-width: -webkit-fill-available;
max-width: fill-available;
}
article {
display: block flex;
flex-direction:column;
/* put things in center*/
/* not sure if I want everything centered or just code blocks but I like everything centered atm*/
justify-content: center;
align-items: center;
}
blockquote {
/*font-style: italic;*/
padding: 0;
border-radius: 0.5rem;
p{
/*margin is annoying in this case*/
margin: 0.4em 0.5em;
padding: 0em 0.5em;
}
}
/*might need to become grid when adding in table of contents and sidenotes*/
#content-outer {
display: flex;
justify-content: center;
align-items: center;
}
.icon {
width: 2rem;
height: 2rem;
}
/* all of these can break out of the box we want to put them in*/
.sourceCode, object, :has(> object), img, :has(> img), pre{
max-width: -moz-available;
max-width: -webkit-fill-available;
max-width: fill-available;
width: fit-content;
}
pre {
box-sizing: border-box;
min-height: 2em;
/*
* need to may y axis scroll hidden for chromium
* */
overflow:scroll hidden;
/*background: #444;*/
border-radius: 0.5rem;
/*border: 0.2em solid red;*/
padding: 0.5rem;
}
hr {
box-sizing: border-box;
width: 100%;
}
p {
/*https://pearsonified.com/golden-ratio-typography-intro/ is where this came from and tbh having a bigger line height does make things more readable although I tune it down a bit*/
line-height: 1.5;
}
footer {
display: flex;
margin:20px;
/*width:100%;*/
}
p, ul, ol {
/*need to take up full width for alignment reasons*/
width: 100%;
}
}
/* we really want to make sure this doesn't stick around when colors load in regardless of when/how colors get loaded in*/
@layer pre-load{
main > header {
border: 0.7rem solid transparent;
}
}
/* I mean why not? */
@media print {
@layer print{
#header {
visibility: hidden;
}
main {
border-style: none;
}
pre {
page-break-inside: avoid;
text-wrap: wrap;
}
iframe, video {
display: none;
}
section {
break-inside: avoid;
}
:is(h1,h2,h3,h4,h5):has(+iframe), :is(h1,h2,h3,h4,h5):has(+video) {
display: none;
}
.socials {
display: none;
}
/* https://piccalil.li/blog/printing-the-web-making-webpages-look-good-on-paper */
a[href]:after {
content: " (" attr(href) ")";
}
}
}