Skip to content

Commit

Permalink
Fix style issue of song list in album of various artist page
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Jan 4, 2024
1 parent 3aaee32 commit 1ca6d07
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/components/_action_bar.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use "../tools/functions" as *;

.c-action-bar {
padding: spacing("narrow");
padding: spacing("tiny") spacing("narrow");
border-radius: border-radius("medium");
background: var(--action-bar-bg-color);
}
4 changes: 4 additions & 0 deletions app/assets/stylesheets/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
padding: spacing("tiny") spacing("narrow");
cursor: pointer;
font-size: font-size("medium");

&:hover {
text-decoration: none;
}
}

.c-button--primary {
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/components/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
text-transform: uppercase;
}

.c-list__item__subtext {
display: inline-block;
margin-top: spacing("tiny");
color: var(--list-subtext-color);
}

.c-list--border-none .c-list__item {
border-bottom: none;
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/elements/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ a {
}

a:hover {
color: var(--link-active-color);
text-decoration: underline;
}

a.is-active {
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/settings/_dark_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
--list-border-color: #{$grey-800};
--list-active-color: #{$primary-color};
--list-grouped-bg-color: #{$grey-900};
--list-subtext-color: #{$grey-400};

/* Table */
--table-border-color: #{$grey-900};
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/settings/_light_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
--list-border-color: #{$grey-200};
--list-active-color: #{$primary-color};
--list-grouped-bg-color: #{$grey-100};
--list-subtext-color: #{$grey-500};

/* Table */
--table-border-color: #{$grey-200};
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/controllers/mixins/event_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class EventHandler {
const handler = {
listener (event) {
if (targetMatching) {
if (event.target.dataset.preventDelegation) { return }

const target = event.target.closest(targetMatching)
if (!target) { return }
}
Expand Down
4 changes: 2 additions & 2 deletions app/views/albums/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
) do %>
<div class='o-flex o-flex--justify-between o-flex--align-center'>
<div>
<span class='u-mb-tiny' data-test-id='album_song_name'><%= song.name %></span>
<div data-test-id='album_song_name'><%= song.name %></div>
<% if @album.artist.various? %>
<%= song.artist.name %>
<%= link_to song.artist.name, artist_path(song.artist), class: "c-list__item__subtext" %>
<% end %>
</div>
<div class='u-text-monospace u-mr-narrow'><%= format_duration(song.duration) %></div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/current_playlist/songs/_song.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<button class='c-button c-button--link o-flex__item--grow-1' data-delegated-action='current-playlist-songs#play'>
<div class='o-flex o-flex--justify-between o-flex--align-center'>
<div class='u-mr-narrow'>
<span class='u-mb-tiny u-text-line-clamp-2' data-test-id='current_playlist_song_name'><%= song.name %></span>
<%= song.artist.name %>
<span class='u-text-line-clamp-2' data-test-id='current_playlist_song_name'><%= song.name %></span>
<%= link_to song.artist.name, artist_path(song.artist), class: "c-list__item__subtext", data: {"turbo-frame" => "_top", "prevent-delegation" => true} %>
</div>
<div class='u-text-monospace u-mr-narrow'><%= format_duration(song.duration) %></div>
</div>
Expand Down

0 comments on commit 1ca6d07

Please sign in to comment.