From 0958111341a6ddcc409194c9d7a228e450b348d9 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Mon, 30 Sep 2024 16:10:26 -0700 Subject: [PATCH] Share styles between pet types and alt styles as "rainbow-pool" CSS --- app/assets/stylesheets/alt_styles/index.sass | 12 ------------ app/assets/stylesheets/application/rainbow-pool.sass | 11 +++++++++++ app/assets/stylesheets/pet_types/index.sass | 12 ------------ app/views/alt_styles/index.html.haml | 4 +++- app/views/pet_types/index.html.haml | 3 ++- 5 files changed, 16 insertions(+), 26 deletions(-) create mode 100644 app/assets/stylesheets/application/rainbow-pool.sass diff --git a/app/assets/stylesheets/alt_styles/index.sass b/app/assets/stylesheets/alt_styles/index.sass index 9334c532..57c6dbc3 100644 --- a/app/assets/stylesheets/alt_styles/index.sass +++ b/app/assets/stylesheets/alt_styles/index.sass @@ -1,15 +1,3 @@ -.filters - fieldset - display: flex - flex-direction: row - align-items: center - justify-content: center - gap: .5em - - legend - display: contents - font-weight: bold - .alt-styles-header margin-top: 1em margin-bottom: .5em diff --git a/app/assets/stylesheets/application/rainbow-pool.sass b/app/assets/stylesheets/application/rainbow-pool.sass new file mode 100644 index 00000000..2303e806 --- /dev/null +++ b/app/assets/stylesheets/application/rainbow-pool.sass @@ -0,0 +1,11 @@ +.rainbow-pool-filters + fieldset + display: flex + flex-direction: row + align-items: center + justify-content: center + gap: .5em + + legend + display: contents + font-weight: bold diff --git a/app/assets/stylesheets/pet_types/index.sass b/app/assets/stylesheets/pet_types/index.sass index 06990667..8f337c63 100644 --- a/app/assets/stylesheets/pet_types/index.sass +++ b/app/assets/stylesheets/pet_types/index.sass @@ -1,17 +1,5 @@ @import "../partials/clean/constants" -.pet-filters - fieldset - display: flex - flex-direction: row - align-items: center - justify-content: center - gap: .5em - - legend - display: contents - font-weight: bold - [role=navigation] margin-block: .5em text-align: center diff --git a/app/views/alt_styles/index.html.haml b/app/views/alt_styles/index.html.haml index ad1130f1..7af6826b 100644 --- a/app/views/alt_styles/index.html.haml +++ b/app/views/alt_styles/index.html.haml @@ -14,7 +14,8 @@ wearable items, there's not a great way for us to get style tokens onto tradelists… this may change someday, but probably not soon, sorry! -= form_with url: alt_styles_path, method: :get, class: "filters" do |f| += form_with url: alt_styles_path, method: :get, + class: "rainbow-pool-filters" do |f| %fieldset %legend Filter by: = f.select :color, Color.order(:name).map(&:human_name), @@ -28,4 +29,5 @@ %ul.alt-styles-list= render partial: "alt_style", collection: species_styles - content_for :stylesheets do + = stylesheet_link_tag "application/rainbow-pool" = page_stylesheet_link_tag "alt_styles/index" diff --git a/app/views/pet_types/index.html.haml b/app/views/pet_types/index.html.haml index 623fdb60..43781168 100644 --- a/app/views/pet_types/index.html.haml +++ b/app/views/pet_types/index.html.haml @@ -1,7 +1,7 @@ - title "Rainbow Pool" - use_responsive_design -= form_with method: :get, class: "pet-filters" do |form| += form_with method: :get, class: "rainbow-pool-filters" do |form| %fieldset %legend Filter by: = form.select :color, @color_names, selected: @selected_color&.human_name, include_blank: "Color…" @@ -15,4 +15,5 @@ = will_paginate @pet_types - content_for :stylesheets do + = stylesheet_link_tag "application/rainbow-pool" = page_stylesheet_link_tag "pet_types/index"