Change CSS reset of root pages

This commit is contained in:
Leilukin 2025-05-10 14:00:37 +08:00
parent 1cb713e4c6
commit 2fb2c1b27b

View File

@ -22,77 +22,54 @@
/* CSS Reset */ /* CSS Reset */
/* ------------------- */ /* ------------------- */
/* Box sizing rules */ @layer reset {
*, *, *::before, *::after {
*::before, box-sizing: border-box;
*::after { }
box-sizing: border-box;
}
/* Prevent font size inflation */ * {
html { margin: 0;
-moz-text-size-adjust: none; }
-webkit-text-size-adjust: none;
text-size-adjust: none;
}
/* Remove default margin in favour of better control in authored CSS */ body {
body, h1, h2, h3, h4, p, min-height: 100vh;
figure, blockquote, dl, dd { line-height: 1.5;
margin: 0; }
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */ h1, h2, h3, h4, h5, h6,
ul[role='list'], button, input, label {
ol[role='list'] { line-height: 1.1;
list-style-type: ""; }
}
/* Set core body defaults */ p, h1, h2, h3, h4, h5, h6 {
body { overflow-wrap: break-word;
min-height: 100vh; }
line-height: 1.5;
}
/* Set shorter line heights on headings and interactive elements */ h1, h2, h3, h4, h5, h6 {
h1, h2, h3, h4, text-wrap: balance;
button, input, label { }
line-height: 1.1;
}
/* Balance text wrapping on headings */ img, picture, video, audio, canvas {
h1, h2, max-width: 100%;
h3, h4 { height: auto;
text-wrap: balance; display: block;
} }
/* A elements that don't have a class get default styles */ input, button, textarea, select {
a:not([class]) { font: inherit;
text-decoration-skip-ink: auto; }
color: currentColor;
}
/* Make images easier to work with */ textarea:not([rows]) {
img, min-height: 10em;
picture { }
max-width: 100%;
display: block;
}
/* Inherit fonts for inputs and buttons */ :target {
input, button, scroll-margin-block: 5ex;
textarea, select { }
font: inherit;
}
/* Make sure textareas without a rows attribute are not tiny */ [popover] {
textarea:not([rows]) { margin: auto;
min-height: 10em; }
}
/* Anything that has been anchored to should have extra scroll margin */
:target {
scroll-margin-block: 5ex;
} }
/* ------------------- */ /* ------------------- */
@ -155,4 +132,4 @@ p { font-size: var(--fs-p); }
.index__link:focus { .index__link:focus {
outline: 0.1em solid var(--clr-body-txt); outline: 0.1em solid var(--clr-body-txt);
outline-offset: -0.15em; outline-offset: -0.15em;
} }