Proposal: svgs should have a viewBox defined
Description
While digging around for the solution to a aspect ratio issue of an empty state I found that we have a few svgs that don't have a viewBox
defined.
As I understand viewBox
is useful to prevent preserve aspect ratio as this attribute is influenced by the preserveAspectRatio
attribute.
viewBox
List of svgs without a $ grep -Lr "viewBox" **/*.svg
illustrations/Dependency-list-empty-state.svg
illustrations/chat-bubble-sm.svg
illustrations/deploy-boards.svg
illustrations/gift-sm.svg
illustrations/gitlab-saas.svg
illustrations/group-import.svg
illustrations/group-new.svg
illustrations/merge_request_changes_empty.svg
illustrations/multi_file_editor_empty.svg
illustrations/productivity-analytics-empty-state.svg
illustrations/project-create-from-template-sm.svg
illustrations/project-create-new-sm.svg
illustrations/project-import-sm.svg
illustrations/project-run-CICD-pipelines-sm.svg
illustrations/search-timeout-md.svg
illustrations/self-managed.svg
illustrations/shield-check.svg
illustrations/success-sm.svg
sprite_icons/settings.svg
sprite_icons/status-active.svg
sprite_icons/status-alert.svg
sprite_icons/status-cancelled.svg
sprite_icons/status-failed.svg
sprite_icons/status-neutral.svg
sprite_icons/status-paused.svg
sprite_icons/status-running.svg
sprite_icons/status-scheduled.svg
sprite_icons/status-stopped.svg
sprite_icons/status-success.svg
sprite_icons/status-waiting.svg
sprite_icons/status_preparing.svg
sprite_icons/status_preparing_borderless.svg
sprite_icons/status_scheduled.svg
sprite_icons/trend-down.svg
sprite_icons/trend-static.svg
sprite_icons/trend-up.svg
Implementation question
Should we lint the svg files to enforce usage of viewBox
? Are there cases in which we don't want them to have a viewBox
?
Original note
The following discussion from !789 (merged) should be addressed:
-
@mrincon started a discussion: (+1 comment) I found other files that do not have viewBox set, to keep things practical, I'll open a separate issue for contributors to tackle.
Edited by Miguel Rincon