refactor: move action button styles to shared app.css
- Extract .action-btn-circle styles to app.css for reuse - Remove duplicate button styles from ArtistDetailView and AlbumDetailView - Use theme-aware colors (--text-primary) instead of hardcoded white - Icons now use currentColor for theme compatibility
This commit is contained in:
1 parent
4b999c4561
commit
a87b8e11bb
3 files changed
+52
-81
No files matched your search
+46
@@ -346,3 +346,49 @@ select {
|
||||
.tabular-nums {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* ============ Action Buttons ============ */
|
||||
/* Reusable circular action buttons for headers and toolbars */
|
||||
|
||||
.action-btn-circle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
|
||||
}
|
||||
|
||||
.action-btn-circle:hover:not(:disabled) {
|
||||
background: var(--bg-hover);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--text-primary);
|
||||
}
|
||||
|
||||
.action-btn-circle:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.action-btn-circle.primary {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
background: var(--accent-primary);
|
||||
border: 2px solid var(--text-primary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.action-btn-circle.primary:hover {
|
||||
background: var(--accent-hover);
|
||||
}
|
||||
|
||||
.action-btn-circle.is-active {
|
||||
background: rgba(var(--accent-primary-rgb, 66, 133, 244), 0.15);
|
||||
border-color: var(--accent-primary);
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
@@ -215,22 +215,22 @@
|
||||
<!-- Action Buttons -->
|
||||
<div class="actions">
|
||||
<button
|
||||
class="action-btn primary"
|
||||
class="action-btn-circle primary"
|
||||
onclick={onPlayAll}
|
||||
title="Play"
|
||||
>
|
||||
<Play size={20} fill="white" color="white" />
|
||||
<Play size={20} fill="currentColor" color="currentColor" />
|
||||
</button>
|
||||
<button
|
||||
class="action-btn"
|
||||
class="action-btn-circle"
|
||||
onclick={onShuffleAll}
|
||||
title="Shuffle"
|
||||
>
|
||||
<Shuffle size={18} />
|
||||
</button>
|
||||
<button
|
||||
class="action-btn"
|
||||
class:is-favorite={isFavorite}
|
||||
class="action-btn-circle"
|
||||
class:is-active={isFavorite}
|
||||
onclick={toggleFavorite}
|
||||
disabled={isFavoriteLoading}
|
||||
title={isFavorite ? 'Remove from favorites' : 'Add to favorites'}
|
||||
@@ -438,49 +438,6 @@
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
|
||||
}
|
||||
|
||||
.action-btn:hover:not(:disabled) {
|
||||
background: var(--bg-hover);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--text-primary);
|
||||
}
|
||||
|
||||
.action-btn:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.action-btn.primary {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
background: var(--accent-primary);
|
||||
border: 2px solid white;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.action-btn.primary:hover {
|
||||
background: var(--accent-hover);
|
||||
}
|
||||
|
||||
.action-btn.is-favorite {
|
||||
background: rgba(var(--accent-primary-rgb, 139, 92, 246), 0.15);
|
||||
border-color: var(--accent-primary);
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
/* Style AlbumMenu trigger to match action buttons */
|
||||
.actions :global(.album-menu .menu-trigger) {
|
||||
width: 36px;
|
||||
|
||||
@@ -1071,7 +1071,7 @@
|
||||
{#if topTracks.length > 0}
|
||||
<div class="section-header-actions">
|
||||
<button class="action-btn-circle primary" onclick={handlePlayAllTracks} title="Play All">
|
||||
<Play size={20} fill="white" color="white" />
|
||||
<Play size={20} fill="currentColor" color="currentColor" />
|
||||
</button>
|
||||
<div class="context-menu-wrapper">
|
||||
<button
|
||||
@@ -2469,38 +2469,6 @@
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.action-btn-circle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 1px solid var(--text-muted);
|
||||
border-radius: 50%;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
|
||||
}
|
||||
|
||||
.action-btn-circle:hover {
|
||||
background: var(--bg-hover);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--text-primary);
|
||||
}
|
||||
|
||||
.action-btn-circle.primary {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
background: var(--accent-primary);
|
||||
color: white;
|
||||
border: 2px solid white;
|
||||
}
|
||||
|
||||
.action-btn-circle.primary:hover {
|
||||
background: var(--accent-hover);
|
||||
}
|
||||
|
||||
.context-menu-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user