Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent SVG shrinking (#25652) #25669

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,6 @@ progress::-moz-progress-bar {
opacity: 1 !important;
}

.svg {
display: inline-block;
vertical-align: text-top;
fill: currentcolor;
}

.middle .svg {
vertical-align: middle;
}

.unselectable,
.button,
.lines-num,
Expand Down
1 change: 1 addition & 0 deletions web_src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@import "./modules/breadcrumb.css";
@import "./modules/card.css";
@import "./modules/comment.css";
@import "./modules/svg.css";

@import "./shared/issuelist.css";
@import "./shared/milestone.css";
Expand Down
41 changes: 41 additions & 0 deletions web_src/css/modules/svg.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.svg {
display: inline-block;
vertical-align: text-top;
fill: currentcolor;
}

.middle .svg {
vertical-align: middle;
}

/* prevent SVGs from shrinking, like in space-starved flexboxes. the sizes
here are cherry-picked for our use cases, feel free to add more. after
https://developer.mozilla.org/en-US/docs/Web/CSS/attr#type-or-unit is
supported in browsers, use `attr(width px)` instead for a generic
solution. */

.svg[height="12"] { min-height: 12px; }
.svg[height="13"] { min-height: 13px; }
.svg[height="14"] { min-height: 14px; }
.svg[height="15"] { min-height: 15px; }
.svg[height="16"] { min-height: 16px; }
.svg[height="18"] { min-height: 18px; }
.svg[height="20"] { min-height: 20px; }
.svg[height="22"] { min-height: 22px; }
.svg[height="24"] { min-height: 24px; }
.svg[height="36"] { min-height: 36px; }
.svg[height="48"] { min-height: 48px; }
.svg[height="56"] { min-height: 56px; }

.svg[width="12"] { min-width: 12px; }
.svg[width="13"] { min-width: 13px; }
.svg[width="14"] { min-width: 14px; }
.svg[width="15"] { min-width: 15px; }
.svg[width="16"] { min-width: 16px; }
.svg[width="18"] { min-width: 18px; }
.svg[width="20"] { min-width: 20px; }
.svg[width="22"] { min-width: 22px; }
.svg[width="24"] { min-width: 24px; }
.svg[width="36"] { min-width: 36px; }
.svg[width="48"] { min-width: 48px; }
.svg[width="56"] { min-width: 56px; }