Skip to content

Commit

Permalink
Refactor: お品書きの画像のCSS指定を名前をつけて共通化した
Browse files Browse the repository at this point in the history
  • Loading branch information
yonta committed Jan 20, 2025
1 parent ebbea51 commit 3e2f2c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ $accent: #b7282e;
font-family: "Yuji Syuku", serif;
}

.menu-img {
@extend .w-25;
@extend .img-fluid;

min-width: "140px";
}

.accent-text {
color: $accent;
}
Expand Down
4 changes: 2 additions & 2 deletions app/views/sakes/_menu_one_drink.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<div class="d-flex align-items-end justify-content-between">
<% if sake.photos.any? %>
<% photo = sake.photos.first %>
<%= cl_image_tag(photo.image.thumb.url, class: "rounded img-fluid w-25", style: "min-width: 140px") %>
<%= cl_image_tag(photo.image.thumb.url, class: "menu-img rounded") %>

<% else %>
<%= cl_image_tag(image_url("sake-no-photo.avif"), class: "w-25 img-thumbnail", style: "min-width: 140px") %>
<%= cl_image_tag(image_url("sake-no-photo.avif"), class: "menu-img img-thumbnail") %>
<% end %>
<div class="flex-grow-1 ms-5 text-end price-tag-border fs-4">
<%= price_tag(sake.selling_price) %>
Expand Down

0 comments on commit 3e2f2c4

Please sign in to comment.