From 08717246c04167f05debaf3088987c4365262866 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Mon, 23 Oct 2023 18:04:49 +0200 Subject: [PATCH] Let icons be 16px when unstyled This prevents them from being giant when shown in page captures made by capybara. --- admin/app/components/solidus_admin/ui/icon/component.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/app/components/solidus_admin/ui/icon/component.rb b/admin/app/components/solidus_admin/ui/icon/component.rb index c46963c1de8..ab3ccc3d9d8 100644 --- a/admin/app/components/solidus_admin/ui/icon/component.rb +++ b/admin/app/components/solidus_admin/ui/icon/component.rb @@ -16,6 +16,10 @@ def initialize(name:, **attrs) # Hide the icon from screen readers by default. @attrs['aria-hidden'] = true unless @attrs.key?('aria-hidden') + + # Default icons without style to 16x16, mostly useful in test snapshots. + @attrs['width'] = '16' + @attrs['height'] = '16' end def call