style(css): use of new CSS features (@import and nested CSS)

This commit is contained in:
David Bailey 2025-01-06 22:45:37 +01:00
parent 95e3fc0b00
commit d609265862
6 changed files with 464 additions and 276 deletions

View file

@ -1,4 +1,13 @@
@import "styles/age_gate.css";
@import "styles/post_navbar.css";
@import "styles/search.css";
@import "styles/toc.css";
/********************
* GENERAL SETTINGS *
********************
*/
* {
box-sizing: border-box;
@ -56,45 +65,6 @@ a:hover {
color: var(--highlight_2);
}
#age_gate_block {
position: fixed;
top: 0;
left: 0;
z-index: 1040;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(20px);
transition: opacity 0.8s linear;
}
#age_gate_block div {
background-color: var(--bg_3);
border-radius: 1em;
padding: 1em;
width: 12em;
margin:0 auto;
display: table;
position: absolute;
left: 0;
right:0;
top: 50%;
-webkit-transform:translateY(-50%);
-moz-transform:translateY(-50%);
-ms-transform:translateY(-50%);
-o-transform:translateY(-50%);
transform:translateY(-50%);
}
#age_gate_block p {
min-height: 5em;
}
#main_header {
overflow: hidden;
position: relative;
@ -206,137 +176,42 @@ body.htmx-request::before {
transition-delay: 0.5s;
}
#post_file_bar {
position: sticky;
.folder_listing {
& input {
display: none;
}
top: 0px;
& input ~ ul {
display: none;
}
& input:checked ~ ul {
display: block;
}
background: var(--bg_2);
box-shadow: 0px 5px 5px 0px #00000040;
z-index: 5;
label > :nth-child(2) {
display: none;
}
input:checked ~ label > :nth-child(1) {
display: none;
}
input:checked ~ label > :nth-child(2) {
display: inline-block;
}
}
#post_file_titles {
display: flex;
flex-direction: row;
justify-content: left;
list-style-type: none;
padding: 0px;
}
#post_file_titles > li {
padding: 0.2rem 0.8rem;
font-style: bold;
font-size: 1.5rem;
background: var(--highlight_1);
}
#post_file_path {
width: 100%;
font-style: italic;
padding-left: 0.5rem;
background: var(--highlight_1);
font-size: 1.1rem;
display: flex;
flex-direction: row;
list-style-type: none;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
}
#post_file_path a {
color: var(--text_1);
padding-right: 0.2rem;
}
.navbar-expand {
background-color: var(--bg_3);
border: 0.15rem solid var(--highlight_1);
border-top: none;
border-radius: 0 0 0.2rem 0.2rem;
overflow: clip;
padding-bottom: 0.2rem;
padding-left: 0.3rem;
max-height: 80vh;
overflow-y: scroll;
}
.navbar-full-path {
width: 100%;
font-style: italic;
padding-left: 0.2rem;
display: flex;
flex-direction: row;
list-style-type: none;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
}
.navbar-full-path li {
margin-left: 0.3rem;
}
.navbar-folder-list span, .navbar-folder-list label {
width: 1rem;
display: inline-block;
label.expandable {
cursor: pointer;
}
.navbar-folder-list ul, .navbar-folder-list {
list-style: none;
padding-left: 0.4rem;
margin-left: 0.4rem;
border-left: 1px solid var(--text_border);
}
.navbar-folder-list a:hover {
background-color: rgba(255, 255, 255, 0.1);
}
.folder-listing input {
input.expandable {
display: none;
}
.folder-listing input ~ ul {
input.expandable + .expandable {
display: none;
}
.folder-listing input:checked ~ ul {
input.expandable:checked + .expandable {
display: block;
}
.folder-listing label > :nth-child(2) {
display: none;
}
.folder-listing input:checked ~ label > :nth-child(1) {
display: none;
}
.folder-listing input:checked ~ label > :nth-child(2) {
display: inline-block;
}
#navbar-expand-label {
cursor: pointer;
}
#navbar-expander, .navbar-expand {
display: none;
}
#navbar-expander:checked + .navbar-expand {
display: block;
}
article {
background: var(--bg_3);
@ -345,17 +220,17 @@ article {
box-shadow: 3px 7px 7px 0px #00000040;
padding: 0.75rem;
}
article img {
display: block;
max-width: 100%;
max-height: 70vh;
margin: 1vmin;
margin-right: auto;
margin-left: auto;
& img {
display: block;
max-width: 100%;
max-height: 70vh;
margin: 1vmin;
margin-right: auto;
margin-left: auto;
}
}
#content_footer {
@ -380,9 +255,8 @@ article img {
position: absolute;
bottom: 0px;
width: 100%;
}
#main_footer span {
align-self: flex-end;
width: 100%;
& span {
align-self: flex-end;
width: 100%;
}
}

View file

@ -93,111 +93,111 @@ html {
article {
line-height: 1.5;
}
article p,
.modest-p {
font-size: 1rem;
margin-bottom: 1.3rem;
}
article h1,
.modest-h1,
article h2,
.modest-h2,
article h3,
.modest-h3,
article h4,
.modest-h4 {
margin: 1.5em 0 .3em;
font-weight: inherit;
line-height: 1.42;
padding-left: 1.5rem;
}
article > :first-child {
margin-top: 0.3rem !important;
}
article h1,
.modest-h1 {
margin-top: 0;
font-size: 1.998rem;
}
article h2,
.modest-h2 {
font-size: 1.427rem;
}
article h3,
.modest-h3 {
font-size: 1.299rem;
}
article h4,
.modest-h4 {
font-size: 1.1rem;
}
article h5,
.modest-h5 {
font-size: 1rem;
}
article h6,
.modest-h6 {
font-size: .88rem;
}
article small,
.modest-small {
font-size: .707rem;
}
/* https://github.com/mrmrs/fluidity */
article h1,
article h2,
article h3 {
border-bottom: 1px solid var(--text_border);
padding-bottom: .3rem;
}
blockquote {
padding-left: 0.8rem;
margin-left: 0.8rem;
margin-right: 4em;
}
blockquote {
border-left: 4px solid var(--text_border);
text-align: justify;
}
pre {
border-radius: 0.5rem;
box-shadow: 2px 5px 5px 0px #00000040;
border-left: 4px solid #206475;
background-color: var(--bg_2);
margin-bottom: 1.3rem;
margin-left: 0.8rem;
margin-right: 4em;
}
pre code {
border-radius: 0.5rem;
}
@media screen and (max-width: 32rem) {
pre, blockquote {
margin-right: 1.5em;
& p,
.modest-p {
font-size: 1rem;
margin-bottom: 1.3rem;
}
}
article ul,
article ol {
padding-left: 2em;
& h1,
.modest-h1,
& h2,
.modest-h2,
& h3,
.modest-h3,
& h4,
.modest-h4 {
margin: 1.5em 0 .3em;
font-weight: inherit;
line-height: 1.42;
padding-left: 1.5rem;
}
& > :first-child {
margin-top: 0.3rem !important;
}
& h1,
.modest-h1 {
margin-top: 0;
font-size: 1.998rem;
}
& h2,
.modest-h2 {
font-size: 1.427rem;
}
& h3,
.modest-h3 {
font-size: 1.299rem;
}
& h4,
.modest-h4 {
font-size: 1.1rem;
}
& h5,
.modest-h5 {
font-size: 1rem;
}
& h6,
.modest-h6 {
font-size: .88rem;
}
& small,
.modest-small {
font-size: .707rem;
}
/* https://github.com/mrmrs/fluidity */
& h1,
& h2,
& h3 {
border-bottom: 1px solid var(--text_border);
padding-bottom: .3rem;
}
blockquote {
padding-left: 0.8rem;
margin-left: 0.8rem;
margin-right: 4em;
}
blockquote {
border-left: 4px solid var(--text_border);
text-align: justify;
}
pre {
border-radius: 0.5rem;
box-shadow: 2px 5px 5px 0px #00000040;
border-left: 4px solid #206475;
background-color: var(--bg_2);
margin-bottom: 1.3rem;
margin-left: 0.8rem;
margin-right: 4em;
}
pre code {
border-radius: 0.5rem;
}
@media screen and (max-width: 32rem) {
pre, blockquote {
margin-right: 1.5em;
}
}
& ul,
& ol {
padding-left: 2em;
}
}

View file

@ -0,0 +1,42 @@
/****************
* AGE GATE CSS *
****************/
#age_gate_block {
position: fixed;
top: 0;
left: 0;
z-index: 1040;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(20px);
transition: opacity 0.8s linear;
& div {
background-color: var(--bg_3);
border-radius: 1em;
padding: 1em;
width: 12em;
margin:0 auto;
display: table;
position: absolute;
left: 0;
right:0;
top: 50%;
-webkit-transform:translateY(-50%);
-moz-transform:translateY(-50%);
-ms-transform:translateY(-50%);
-o-transform:translateY(-50%);
transform:translateY(-50%);
}
& p {
min-height: 5em;
}
}

View file

@ -0,0 +1,118 @@
.navbar {
position: sticky;
top: 0px;
background: var(--bg_2);
box-shadow: 0px 5px 5px 0px #00000040;
z-index: 5;
& > ._titles {
display: flex;
flex-direction: row;
justify-content: left;
list-style-type: none;
padding: 0px;
& li {
padding: 0.2rem 0.8rem;
font-style: bold;
font-size: 1.5rem;
background: var(--highlight_1);
}
}
& > ._path {
width: 100%;
font-style: italic;
padding-left: 0.5rem;
background: var(--highlight_1);
font-size: 1.1rem;
display: flex;
flex-direction: row;
list-style-type: none;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
& a {
color: var(--text_1);
padding-right: 0.2rem;
}
}
& > ._expand_label {
cursor: pointer;
}
& > ._details {
background-color: var(--bg_3);
border: 0.15rem solid var(--highlight_1);
border-top: none;
border-radius: 0 0 0.2rem 0.2rem;
overflow: clip;
padding-bottom: 0.2rem;
padding-left: 0.3rem;
max-height: 80vh;
overflow-y: scroll;
& > ._full_path {
width: 100%;
font-style: italic;
padding-left: 0.2rem;
display: flex;
flex-direction: row;
list-style-type: none;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
& li {
margin-left: 0.3rem;
}
}
& > ._folder_list {
list-style: none;
padding-left: 0.4rem;
margin-left: 0.4rem;
border-left: 1px solid var(--text_border);
& ul {
list-style: none;
padding-left: 0.4rem;
margin-left: 0.4rem;
border-left: 1px solid var(--text_border);
}
& a:hover {
background-color: rgba(255, 255, 255, 0.1);
}
& span, & label {
width: 1rem;
display: inline-block;
cursor: pointer;
}
}
}
}

View file

@ -0,0 +1,113 @@
.dergen_search_form {
text-align: center;
& h1 {
padding-left: 0px;
border: none;
margin-bottom: 0.1em;
}
& input[type='text'] {
color: var(--text_1);
height: 2.5rem;
min-width: min(80%, 30em);
font-size: 1.2em;
background-color: #616161;
border: none;
border-radius: 1.25rem;
padding-left: 1.5rem;
margin-bottom: 0.8em;
box-shadow: 3px 3px 3px #00000033;
}
& button {
color: var(--text_1);
background-color: #515151;
border: none;
border-radius: 0.5rem;
cursor: pointer;
width: 15em;
height: 2.5em;
margin-left: 1em;
margin-right: 1em;
margin-bottom: 1em;
box-shadow: 3px 3px 2px #00000033;
}
button, input[type='text'] {
transition: background-color 0.3s;
&:hover {
background-color: #777777;
}
}
& ._search_type {
text-align: left;
margin-top: 1em;
& input {
display: none;
}
& label {
min-width: 5em;
text-align: center;
padding-left: 0.7em;
padding-right: 0.7em;
cursor: pointer;
display: inline-block;
border-bottom: 2px solid #FFFFFF50;
}
& input:checked + label {
border-bottom: 2px solid #FFFFFF;
}
}
}
.dergen_search_result_listing {
list-style: none;
margin-left: 0em;
padding-left: 0;
& > li {
margin-bottom: 2em;
}
& ._details {
list-style: none;
padding-left: 1.3em;
& ._path_details {
color: #AAAAAA;
& span {
font-size: 0.8rem;
min-width: 5rem;
display: inline-block;
}
}
& ._title {
font-size: 1.5rem;
}
}
}

41
www/static/styles/toc.css Normal file
View file

@ -0,0 +1,41 @@
.table_of_contents {
position: sticky;
float: left;
top: 3em;
width: 20em;
& a {
display: inline-block;
transition: all 0.5s !important;
line-height: 1em;
text-align: justify;
font-size: 0.9rem;
padding-left: 0.2em;
padding-right: 0.2em;
padding-bottom: 0.2em;
border-radius: 0.2em;
}
& .active {
background-color: var(--highlight_1);
color: var(--bg_1);
}
& ol {
padding-left: 0.5em;
list-style: none;
border-left: 1px solid #FFFFFF44;
}
& li {
margin-bottom: 0.2em;
}
}