Skip to content

Commit

Permalink
use svg css class of redmine 6 and drop a-svg class
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Nov 13, 2024
1 parent aab0ba7 commit c4c7ddd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 48 deletions.
2 changes: 1 addition & 1 deletion app/helpers/additionals_icons_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def additionals_asset_path(file)
def additionals_svg_sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: 'icons', css_class: nil, title: nil)
sprite_path = "#{sprite}.svg"
title = l title if title.is_a? Symbol
css_classes = "a-s#{size} a-svg-icon"
css_classes = "s#{size} svg-icon"
css_classes += " #{css_class}" if css_class

content_tag(
Expand Down
63 changes: 19 additions & 44 deletions assets/stylesheets/additionals.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ em.info a.external {
}

.a-icon.icon-padding,
.a-svg-icon.icon-padding {
.svg-icon.icon-padding {
padding-right: 2px;
}

Expand All @@ -79,56 +79,31 @@ h3.a-icon-label {
margin-left: 4px;
}

svg.a-icon-svg {
stroke: #169;
fill: none;
stroke-width: 1.5;
vertical-align: middle;
}

svg.a-svg-icon.smiley {
svg.svg-icon.smiley {
fill: #edae40;
stroke-width: 2;
}

svg.a-s64 {
width: 64px;
height: 64px;
}

svg.a-s32 {
width: 32px;
height: 32px;
}

svg.a-s24 {
width: 1.5rem;
height: 1.5rem;
}

svg.a-s20 {
width: 1.25rem;
height: 1.25rem;
}

svg.a-s18 {
width: 1.125rem;
height: 1.125rem;
}
svg {
&.s64 {
width: 64px;
height: 64px;
}

svg.a-s16 {
width: 1rem;
height: 1rem;
}
&.s32 {
width: 32px;
height: 32px;
}

svg.a-s14 {
width: 0.875rem;
height: 0.875rem;
}
&.s24 {
width: 1.5rem;
height: 1.5rem;
}

svg.a-s12 {
width: 0.75rem;
height: 0.75rem;
&.s16 {
width: 1rem;
height: 1rem;
}
}

.sudo-admin { color: #d80000; }
Expand Down
2 changes: 1 addition & 1 deletion test/unit/wiki_formating/common_mark_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_smileys
with_plugin_settings 'additionals', legacy_smiley_support: 1,
emoji_support: 0 do
assert_includes smiley_filter('A small test :) with an smiley'), '#icon--smiley-smiley'
assert_includes smiley_filter('A small test :) with an smiley'), 'a-s18 a-svg-icon smiley'
assert_includes smiley_filter('A small test :) with an smiley'), 's18 svg-icon smiley'
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/unit/wiki_formating/textile_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def test_smileys
# this is required, because inline_smileys are activated with controller action
@formatter::RULES << :inline_smileys

@to_test['A test with a :) smiley'] = ['#icon--smiley-smiley', 'a-s18 a-svg-icon smiley']
@to_test[':) :)'] = ['#icon--smiley-smiley', 'a-s18 a-svg-icon smiley']
@to_test['A test with a :) smiley'] = ['#icon--smiley-smiley', 's18 svg-icon smiley']
@to_test[':) :)'] = ['#icon--smiley-smiley', 's18 svg-icon smiley']

assert_html_output @to_test
end
Expand Down

0 comments on commit c4c7ddd

Please sign in to comment.