Files
codegirl.games-hugo/cms/internal/templates/static/css/app.css
T
Cursor Agentandcodegirl007 ce15f54a52 Add lightweight self-hosted Hugo CMS with GitHub API backend
Implements a Go-based CMS for editing Hugo posts and uploading images
via the GitHub REST API, with no database and Git as the source of truth.

Features:
- Single admin auth with bcrypt password and signed session cookies
- Dashboard, post listing with search, create/edit with EasyMDE editor
- Media library for static/uploads/ with drag-drop and clipboard paste
- Client-side autosave, unsaved changes warning, dark mode, responsive UI
- Modular packages for auth, github, posts, media, session, and handlers

Co-authored-by: codegirl007 <s.raide@gmail.com>
2026-07-06 18:56:17 +00:00

553 lines
9.1 KiB
CSS

:root {
--bg: #f8f9fb;
--surface: #ffffff;
--text: #1a1d26;
--text-muted: #5c6370;
--border: #e2e5eb;
--primary: #3b6ef5;
--primary-hover: #2f5ad4;
--danger: #d64545;
--success: #2d9f6f;
--shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
--radius: 8px;
--font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--mono: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
}
[data-theme="dark"] {
--bg: #12151c;
--surface: #1c2130;
--text: #e8eaef;
--text-muted: #9aa3b2;
--border: #2d3548;
--primary: #6b93ff;
--primary-hover: #89a8ff;
--shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
*, *::before, *::after { box-sizing: border-box; }
body {
margin: 0;
font-family: var(--font);
background: var(--bg);
color: var(--text);
line-height: 1.5;
min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container {
max-width: 1100px;
margin: 0 auto;
padding: 1.5rem;
}
/* Navigation */
.topnav {
display: flex;
align-items: center;
gap: 1rem;
padding: 0.75rem 1.5rem;
background: var(--surface);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 100;
}
.brand {
font-weight: 700;
color: var(--text);
text-decoration: none;
margin-right: auto;
}
.nav-links {
display: flex;
gap: 0.5rem;
}
.nav-links a {
padding: 0.4rem 0.75rem;
border-radius: var(--radius);
color: var(--text-muted);
text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active {
background: var(--bg);
color: var(--text);
text-decoration: none;
}
.nav-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.inline-form { margin: 0; }
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
padding: 0.5rem 1rem;
border: 1px solid transparent;
border-radius: var(--radius);
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
text-decoration: none;
background: var(--surface);
color: var(--text);
}
.btn:hover { text-decoration: none; }
.btn-primary {
background: var(--primary);
color: #fff;
}
.btn-primary:hover {
background: var(--primary-hover);
color: #fff;
}
.btn-secondary {
border-color: var(--border);
}
.btn-ghost {
background: transparent;
color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }
.btn-block { width: 100%; }
.btn-icon {
background: transparent;
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.35rem 0.6rem;
cursor: pointer;
color: var(--text);
font-size: 1rem;
}
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
/* Cards & layout */
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin-bottom: 1.5rem;
flex-wrap: wrap;
}
.page-header h1 {
margin: 0;
font-size: 1.75rem;
}
.header-actions {
display: flex;
align-items: center;
gap: 0.75rem;
}
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.25rem;
box-shadow: var(--shadow);
margin-bottom: 1.5rem;
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
}
.card-header h2 {
margin: 0;
font-size: 1.1rem;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 1rem;
margin-bottom: 1.5rem;
}
.stat-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.25rem;
text-align: center;
box-shadow: var(--shadow);
}
.stat-value {
display: block;
font-size: 2rem;
font-weight: 700;
color: var(--primary);
}
.stat-label {
color: var(--text-muted);
font-size: 0.85rem;
}
/* Tables */
.table-wrap { overflow-x: auto; }
table {
width: 100%;
border-collapse: collapse;
}
th, td {
text-align: left;
padding: 0.75rem;
border-bottom: 1px solid var(--border);
}
th {
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--text-muted);
}
code {
font-family: var(--mono);
font-size: 0.85em;
background: var(--bg);
padding: 0.15rem 0.4rem;
border-radius: 4px;
}
/* Badges */
.badge {
display: inline-block;
padding: 0.2rem 0.55rem;
border-radius: 999px;
font-size: 0.75rem;
font-weight: 600;
}
.badge-draft {
background: #fff3cd;
color: #856404;
}
.badge-published {
background: #d4edda;
color: #155724;
}
[data-theme="dark"] .badge-draft {
background: #3d3419;
color: #ffd666;
}
[data-theme="dark"] .badge-published {
background: #1a3d2b;
color: #6fcf97;
}
/* Forms */
.form label,
.post-form label {
display: flex;
flex-direction: column;
gap: 0.35rem;
margin-bottom: 1rem;
}
.form label span,
.post-form label span {
font-size: 0.85rem;
font-weight: 500;
color: var(--text-muted);
}
input[type="text"],
input[type="password"],
input[type="search"],
input[type="datetime-local"],
textarea {
padding: 0.6rem 0.75rem;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--bg);
color: var(--text);
font-size: 1rem;
font-family: inherit;
width: 100%;
}
input:focus,
textarea:focus {
outline: 2px solid var(--primary);
outline-offset: 1px;
}
.form-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0 1rem;
}
.span-2 { grid-column: span 2; }
.checkbox-label {
flex-direction: row !important;
align-items: center;
gap: 0.5rem !important;
}
.checkbox-label input { width: auto; }
.search-bar {
display: flex;
gap: 0.5rem;
margin-bottom: 1.5rem;
flex-wrap: wrap;
}
.search-bar input { flex: 1; min-width: 200px; }
/* Login */
.login-page {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
}
.login-card {
width: 100%;
max-width: 380px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 2rem;
box-shadow: var(--shadow);
}
.login-card h1 {
margin: 0 0 0.25rem;
text-align: center;
}
.subtitle {
text-align: center;
color: var(--text-muted);
margin: 0 0 1.5rem;
}
/* Alerts */
.alert {
padding: 0.75rem 1rem;
border-radius: var(--radius);
margin-bottom: 1rem;
}
.alert-error {
background: #fde8e8;
color: var(--danger);
border: 1px solid #f5c6c6;
}
[data-theme="dark"] .alert-error {
background: #3d1f1f;
border-color: #5c2a2a;
}
.empty-state {
color: var(--text-muted);
text-align: center;
padding: 2rem;
}
.save-status {
font-size: 0.85rem;
color: var(--text-muted);
}
.save-status.saving { color: var(--primary); }
.save-status.saved { color: var(--success); }
.save-status.error { color: var(--danger); }
/* Editor */
.editor-label { margin-top: 1rem; }
.editor-toolbar-extra {
display: flex;
gap: 0.5rem;
margin-top: 0.75rem;
flex-wrap: wrap;
}
.EasyMDEContainer {
border-radius: var(--radius);
overflow: hidden;
}
[data-theme="dark"] .EasyMDEContainer .CodeMirror,
[data-theme="dark"] .editor-toolbar {
background: var(--bg);
color: var(--text);
border-color: var(--border);
}
[data-theme="dark"] .EasyMDEContainer .editor-preview {
background: var(--surface);
color: var(--text);
}
/* Media */
.upload-form {
display: flex;
align-items: center;
gap: 0.75rem;
flex-wrap: wrap;
}
.media-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 1rem;
padding: 1rem;
max-height: 60vh;
overflow-y: auto;
}
.media-grid-page {
max-height: none;
padding: 0;
margin-top: 1rem;
}
.media-item {
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
background: var(--bg);
cursor: pointer;
}
.media-item img {
width: 100%;
aspect-ratio: 1;
object-fit: cover;
display: block;
}
.media-meta {
padding: 0.5rem;
display: flex;
flex-direction: column;
gap: 0.35rem;
}
.media-meta code {
font-size: 0.7rem;
word-break: break-all;
}
/* Modal */
.modal {
position: fixed;
inset: 0;
z-index: 200;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
}
.modal.hidden { display: none; }
.modal-backdrop {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.5);
}
.modal-content {
position: relative;
background: var(--surface);
border-radius: var(--radius);
width: 100%;
max-width: 700px;
max-height: 80vh;
display: flex;
flex-direction: column;
box-shadow: var(--shadow);
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 1.25rem;
border-bottom: 1px solid var(--border);
}
.modal-header h2 {
margin: 0;
font-size: 1.1rem;
}
.error-detail {
background: var(--bg);
padding: 1rem;
border-radius: var(--radius);
overflow-x: auto;
font-size: 0.85rem;
}
.link { font-size: 0.9rem; }
/* Responsive */
@media (max-width: 640px) {
.form-grid { grid-template-columns: 1fr; }
.span-2 { grid-column: span 1; }
.topnav {
flex-wrap: wrap;
}
.nav-links {
order: 3;
width: 100%;
justify-content: center;
}
.page-header {
flex-direction: column;
align-items: flex-start;
}
}