wip media query rework, sidebar mostly finished, rewritten njk

This commit is contained in:
sundae 2026-04-04 16:50:30 +03:00
commit 790147ea05
Signed by: sundae
SSH key fingerprint: SHA256:MsJkKuo4PUdjQDpLeaURy81drKkW14exlTHp+8QFu6M
33 changed files with 268 additions and 361 deletions

View file

@ -1,9 +1,3 @@
:root {
--avatar: 3rem;
}
article:not(#blog:has(#posts) *) {
margin: 0 auto;
}
article {
max-width: var(--post);
& ul {

View file

@ -2,11 +2,6 @@
@import url("./variables.css");
@import url("./nav.css");
:root {
--view: 18rem;
}
/* i hate default styles >:( and also chrome */
h1,
h2,
@ -77,13 +72,15 @@ footer {
& span {
background-image: var(--transgender);
padding: 0 var(--pad-sm);
padding: 0 var(--pad-s);
}
}
main {
width: var(--main);
padding: var(--pad-xl);
padding-left: calc(var(--view) + var(--pad-xl));
padding-right: var(--view);
overflow: hidden;
}
@ -143,11 +140,11 @@ article {
}
& p:not(:last-child, [aria-label]) {
padding-bottom: var(--pad-sm);
padding-bottom: var(--pad-s);
}
& code:not(pre *) {
padding: 0 var(--pad-sm);
padding: 0 var(--pad-s);
}
& pre {
@ -181,7 +178,7 @@ article {
& ul:not([role="list"]):is(#art *) {
padding: 0;
margin: 0 0 var(--pad-sm) var(--pad-xl);
margin: 0 0 var(--pad-s) var(--pad-xl);
}
& li:not([role] *, #changelog *) {
@ -214,14 +211,14 @@ article {
& figcaption {
font-weight: normal;
font-style: italic;
padding-top: var(--pad-sm);
padding-top: var(--pad-s);
}
}
& > :first-child > code {
display: flex;
width: fit-content;
margin: var(--pad-sm) 0;
margin: var(--pad-s) 0;
}
}
@ -252,18 +249,18 @@ img[src*="/assets/img/flag/"] {
& img {
position: relative;
vertical-align: sub;
margin: 0 var(--pad-sm);
margin: 0 var(--pad-s);
}
}
article a:not(.link *, a:has(img)) {
display: inline-flex;
padding: 0 var(--pad-sm);
padding: 0 var(--pad-s);
}
dialog button[commandfor="signal"] {
width: max-content;
padding: 0 var(--pad-sm);
padding: 0 var(--pad-s);
margin: 0 auto;
}
@ -311,9 +308,44 @@ dialog#signal {
& img {
border: 4px solid white;
padding: var(--pad-sm);
padding: var(--pad-s);
max-width: 100%;
max-height: 250px;
}
}
}
@media screen and (min-width: 916px) {
div#sidebar {
display: flex;
}
nav#floating {
display: none;
}
nav#default button[popovertarget] {
display: none;
}
}
@media screen and (max-width: 916px) {
/* Reset */
header, footer, main {
margin: 0;
padding: 0;
width: auto;
}
article {
margin: var(--pad-m);
padding: var(--pad-l);
}
header {
text-align: right;
padding-right: var(--pad-m);
}
/* Move navbar artwork */
nav#default::before {
content: none;
}
body::after {
content: "";
}
}

View file

@ -1,6 +1,3 @@
:root {
--thumb: 16rem;
}
#gallery {
& time {
display: flex;
@ -29,8 +26,7 @@
display: flex;
width: 100%;
height: var(--thumb);
object-fit: contain;
border-radius: var(--round);
object-fit: cover;
}
& figcaption {
@ -54,7 +50,7 @@
}
& h3 {
display: flex;
gap: var(--pad-sm);
gap: var(--pad-s);
}
& section:has(a:nth-child(n + 2)) {
display: flex;
@ -80,7 +76,7 @@
}
}
}
@media screen and (max-width: 920px) {
@media screen and (max-width: 916px) {
#art p {
max-width: auto;
}

View file

@ -26,7 +26,7 @@ article#badges {
padding: 0;
display: flex;
flex-wrap: wrap;
gap: var(--pad-sm);
gap: var(--pad-s);
}
& a {
@ -55,7 +55,7 @@ article#interests {
& a {
display: flex;
flex-direction: column;
padding: var(--pad-sm);
padding: var(--pad-s);
width: inherit;
&:not(:hover, :focus) {
background: transparent;

View file

@ -1,77 +1,3 @@
/* default.css */
@media screen and (max-width: 920px) {
body::after {
content: "" !important;
}
footer {
width: 100% !important;
margin: 0 !important;
}
header {
padding-left: 0 !important;
padding-top: var(--pad-m) !important;
text-align: center !important;
}
main {
padding: var(--pad-l) !important;
}
main > section {
flex-direction: column !important;
}
main > section {
width: initial !important;
}
article {
max-width: initial !important;
width: auto !important;
}
#mobile > nav {
display: flex !important;
}
}
/* nav.css */
@media screen and (min-width: 920px) {
li:has(> button[popovertarget="mobile"]) {
display: none !important;
}
#floating {
display: none;
}
#mobile {
display: flex;
}
}
@media screen and (max-width: 920px) {
#floating {
position: sticky !important;
top: 0 !important;
}
}
/* home.css */
@media screen and (max-width: 920px) {
article#interests {
display: flex !important;
flex-direction: column !important;
& ul {
justify-content: center !important;
}
& li a {
padding: 0 !important;
}
}
}
@media (prefers-reduced-motion: no-preference) {
/* Scrolling pride flag text */
article#bio span[id],
@ -90,23 +16,23 @@
}
@media (prefers-reduced-motion: reduce) {
body {
animation: none !important;
animation: none;
}
/* Buttons */
:is(a, button),
span:has(a) {
transition: none !important;
transition: none;
}
/* Permalinks */
.header-anchor,
article pre {
transition: none !important;
transition: none;
}
/* Images */
#gallery a:has(figure),
#blog article figure,
a img {
transition: none !important;
transition: none;
}
.emoji:has(img[alt*="🐇"]) {
& img {
@ -119,11 +45,11 @@
}
/* Scrolling pride flag text */
article#bio span[id], footer span {
transition: none !important;
animation: none !important;
transition: none;
animation: none;
color: inherit;
background-clip: initial !important;
background: initial !important;
background-clip: initial;
background: initial;
&::before {
content: "";
display: inline-flex;
@ -150,7 +76,7 @@
}
/* Jumping critters */
#pkmn span:hover {
animation: none !important;
animation: none;
transform: translateY(-4px);
}
}

View file

@ -10,6 +10,7 @@
overflow-y: scroll;
scrollbar-width: none;
gap: var(--pad-m);
margin: 0;
& li *:is(a, button) {
align-items: center;
@ -41,7 +42,7 @@
}
& ul {
margin: var(--pad-sm);
margin: var(--pad-s);
padding: 0;
& li,
@ -66,7 +67,7 @@
}
}
#mobile > nav::before,
nav#default::before,
body::after {
z-index: -1;
content: "";
@ -79,7 +80,7 @@ body::after {
pointer-events: none;
}
#mobile > nav::before {
nav#default::before {
bottom: 0;
left: 0;
mask-size: 160%;
@ -96,27 +97,31 @@ body::after {
-webkit-mask-position-y: bottom;
}
button[popovertarget="mobile"] {
display: none;
}
#floating {
width: fit-content;
nav#floating {
width: var(--float);
height: fit-content;
border-bottom-style: solid;
border-right-style: solid;
border-bottom-width: 2px;
border-right-width: 2px;
border-bottom-right-radius: var(--pad-l);
& button {
width: fit-content;
font-size: 0;
}
& a {
display: none;
}
}
#mobile {
div#sidebar {
margin: 0;
padding: 0;
background: none;
border: 0;
}
#mobile > nav {
nav#default {
border: 0;
border-right-style: solid;
border-right-width: 2px;
}
}

View file

@ -9,7 +9,7 @@
border-color: var(--secondary-300);
background-color: var(--secondary-200);
& #mobile {
& #default {
box-shadow: inset 0 0 0 2px var(--secondary-500);
background-color: var(--secondary-300);
}
@ -73,7 +73,7 @@
span:has(a) {
color: var(--secondary-light-400);
border-color: var(--secondary-600);
background-color: var(--secondary-300);
background-color: color-mix(in lch, var(--secondary-300), transparent);
&:is(:hover, :focus) {
color: var(--secondary-light-500);
border-color: currentColor;
@ -90,14 +90,13 @@
color: inherit;
}
& #mobile > nav,
#floating {
& nav#default,
nav#floating {
background-color: var(--secondary-100);
border-color: var(--secondary);
& section {
background-color: var(--secondary-100);
border-color: var(--secondary);
background-color: var(--secondary-300);
background-color: color-mix(in lch, var(--secondary-300), transparent);
color: var(--secondary-light-300);
& a[aria-current] {
color: var(--secondary-500);
@ -116,7 +115,7 @@
}
&::after,
& #mobile > nav::before {
& nav#default::before {
background-color: var(--secondary);
}
}

View file

@ -9,7 +9,7 @@
border-color: var(--primary-300);
background-color: var(--primary-200);
& #mobile {
& #default {
box-shadow: inset 0 0 0 2px var(--primary-500);
background-color: var(--primary-300);
}
@ -90,14 +90,13 @@
color: inherit;
}
& #mobile > nav,
#floating {
& nav#default,
nav#floating {
background-color: var(--primary-100);
border-color: var(--primary-dark-500);
& section {
background-color: var(--primary-100);
border-color: var(--primary-dark-800);
background-color: var(--primary-300);
background-color: color-mix(in lch, var(--primary-300), transparent);
color: var(--primary-dark-300);
& a[aria-current] {
color: var(--primary-500);
@ -116,7 +115,7 @@
}
&::after,
& #mobile > nav::before {
& nav#default::before {
background-color: var(--primary-dark-500);
}
}

View file

@ -39,17 +39,21 @@
--secondary-700: color-mix(in lch, var(--secondary), var(--dark) 30%);
--secondary-800: color-mix(in lch, var(--secondary), var(--dark) 20%);
--secondary-900: color-mix(in lch, var(--secondary), var(--dark) 10%);
--trans: 300ms;
--image: 24rem;
--post: 75ch;
--round: 16px;
--pad-xxl: 4rem;
--pad-xl: 2rem;
--pad-lm: 1.4rem;
--pad-l: 1rem;
--avatar: 3rem; /* Blog avatar */
--flag: 45deg; /* Pride flag */
--image: 24rem; /* Postscript images */
--main: 108rem; /* Main width */
--post: 75ch; /* Article text width */
--view: 300px; /* Sidebar width */
--float: 88px; /* Floating sidebar width */
--thumb: 16rem; /* Gallery artwork thumbnail */
--pad-s: 0.4rem;
--pad-m: 0.8rem;
--pad-sm: 0.4rem;
--flag: 45deg;
--pad-l: 1rem;
--pad-xl: 2rem;
--pad-xxl: 4rem;
--round: 16px;
--trans: 300ms;
--paw: url("/assets/img/theme/paw.svg");
--paw-tiled: url("/assets/img/theme/paw-tiled.png");
--outlined: drop-shadow(0 0.5px var(--dark)) drop-shadow(0 -0.5px var(--dark))
@ -132,4 +136,4 @@
@font-face {
font-family: Nosey Rodent;
src: url("/assets/fonts/noseyrodent-Regular.ttf") format("truetype");
}
}