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
  • !37672

WIP: Add loading dots spinner

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Mark Otto requested to merge v6-spinner-dots into main Dec 20, 2022
  • Overview 6
  • Commits 2
  • Pipelines 0
  • Changes 3

Got inspired looking at some dots and figured I'd try out using an SVG as a spinner element. This felt easier than animating a single element with pseudo-elements (because of some issues animating colors with CSS variables vs opacity) and just seemed like a fun thing to try.

I wanted to get this to work with a <symbol>, but ran into issues where the animation never started for shadow content.

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  <symbol id="spinner-dots" class="spinner-dots">
    <title>Loading...</title><circle cx="4" cy="8" r="4"/><circle cx="16" cy="8" r="4"/><circle cx="28" cy="8" r="4"/>
  </symbol>
</svg>
<svg class="text-{{ .name }}" width="32" height="16" role="status"><use xlink:href="#spinner-dots"/></svg>

Alas, repeating the SVG manually worked fine. This approach keeps the CSS ridiculously small, but I'd like to keep the HTML small, too, with support for that symbol element. Will come back to this at another time.

Also, we should probably rename spinners to loaders or something hah.

Live preview

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: v6-spinner-dots