Skip to content
Merged
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
6 changes: 1 addition & 5 deletions .github/scripts/check_svgs_on_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,14 @@ def check_svgs(svg_file_paths: List[Path]):
err_msg.append(f"-root is '{root.tag}'. Root must be an 'svg' element")

if root.get("viewBox") != "0 0 128 128":
err_msg.append("-'viewBox' is not '0 0 128 128' -> Set it or scale the file using https://www.iloveimg.com/resize-image/resize-svg")
err_msg.append("-'viewBox' is not '0 0 128 128' -> Set it or scale the file using https://www.iloveimg.com/resize-image/resize-svg.")

if root.get("x") is not None:
err_msg.append("-unneccessary 'x' attribute in svg root element -> Remove it")

if root.get("y") is not None:
err_msg.append("-unneccessary 'y' attribute in svg root element -> Remove it")

style = root.findtext(f".//{namespace}style")
if style != None and "fill" in style:
err_msg.append("-contains style declaration using 'fill' -> Replace classes with the 'fill' attribute instead")

if len(err_msg) > 1:
err_msgs.append("\n".join(err_msg))
except et.ParseError as e:
Expand Down