- Add Jinja2 templates with data-testid attributes for testing - Create light/dark themes based on Gitea color scheme - Add theme switching with localStorage persistence - Create base CSS, components, and layout styles - Add mock web routes for UI demonstration - Register web router and static files in main.py - Add data-testid requirements to AGENTS.md - Install jinja2 dependency
442 lines
6.9 KiB
CSS
442 lines
6.9 KiB
CSS
/* Layout styles for blog application
|
|
*
|
|
* This file provides layout-related styles including
|
|
* grid system, navigation, containers, and page structure.
|
|
*/
|
|
|
|
/* Container */
|
|
.container {
|
|
width: 100%;
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 0 1rem;
|
|
}
|
|
|
|
.container-narrow {
|
|
max-width: 800px;
|
|
}
|
|
|
|
.container-wide {
|
|
max-width: 1400px;
|
|
}
|
|
|
|
/* Main layout */
|
|
.main-wrapper {
|
|
flex: 1;
|
|
padding: 2rem 0;
|
|
}
|
|
|
|
/* Grid system */
|
|
.grid {
|
|
display: grid;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.grid-2 {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
|
|
.grid-3 {
|
|
grid-template-columns: repeat(3, 1fr);
|
|
}
|
|
|
|
.grid-4 {
|
|
grid-template-columns: repeat(4, 1fr);
|
|
}
|
|
|
|
@media (max-width: 1024px) {
|
|
.grid-4 {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.grid-2,
|
|
.grid-3,
|
|
.grid-4 {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
/* Flex utilities */
|
|
.flex {
|
|
display: flex;
|
|
}
|
|
|
|
.flex-col {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.items-center {
|
|
align-items: center;
|
|
}
|
|
|
|
.justify-between {
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.justify-center {
|
|
justify-content: center;
|
|
}
|
|
|
|
.gap-1 { gap: 0.25rem; }
|
|
.gap-2 { gap: 0.5rem; }
|
|
.gap-3 { gap: 0.75rem; }
|
|
.gap-4 { gap: 1rem; }
|
|
|
|
/* Header */
|
|
.site-header {
|
|
background-color: var(--color-nav-bg);
|
|
border-bottom: 1px solid var(--color-border);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
|
|
.site-header .container {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
height: 4rem;
|
|
}
|
|
|
|
.site-logo {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
color: var(--color-text-dark);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.site-logo:hover {
|
|
color: var(--color-primary);
|
|
text-decoration: none;
|
|
}
|
|
|
|
/* Navigation */
|
|
.main-nav {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.nav-link {
|
|
color: var(--color-nav-text);
|
|
font-weight: 500;
|
|
padding: 0.5rem 0;
|
|
border-bottom: 2px solid transparent;
|
|
transition: color 0.2s ease, border-color 0.2s ease;
|
|
}
|
|
|
|
.nav-link:hover {
|
|
color: var(--color-primary);
|
|
text-decoration: none;
|
|
border-bottom-color: var(--color-primary-alpha-50);
|
|
}
|
|
|
|
.nav-link.active {
|
|
color: var(--color-primary);
|
|
border-bottom-color: var(--color-primary);
|
|
}
|
|
|
|
/* Header actions */
|
|
.header-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
/* Theme toggle button */
|
|
.theme-toggle {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 2rem;
|
|
height: 2rem;
|
|
padding: 0;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
border: 1px solid transparent;
|
|
color: var(--color-nav-text);
|
|
cursor: pointer;
|
|
transition: background-color 0.2s ease, color 0.2s ease;
|
|
}
|
|
|
|
.theme-toggle:hover {
|
|
background-color: var(--color-nav-hover-bg);
|
|
color: var(--color-primary);
|
|
}
|
|
|
|
/* Footer */
|
|
.site-footer {
|
|
background-color: var(--color-footer);
|
|
border-top: 1px solid var(--color-border);
|
|
padding: 2rem 0;
|
|
margin-top: auto;
|
|
}
|
|
|
|
.site-footer .container {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.footer-links {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.footer-link {
|
|
color: var(--color-text-light);
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.footer-link:hover {
|
|
color: var(--color-primary);
|
|
}
|
|
|
|
/* Page header */
|
|
.page-header {
|
|
margin-bottom: 2rem;
|
|
padding-bottom: 1rem;
|
|
border-bottom: 1px solid var(--color-border);
|
|
}
|
|
|
|
.page-header-flex {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 1rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.page-title {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.page-subtitle {
|
|
color: var(--color-text-light);
|
|
margin-top: 0.25rem;
|
|
}
|
|
|
|
/* Post list */
|
|
.post-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
/* Post card specific */
|
|
.post-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.post-card-header {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
justify-content: space-between;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.post-card-title {
|
|
margin-bottom: 0;
|
|
font-size: 1.25rem;
|
|
}
|
|
|
|
.post-card-title a {
|
|
color: var(--color-text-dark);
|
|
}
|
|
|
|
.post-card-title a:hover {
|
|
color: var(--color-primary);
|
|
}
|
|
|
|
.post-card-meta {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
font-size: 0.875rem;
|
|
color: var(--color-text-light-2);
|
|
}
|
|
|
|
.post-card-meta-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.post-card-content {
|
|
color: var(--color-text-light);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.post-card-footer {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 1rem;
|
|
padding-top: 1rem;
|
|
border-top: 1px solid var(--color-border);
|
|
}
|
|
|
|
.post-card-tags {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
/* Post detail */
|
|
.post-detail {
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.post-detail-header {
|
|
margin-bottom: 2rem;
|
|
padding-bottom: 1.5rem;
|
|
border-bottom: 1px solid var(--color-border);
|
|
}
|
|
|
|
.post-detail-title {
|
|
font-size: 2rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.post-detail-meta {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1.5rem;
|
|
flex-wrap: wrap;
|
|
color: var(--color-text-light-2);
|
|
}
|
|
|
|
.post-detail-content {
|
|
font-size: 1.125rem;
|
|
line-height: 1.8;
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.post-detail-content p {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.post-detail-footer {
|
|
margin-top: 3rem;
|
|
padding-top: 1.5rem;
|
|
border-top: 1px solid var(--color-border);
|
|
}
|
|
|
|
.post-detail-tags {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
/* Sidebar */
|
|
.sidebar {
|
|
position: sticky;
|
|
top: 6rem;
|
|
}
|
|
|
|
.sidebar-section {
|
|
background-color: var(--color-box-body);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: 6px;
|
|
padding: 1.25rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.sidebar-title {
|
|
font-size: 0.875rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.025em;
|
|
color: var(--color-text-light);
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
/* Two column layout */
|
|
.two-column {
|
|
display: grid;
|
|
grid-template-columns: 1fr 300px;
|
|
gap: 2rem;
|
|
}
|
|
|
|
@media (max-width: 1024px) {
|
|
.two-column {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.sidebar {
|
|
position: static;
|
|
}
|
|
}
|
|
|
|
/* Pagination */
|
|
.pagination {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 0.25rem;
|
|
margin-top: 2rem;
|
|
}
|
|
|
|
.pagination-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-width: 2rem;
|
|
height: 2rem;
|
|
padding: 0 0.5rem;
|
|
border-radius: 4px;
|
|
font-size: 0.875rem;
|
|
color: var(--color-text);
|
|
text-decoration: none;
|
|
transition: background-color 0.2s ease;
|
|
}
|
|
|
|
.pagination-item:hover {
|
|
background-color: var(--color-hover);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.pagination-item.active {
|
|
background-color: var(--color-primary);
|
|
color: var(--color-primary-contrast);
|
|
}
|
|
|
|
.pagination-item.disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Mobile menu */
|
|
@media (max-width: 768px) {
|
|
.site-header .container {
|
|
height: 3.5rem;
|
|
}
|
|
|
|
.main-nav {
|
|
display: none;
|
|
}
|
|
|
|
.mobile-menu-btn {
|
|
display: flex;
|
|
}
|
|
}
|
|
|
|
@media (min-width: 769px) {
|
|
.mobile-menu-btn {
|
|
display: none;
|
|
}
|
|
}
|