base ui #11

Merged
pi3c merged 10 commits from feature/base_ui into dev 2026-05-02 16:10:18 +00:00
6 changed files with 123 additions and 26 deletions
Showing only changes of commit 2aed9f5c8a - Show all commits

View File

@@ -50,7 +50,12 @@
<span class="tag" data-testid="post-tag-{{ post.id }}-{{ loop.index }}">{{ tag }}</span> <span class="tag" data-testid="post-tag-{{ post.id }}-{{ loop.index }}">{{ tag }}</span>
{% endfor %} {% endfor %}
</div> </div>
<a href="/posts/{{ post.id }}" class="btn btn-sm" data-testid="btn-read-more-{{ post.id }}">Read more</a> <a href="/posts/{{ post.id }}" class="btn btn-sm" data-testid="btn-read-more-{{ post.id }}">
Read more
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" style="margin-left: 0.25rem;">
<path d="M6 12L10 8L6 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</a>
</div> </div>
</article> </article>
{% endfor %} {% endfor %}

View File

@@ -39,7 +39,10 @@
<div class="flex justify-between items-center" data-testid="post-detail-actions"> <div class="flex justify-between items-center" data-testid="post-detail-actions">
<a href="/" class="btn" data-testid="btn-back-to-posts"> <a href="/" class="btn" data-testid="btn-back-to-posts">
← Back to posts <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" style="margin-right: 0.5rem;">
<path d="M10 12L6 8L10 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
Back to posts
</a> </a>
<div class="flex gap-2" data-testid="post-detail-edit-actions"> <div class="flex gap-2" data-testid="post-detail-edit-actions">

View File

@@ -15,15 +15,15 @@
type="button" type="button"
class="theme-toggle" class="theme-toggle"
data-testid="theme-toggle" data-testid="theme-toggle"
aria-label="Toggle theme" aria-label="Toggle dark mode"
title="Toggle theme" title="Toggle dark mode"
> >
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-testid="theme-light-icon" style="display: none;"> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-testid="theme-light-icon" style="display: none;">
<path d="M10 2v2M10 16v2M4.22 4.22l1.42 1.42M14.36 14.36l1.42 1.42M2 10h2M16 10h2M4.22 15.78l1.42-1.42M14.36 5.64l1.42-1.42" stroke="currentColor" stroke-width="2" stroke-linecap="round"/> <path d="M10 2v2M10 16v2M4.22 4.22l1.42 1.42M14.36 14.36l1.42 1.42M2 10h2M16 10h2M4.22 15.78l1.42-1.42M14.36 5.64l1.42-1.42" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="10" cy="10" r="4" stroke="currentColor" stroke-width="2"/> <circle cx="10" cy="10" r="3" stroke="currentColor" stroke-width="2"/>
</svg> </svg>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-testid="theme-dark-icon" style="display: none;"> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-testid="theme-dark-icon" style="display: none;">
<path d="M18 10.79A9 9 0 1 1 9.21 2 7 7 0 0 0 18 10.79z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M17.293 13.293A8 8 0 116.707 2.707a8.003 8.003 0 0010.586 10.586z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg> </svg>
</button> </button>

View File

@@ -102,7 +102,15 @@ pre code {
/* Focus styles */ /* Focus styles */
:focus-visible { :focus-visible {
outline: 2px solid var(--color-primary); outline: 2px solid var(--color-primary);
outline-offset: 2px; outline-offset: 3px;
}
/* Enhanced link focus for accessibility */
a:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 4px;
} }
/* Scrollbar */ /* Scrollbar */

View File

@@ -104,13 +104,14 @@
.card { .card {
background-color: var(--color-box-body); background-color: var(--color-box-body);
border: 1px solid var(--color-border); border: 1px solid var(--color-border);
border-radius: 6px; border-radius: 8px;
overflow: hidden; overflow: hidden;
transition: box-shadow 0.2s ease; box-shadow: 0 1px 3px var(--color-shadow);
transition: all 0.2s ease;
} }
.card:hover { .card:hover {
box-shadow: 0 2px 8px var(--color-shadow); box-shadow: 0 4px 12px var(--color-shadow);
} }
.card-header { .card-header {
@@ -121,7 +122,7 @@
} }
.card-body { .card-body {
padding: 1.25rem; padding: 1.5rem 2rem;
} }
.card-footer { .card-footer {
@@ -254,13 +255,14 @@
.badge { .badge {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
padding: 0.125rem 0.5rem; padding: 0.25rem 0.75rem;
font-size: 0.75rem; font-size: 0.75rem;
font-weight: 500; font-weight: 600;
line-height: 1.5; line-height: 1.5;
border-radius: 9999px; border-radius: 9999px;
background-color: var(--color-label-bg); background-color: var(--color-label-bg);
color: var(--color-label-text); color: var(--color-label-text);
white-space: nowrap;
} }
.badge-primary { .badge-primary {
@@ -288,16 +290,31 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 0.25rem; gap: 0.25rem;
padding: 0.125rem 0.5rem; padding: 0.25rem 0.75rem;
font-size: 0.75rem; font-size: 0.8125rem;
font-weight: 500;
background-color: var(--color-secondary-light-3); background-color: var(--color-secondary-light-3);
border: 1px solid var(--color-border); border: 1px solid var(--color-border);
border-radius: 4px; border-radius: 6px;
color: var(--color-text-light); color: var(--color-text-light);
cursor: pointer;
transition: all 0.2s ease;
} }
.tag:hover { .tag:hover {
background-color: var(--color-hover); background-color: var(--color-primary-alpha-10);
border-color: var(--color-primary);
color: var(--color-primary);
}
/* Checkbox styling */
input[type="checkbox"] {
width: 1.25rem;
height: 1.25rem;
margin-right: 0.5rem;
accent-color: var(--color-primary);
cursor: pointer;
vertical-align: middle;
} }
/* Avatar */ /* Avatar */

View File

@@ -228,14 +228,20 @@
.post-list { .post-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.5rem; gap: 2rem;
} }
/* Post card specific */ /* Post card specific */
.post-card { .post-card {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1.25rem;
padding: 1.5rem;
transition: all 0.2s ease;
}
.post-card:hover {
transform: translateY(-2px);
} }
.post-card-header { .post-card-header {
@@ -247,7 +253,8 @@
.post-card-title { .post-card-title {
margin-bottom: 0; margin-bottom: 0;
font-size: 1.25rem; font-size: 1.5rem;
line-height: 1.3;
} }
.post-card-title a { .post-card-title a {
@@ -263,7 +270,8 @@
align-items: center; align-items: center;
gap: 1rem; gap: 1rem;
font-size: 0.875rem; font-size: 0.875rem;
color: var(--color-text-light-2); color: var(--color-text-light-1);
margin-bottom: 0.75rem;
} }
.post-card-meta-item { .post-card-meta-item {
@@ -273,8 +281,9 @@
} }
.post-card-content { .post-card-content {
color: var(--color-text-light); color: var(--color-text-light-1);
line-height: 1.6; line-height: 1.7;
font-size: 1rem;
} }
.post-card-footer { .post-card-footer {
@@ -423,15 +432,70 @@
@media (max-width: 768px) { @media (max-width: 768px) {
.site-header .container { .site-header .container {
height: 3.5rem; height: 3.5rem;
padding: 0 1.25rem;
} }
.main-nav { .main-nav {
display: none; display: none;
} }
.mobile-menu-btn { .mobile-menu-btn {
display: flex; display: flex;
} }
/* Form actions mobile */
.form-actions {
flex-direction: column-reverse;
gap: 1rem;
}
.form-actions .btn {
width: 100%;
}
/* Footer mobile */
.site-footer .container {
flex-direction: column;
text-align: center;
gap: 1.5rem;
padding: 2rem 1rem;
}
.footer-links {
flex-wrap: wrap;
justify-content: center;
}
/* Post card mobile */
.post-card {
padding: 1.25rem;
}
.post-card-title {
font-size: 1.25rem;
}
.post-card-header {
flex-direction: column;
gap: 0.75rem;
}
.post-card-footer {
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}
/* Page header mobile */
.page-header-flex {
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}
.page-title {
font-size: 1.75rem;
}
} }
@media (min-width: 769px) { @media (min-width: 769px) {