-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
devopsDevops/automation related enhancementsDevops/automation related enhancementsdiscussionCommunity discussions about changes/features/..Community discussions about changes/features/..enhancement
Description
As proposed in #403 and #400 we would like to introduce a new requirement for adding SVG icons to this project:
SVGs are not allowed to have classes
for defining properties but instead enforcing inline css to declare styling. This might not considered best practice in general but in this case it provides a cleaner look of your icons and solving decleration issues which can occur when classes are beeing used.
Bad example (no longer allowed)
<svg viewBox="0 0 128 128">
<defs>
<style>
.cls-1 {
fill: #cb3837;
}
</style>
</defs>
<title>Artboard 5</title>
<path
id="original-wordmark"
class="cls-1"
d="M2,38.5H126V82.21H64V89.5H36.44V82.21H2ZM8.89,74.93H22.67V53.07h6.89V74.93h6.89V45.79H8.89ZM43.33,45.79V82.21H57.11V74.93H70.89V45.79Zm13.78,7.29H64V67.64H57.11Zm20.67-7.29V74.93H91.56V53.07h6.89V74.93h6.89V53.07h6.89V74.93h6.89V45.79Z"
></path>
</svg>
Improved example (what the rule should enforce)
<svg role="img" viewBox="0 0 128 128">
<path
fill="#cb3837"
d="M2,38.5H126V82.21H64V89.5H36.44V82.21H2ZM8.89,74.93H22.67V53.07h6.89V74.93h6.89V45.79H8.89ZM43.33,45.79V82.21H57.11V74.93H70.89V45.79Zm13.78,7.29H64V67.64H57.11Zm20.67-7.29V74.93H91.56V53.07h6.89V74.93h6.89V53.07h6.89V74.93h6.89V45.79Z"
></path>
</svg>
Since this can be checked automated it would improve the reviewing process when this rule would be checked by a gihub action on every pull request.
Thomas-Boi
Metadata
Metadata
Assignees
Labels
devopsDevops/automation related enhancementsDevops/automation related enhancementsdiscussionCommunity discussions about changes/features/..Community discussions about changes/features/..enhancement