zs/default/assets/css/site.css
2024-12-25 22:43:00 +10:00

447 lines
8.7 KiB
CSS
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* site.css */
/* Default Light Theme Variables */
:root {
--background-color: #ffffff;
--text-color: #333333;
--link-color: #1d5ed0;
--link-hover-color: #0a47ab;
/* Improved hover contrast for light mode */
--header-background: #f8f9fa;
--footer-background: #f8f9fa;
--button-background: transparent;
--button-color: #333333;
--nav-link-color: #333333;
--nav-link-active: #ccc;
--quote-border-color: #ccc;
--quote-text-color: #555;
--quote-background-color: #f9f9f9;
}
/* Dark Theme Variables */
[data-theme="dark"] {
--background-color: #121212;
--text-color: #e0e0e0;
--link-color: #64B5F6;
/* Light blue with good contrast */
--link-hover-color: #2196F3;
/* Brighter blue for hover effect */
--header-background: #1f1f1f;
--footer-background: #1f1f1f;
--button-background: transparent;
--button-color: #e0e0e0;
--nav-link-color: #e0e0e0;
--nav-link-active: #333333;
--quote-border-color: #555;
--quote-text-color: #ccc;
--quote-background-color: #1e1e1e;
}
/* Global Styles */
body {
margin: 0;
font-family: Arial, sans-serif;
background-color: var(--background-color);
color: var(--text-color);
overflow-x: hidden;
/* Prevent horizontal scrolling */
}
/* Global Link Styles */
a {
color: var(--link-color);
text-decoration: none;
}
a:hover,
a:focus {
color: var(--link-hover-color);
text-decoration: underline;
}
/* Adjusted Container */
.container {
width: 95%;
max-width: 900px;
margin: 0 auto;
padding: 0;
box-sizing: border-box;
/* Include padding and border in width */
}
/* Adjust margins for child elements */
.container h1,
.container h2,
.container h3,
.container h4,
.container h5,
.container h6,
.container p,
.container ul,
.container ol,
.container pre,
.container code,
.container blockquote {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
/* Header */
header {
background-color: var(--header-background);
padding: 0.5em 0;
}
header .container {
display: flex;
flex-direction: column;
}
.header-top {
display: flex;
align-items: center;
justify-content: space-between;
}
header .logo {
font-size: 1.5em;
font-weight: bold;
color: var(--text-color);
text-decoration: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Theme Toggle Button */
#theme-toggle {
background: var(--button-background);
border: none;
cursor: pointer;
color: var(--button-color);
font-size: 1.5em;
margin-left: 1em;
}
/* Menu Toggle Button */
#menu-toggle {
background: var(--button-background);
border: none;
cursor: pointer;
color: var(--button-color);
font-size: 1.5em;
display: none;
/* Hidden by default */
}
/* Navigation Menu */
nav#main-nav {
margin-top: 0.5em;
}
nav ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
gap: 0.5em;
flex-wrap: wrap;
}
nav ul li {
margin: 0;
}
nav ul li a {
display: block;
color: var(--nav-link-color);
text-decoration: none;
padding: 0.5em;
}
nav ul li a.active {
background-color: var(--nav-link-active);
}
nav ul li a:hover {
background-color: var(--nav-link-active);
text-decoration: none;
color: var(--nav-link-color);
}
/* Navigation Logo Styling */
header .logo {
display: flex;
/* Make the logo a flex container */
align-items: center;
/* Vertically center the content */
font-size: 1.5em;
font-weight: bold;
color: var(--text-color);
text-decoration: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
header .logo img {
height: 40px;
/* Adjust logo size */
width: auto;
margin-right: 0.5em;
/* Space between the logo and the text */
}
@media (max-width: 800px) {
/* Adjust header layout */
.header-top {
flex-wrap: nowrap;
justify-content: space-between;
/* Push the elements to the left and right ends */
}
/* Show the menu toggle button */
#menu-toggle {
display: block;
order: 2;
/* Move the menu toggle to the right */
}
/* Keep the logo on the left */
header .logo {
order: 1;
margin-left: 0.5em;
font-size: 1.2em;
}
/* Adjust theme toggle button */
#theme-toggle {
order: 3;
margin-left: auto;
}
/* Hide the navigation menu by default */
nav#main-nav {
display: none;
order: 4;
width: 100%;
}
/* Show the navigation menu when toggled */
nav#main-nav.open {
display: block;
}
/* Stack the navigation links vertically */
nav ul {
flex-direction: column;
gap: 0;
}
nav ul li a {
padding: 0.75em 0 0.75rem 0.75em;
}
}
@media (min-width: 801px) {
/* Hide the menu toggle button on large screens */
#menu-toggle {
display: none;
}
/* Ensure navigation is visible on large screens */
nav#main-nav {
display: block !important;
}
/* Reset order and margins */
.header-top {
flex-wrap: wrap;
}
header .logo {
order: 0;
margin-left: 0;
}
#theme-toggle {
order: 0;
margin-left: 1em;
}
}
/* Main Content */
main {
padding: 1em 0;
}
article {
line-height: 1.6;
}
article h2 {
margin-top: 1.5em;
}
aside {
width: 33%;
padding-left: .5rem;
margin-left: .5rem;
float: right;
border-left: 2px solid var(--button-color);
font-style: italic;
}
aside>p {
margin: .5rem;
}
/* Inline Code */
code {
background-color: #f5f5f5;
padding: 0.2em 0.4em;
margin: 0;
font-size: 85%;
border-radius: 3px;
}
[data-theme="dark"] code {
background-color: #1e1e1e;
color: #e0e0e0;
}
/* Code Blocks */
pre {
background-color: #f5f5f5;
padding: 0.5em;
overflow-x: auto;
margin-top: 0.5em;
margin-bottom: 0.5em;
max-width: 100%;
box-sizing: border-box;
}
[data-theme="dark"] pre {
background-color: #1e1e1e;
}
pre code {
background-color: inherit;
/* Use the same background as pre */
padding: 0;
margin: 0;
font-size: inherit;
color: inherit;
border-radius: 0;
}
/* Images and Media */
img,
iframe,
video {
max-width: 100%;
height: auto;
}
/* Footer */
footer {
background-color: var(--footer-background);
padding: 1em 0;
}
footer .container {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 1em;
/* Adds space between footer items */
}
footer p {
margin: 0;
/* Ensure there's no margin collapse and the text stays separated */
}
footer .edit-page-link {
margin-left: auto;
/* Push the edit page link to the far right */
}
footer .edit-page-link a {
color: var(--link-color);
}
footer .edit-page-link a:hover {
text-decoration: underline;
color: var(--link-hover-color);
/* Improved hover color in footer */
}
/* Responsive Footer */
@media (max-width: 600px) {
footer .container {
flex-direction: column;
align-items: flex-start;
gap: 0.5em;
/* Adds vertical space between items */
}
footer .edit-page-link {
margin-left: 0;
margin-top: 0.5em;
}
}
/* Styles for Page Lists */
.list {
list-style-type: none;
padding-left: 0;
}
.list li {
margin-bottom: 0.5em;
}
.list li::before {
content: "• ";
color: var(--link-color);
}
/* Blockquote Styles */
blockquote {
border-left: 4px solid var(--quote-border-color);
padding-left: 1em;
margin-left: 0;
margin-right: 0;
color: var(--quote-text-color);
background-color: var(--quote-background-color);
font-style: italic;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
/* Optional Inline Quote Styles */
q {
quotes: "“""”""""";
font-style: italic;
color: var(--quote-text-color);
}
/* Anchors */
h1:hover .anchor:before,
h2:hover .anchor:before,
h3:hover .anchor:before,
h4:hover .anchor:before,
h5:hover .anchor:before,
h6:hover .anchor:before {
width: 16px;
height: 16px;
content: ' ';
display: inline-block;
background-color: currentColor;
-webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
}