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

Progress bars: center labels vertically and set height on parent .progress

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/davethegr8/v4-dev into v4-dev May 26, 2017
  • Overview 0
  • Commits 9
  • Pipelines 0
  • Changes 2

Created by: davethegr8

These changes address the suggestions outlined in #22702 (closed)

The changes include:

  • Setting labels to center vertically: There is no visual difference in the base case, but in cases where the height of the bar is not the default, behaves better.

Before:

screen shot 2017-05-26 at 10 58 37

After:

screen shot 2017-05-26 at 10 59 22

  • Moving where custom heights are set from .progress-bar to .progress. Again, there is no change in the base case, but on non-default heights it behaves better (more flexible/ maintainable). This is especially useful when using multiple bars.

Before (you have to set them all to be the same height):

<div class="progress">
  <div class="progress-bar" style="width: 15%; height: 3rem;">1</div>
  <div class="progress-bar bg-success" style="width: 30%; height: 3rem;">2</div>
  <div class="progress-bar bg-info" style="width: 20%; height: 3rem;">3</div>
</div>

After (only one change):

<div class="progress" style="height: 3rem;">
  <div class="progress-bar bg-warning" style="width: 15%;">1</div>
  <div class="progress-bar bg-success" style="width: 30%;">2</div>
  <div class="progress-bar bg-info" style="width: 20%;">3</div>
</div>

You can still change the heights to be different if you want, but it's less work in the base case.

<div class="progress" style="height: 3rem;">
  <div class="progress-bar bg-success" style="width: 30%;">2</div>
  <div class="progress-bar bg-info" style="width: 20%; height: 1rem;">3</div>
</div>

screen shot 2017-05-26 at 11 04 49

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/davethegr8/v4-dev