Files
blogging-cms/static/css/material.css
T
nutshell9247 852613586f
CI/CD Pipeline / Test & Lint (push) Waiting to run
CI/CD Pipeline / Build Docker Image (push) Blocked by required conditions
CI/CD Pipeline / Security Scan (push) Waiting to run
first commit, mate!
2026-08-08 14:43:59 +08:00

515 lines
11 KiB
CSS

/* Material Design 3 Tokens */
:root {
/* Primary colors */
--md-sys-color-primary: #6750a4;
--md-sys-color-on-primary: #ffffff;
--md-sys-color-primary-container: #eaddff;
--md-sys-color-on-primary-container: #21005e;
/* Secondary colors */
--md-sys-color-secondary: #625b71;
--md-sys-color-on-secondary: #ffffff;
--md-sys-color-secondary-container: #e8def8;
--md-sys-color-on-secondary-container: #1e192b;
/* Tertiary colors */
--md-sys-color-tertiary: #7d5260;
--md-sys-color-on-tertiary: #ffffff;
--md-sys-color-tertiary-container: #ffd8e4;
--md-sys-color-on-tertiary-container: #31111d;
/* Neutral colors */
--md-sys-color-background: #fffbfe;
--md-sys-color-on-background: #1c1b1f;
--md-sys-color-surface: #fffbfe;
--md-sys-color-on-surface: #1c1b1f;
--md-sys-color-surface-variant: #e7e0ec;
--md-sys-color-on-surface-variant: #49454e;
--md-sys-color-outline: #79747e;
--md-sys-color-outline-variant: #c4c7c5;
/* Error colors */
--md-sys-color-error: #b3261e;
--md-sys-color-on-error: #ffffff;
--md-sys-color-error-container: #f9dedc;
--md-sys-color-on-error-container: #410e0b;
/* Typography */
--md-sys-typescale-display-large-font-family: 'Roboto', sans-serif;
--md-sys-typescale-display-large-font-size: 57px;
--md-sys-typescale-display-large-font-weight: 400;
--md-sys-typescale-display-large-line-height: 64px;
--md-sys-typescale-headline-large-font-size: 32px;
--md-sys-typescale-headline-large-font-weight: 400;
--md-sys-typescale-headline-large-line-height: 40px;
--md-sys-typescale-headline-medium-font-size: 28px;
--md-sys-typescale-headline-medium-font-weight: 400;
--md-sys-typescale-headline-medium-line-height: 36px;
--md-sys-typescale-headline-small-font-size: 24px;
--md-sys-typescale-headline-small-font-weight: 400;
--md-sys-typescale-headline-small-line-height: 32px;
--md-sys-typescale-title-large-font-size: 22px;
--md-sys-typescale-title-large-font-weight: 500;
--md-sys-typescale-title-large-line-height: 28px;
--md-sys-typescale-title-medium-font-size: 16px;
--md-sys-typescale-title-medium-font-weight: 500;
--md-sys-typescale-title-medium-line-height: 24px;
--md-sys-typescale-body-large-font-size: 16px;
--md-sys-typescale-body-large-font-weight: 400;
--md-sys-typescale-body-large-line-height: 24px;
--md-sys-typescale-body-medium-font-size: 14px;
--md-sys-typescale-body-medium-font-weight: 500;
--md-sys-typescale-body-medium-line-height: 20px;
--md-sys-typescale-label-large-font-size: 14px;
--md-sys-typescale-label-large-font-weight: 500;
--md-sys-typescale-label-large-line-height: 20px;
}
/* Global styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
background-color: var(--md-sys-color-background);
color: var(--md-sys-color-on-background);
font-size: var(--md-sys-typescale-body-large-font-size);
line-height: var(--md-sys-typescale-body-large-line-height);
}
/* Typography */
h1 {
font-size: var(--md-sys-typescale-display-large-font-size);
font-weight: var(--md-sys-typescale-display-large-font-weight);
line-height: var(--md-sys-typescale-display-large-line-height);
margin: 1em 0 0.5em 0;
}
h2 {
font-size: var(--md-sys-typescale-headline-large-font-size);
font-weight: var(--md-sys-typescale-headline-large-font-weight);
line-height: var(--md-sys-typescale-headline-large-line-height);
margin: 1em 0 0.5em 0;
}
h3 {
font-size: var(--md-sys-typescale-headline-medium-font-size);
font-weight: var(--md-sys-typescale-headline-medium-font-weight);
line-height: var(--md-sys-typescale-headline-medium-line-height);
margin: 0.8em 0 0.4em 0;
}
h4, h5, h6 {
font-size: var(--md-sys-typescale-headline-small-font-size);
font-weight: var(--md-sys-typescale-headline-small-font-weight);
line-height: var(--md-sys-typescale-headline-small-line-height);
margin: 0.8em 0 0.4em 0;
}
p {
margin-bottom: 1em;
}
a {
color: var(--md-sys-color-primary);
text-decoration: none;
transition: color 0.2s ease;
}
a:hover {
color: var(--md-sys-color-on-primary-container);
text-decoration: underline;
}
/* Components */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 16px;
}
.card {
background-color: var(--md-sys-color-surface);
border-radius: 12px;
padding: 24px;
margin-bottom: 16px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
border: 1px solid var(--md-sys-color-outline-variant);
transition: box-shadow 0.2s ease;
}
.card:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
height: 40px;
padding: 0 24px;
border: none;
border-radius: 24px;
font-size: var(--md-sys-typescale-label-large-font-size);
font-weight: var(--md-sys-typescale-label-large-font-weight);
cursor: pointer;
transition: all 0.2s ease;
font-family: inherit;
}
.button--primary {
background-color: var(--md-sys-color-primary);
color: var(--md-sys-color-on-primary);
}
.button--primary:hover {
background-color: #5a4799;
}
.button--primary:active {
background-color: #4f3d8a;
}
.button--secondary {
background-color: var(--md-sys-color-secondary-container);
color: var(--md-sys-color-on-secondary-container);
}
.button--secondary:hover {
background-color: #d5cce1;
}
.button--tertiary {
background-color: transparent;
color: var(--md-sys-color-primary);
border: 2px solid var(--md-sys-color-outline);
}
.button--tertiary:hover {
background-color: var(--md-sys-color-primary-container);
}
.button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Forms */
.form-group {
margin-bottom: 24px;
}
label {
display: block;
font-size: var(--md-sys-typescale-body-medium-font-size);
font-weight: var(--md-sys-typescale-body-medium-font-weight);
margin-bottom: 8px;
color: var(--md-sys-color-on-background);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
width: 100%;
padding: 12px 16px;
border: 1px solid var(--md-sys-color-outline);
border-radius: 8px;
font-size: var(--md-sys-typescale-body-large-font-size);
font-family: inherit;
background-color: var(--md-sys-color-surface);
color: var(--md-sys-color-on-surface);
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
outline: none;
border-color: var(--md-sys-color-primary);
box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.1);
}
textarea {
resize: vertical;
min-height: 120px;
}
/* Header */
.header {
background-color: var(--md-sys-color-primary);
color: var(--md-sys-color-on-primary);
padding: 24px 0;
margin-bottom: 40px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.header__content {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding: 0 16px;
}
.header__logo {
font-size: var(--md-sys-typescale-headline-large-font-size);
font-weight: 600;
color: inherit;
text-decoration: none;
}
.header__nav {
display: flex;
gap: 32px;
align-items: center;
}
.header__nav a {
color: inherit;
text-decoration: none;
font-size: var(--md-sys-typescale-body-large-font-size);
transition: opacity 0.2s ease;
}
.header__nav a:hover {
opacity: 0.8;
}
/* Post list */
.post-list {
list-style: none;
}
.post-item {
padding: 24px;
border-bottom: 1px solid var(--md-sys-color-outline-variant);
transition: background-color 0.2s ease;
}
.post-item:hover {
background-color: var(--md-sys-color-surface-variant);
}
.post-item:last-child {
border-bottom: none;
}
.post-title {
font-size: var(--md-sys-typescale-title-large-font-size);
font-weight: var(--md-sys-typescale-title-large-font-weight);
margin-bottom: 8px;
}
.post-meta {
font-size: var(--md-sys-typescale-body-medium-font-size);
color: var(--md-sys-color-on-surface-variant);
margin-bottom: 12px;
display: flex;
gap: 16px;
flex-wrap: wrap;
}
.post-excerpt {
margin-bottom: 12px;
color: var(--md-sys-color-on-background);
}
.post-type {
display: inline-block;
padding: 4px 12px;
border-radius: 16px;
font-size: 12px;
font-weight: 600;
background-color: var(--md-sys-color-primary-container);
color: var(--md-sys-color-on-primary-container);
}
.post-type--micro {
background-color: var(--md-sys-color-secondary-container);
color: var(--md-sys-color-on-secondary-container);
}
/* Tags */
.tags {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-top: 12px;
}
.tag {
display: inline-block;
padding: 4px 12px;
border-radius: 16px;
font-size: 12px;
background-color: var(--md-sys-color-surface-variant);
color: var(--md-sys-color-on-surface-variant);
text-decoration: none;
transition: all 0.2s ease;
}
.tag:hover {
background-color: var(--md-sys-color-outline-variant);
color: var(--md-sys-color-on-surface);
}
/* Footer */
.footer {
background-color: var(--md-sys-color-surface-variant);
color: var(--md-sys-color-on-surface-variant);
padding: 40px 0 24px;
margin-top: 60px;
border-top: 1px solid var(--md-sys-color-outline-variant);
}
.footer__content {
max-width: 1200px;
margin: 0 auto;
padding: 0 16px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 32px;
margin-bottom: 32px;
}
.footer__section h4 {
margin-top: 0;
color: var(--md-sys-color-on-surface);
}
.footer__section ul {
list-style: none;
}
.footer__section ul li {
margin-bottom: 8px;
}
.footer__section a {
color: var(--md-sys-color-on-surface-variant);
}
.footer__section a:hover {
color: var(--md-sys-color-primary);
text-decoration: underline;
}
.footer__bottom {
text-align: center;
padding-top: 24px;
border-top: 1px solid var(--md-sys-color-outline-variant);
font-size: var(--md-sys-typescale-body-medium-font-size);
}
/* Responsive */
@media (max-width: 768px) {
.header__content {
flex-direction: column;
gap: 16px;
}
.header__nav {
width: 100%;
justify-content: center;
flex-wrap: wrap;
}
h1 {
font-size: 40px;
}
h2 {
font-size: 28px;
}
.button {
width: 100%;
}
}
/* Code highlighting */
pre {
background-color: var(--md-sys-color-surface-variant);
border-radius: 8px;
padding: 16px;
overflow-x: auto;
margin: 16px 0;
}
code {
font-family: 'Courier New', monospace;
font-size: 14px;
}
pre code {
background-color: transparent;
color: var(--md-sys-color-on-background);
}
/* Utility classes */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
.flex {
display: flex;
}
.flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.gap-16 {
gap: 16px;
}
.gap-32 {
gap: 32px;
}
.mt-16 {
margin-top: 16px;
}
.mt-24 {
margin-top: 24px;
}
.mb-16 {
margin-bottom: 16px;
}
.mb-24 {
margin-bottom: 24px;
}