diff --git a/app/assets/stylesheets/components/_nav.scss b/app/assets/stylesheets/components/_nav.scss index eda03137337..f9b2fad941b 100644 --- a/app/assets/stylesheets/components/_nav.scss +++ b/app/assets/stylesheets/components/_nav.scss @@ -12,10 +12,10 @@ } .sidenav-mobile .usa-nav__close { - @include add-background-svg('close-primary'); + @include u-display('flex'); + @include u-flex('align-center', 'justify-center'); @include u-square(6); - background-position: center center; - background-repeat: no-repeat; + @include u-text('primary'); } @media (prefers-reduced-motion) { diff --git a/app/components/icon_component.html.erb b/app/components/icon_component.html.erb index 3e176a8b966..59d6b4b5695 100644 --- a/app/components/icon_component.html.erb +++ b/app/components/icon_component.html.erb @@ -4,7 +4,7 @@ focusable: 'false', role: 'img', **tag_options, - class: ['usa-icon', *tag_options[:class]], + class: css_class, ) do %> <% end %> diff --git a/app/components/icon_component.rb b/app/components/icon_component.rb index f0c679a5955..40250ff994a 100644 --- a/app/components/icon_component.rb +++ b/app/components/icon_component.rb @@ -244,15 +244,22 @@ class IconComponent < BaseComponent zoom_out_map ].to_set.freeze - attr_reader :icon, :tag_options + attr_reader :icon, :size, :tag_options - def initialize(icon:, **tag_options) + def initialize(icon:, size: nil, **tag_options) raise ArgumentError, "`icon` #{icon} is not a valid icon" if !ICONS.include?(icon) @icon = icon + @size = size @tag_options = tag_options end + def css_class + classes = ['usa-icon', *tag_options[:class]] + classes << "usa-icon--size-#{size}" if size + classes + end + def icon_path asset_path([asset_path('sprite.svg'), '#', icon].join, host: asset_host) end diff --git a/app/views/accounts/_mobile_nav.html.erb b/app/views/accounts/_mobile_nav.html.erb index 2cfd0b730a2..2d38eaf9aba 100644 --- a/app/views/accounts/_mobile_nav.html.erb +++ b/app/views/accounts/_mobile_nav.html.erb @@ -1,6 +1,7 @@