Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !17222

Replace PNG with SVG and compress SVGs in custom form controls

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/thekondrashov/patch-1 into v4-dev Aug 22, 2015
  • Overview 0
  • Commits 8
  • Pipelines 0
  • Changes 2

Created by: thekondrashov

Replace PNG with SVG

Preview (scale 500%)
before / before (pixelated) / after Preview Preview Preview

Compress SVGs

Well compressed with SVGO, but I'm sure it is possible to compress more:

  • form-icon-success
  • form-icon-warning
  • form-icon-error
  • input:checked icon

(re)drawn by me (with maximum compression, is impossible to compress better 💪):

  • c-select
  • input:indeterminate icon
  • input:checked icon

What do you think about this hack?

input:checked ~ .c-indicator {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle fill='%23fff' r='3'/%3E%3C/svg%3E");
}

Looks dirty, but still smaller. Read more: https://codepen.io/Tigt/blog/optimizing-svgs-in-data-uris

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/thekondrashov/patch-1