Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 9 commits into from
Aug 11, 2017
10 changes: 5 additions & 5 deletions docs/4.0/components/progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ Add labels to your progress bars by placing text within the `.progress-bar`.

## Height

We only set a `height` value on the `.progress-bar`, so if you change that value the outer `.progress` will automatically resize accordingly.
We only set a `height` value on the `.progress`, so if you change that value the inner `.progress-bar` will automatically resize accordingly.

{% example html %}
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 25%; height: 1px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress" style="height: 1px;">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 25%; height: 20px;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
<div class="progress" style="height: 20px;">
<div class="progress-bar" role="progressbar" style="width: 25%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
{% endexample %}

Expand Down
10 changes: 4 additions & 6 deletions scss/_progress.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@

.progress {
display: flex;
height: $progress-height;
overflow: hidden; // force rounded corners by cropping it
font-size: $progress-font-size;
line-height: $progress-height;
text-align: center;
background-color: $progress-bg;
@include border-radius($progress-border-radius);
@include box-shadow($progress-box-shadow);
}

.progress-bar {
height: $progress-height;
line-height: $progress-height;
display: flex;
align-items: center;
justify-content: center;
color: $progress-bar-color;
background-color: $progress-bar-bg;
@include transition($progress-bar-transition);
Copy link
Contributor

@tmorehouse tmorehouse Nov 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davethegr8 @mdo
Any particular reason why the transition was removed from progress in this PR?

I see that $progress-bar-transition still exists in _variables.scss.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so, probably an oversight on my part.

}

.progress-bar-striped {
Expand Down