@include foundation-everything;
@include foundation-range-input;
+@include foundation-progress-element;
+@include foundation-meter-element;
@include motion-ui-transitions;
@import 'foundation-docs';
A progress bar can be styled with the `.success`, `.warning`, and `.alert` colors.
```html_example
-<div class="success progress" role="progressbar" tabindex="0" aria-valuenow="25" aria-valuemin="0" aria-valuetext="25 percent" aria-valuemax="100">
+<div class="secondary progress" role="progressbar" tabindex="0" aria-valuenow="25" aria-valuemin="0" aria-valuetext="25 percent" aria-valuemax="100">
<div class="progress-meter" style="width: 25%"></div>
</div>
+<div class="success progress">
+ <div class="progress-meter" style="width: 50%"></div>
+</div>
+
<div class="warning progress">
<div class="progress-meter" style="width: 50%"></div>
</div>
</span>
</div>
```
+
+---
+
+## Native Progress
+
+As an alternative to our custom progress bar style, you can also opt to use the native `<progress>` element. It provides a more succinct way to create progress bars, but it's not supported in IE9, and some other older browsers. [View `<progress>` element support.](http://caniuse.com/#feat=progress)
+
+```html_example
+<progress max="100" value="75"></progress>
+```
+
+If you're using the Sass version of Foundation, add this line to your main Sass file to export the `<progress>` CSS:
+
+```scss
+@import foundation-progress-element;
+```
+
+The `<progress>` element can be styled with the same coloring classes: `.secondary`, `.success`, `.warning`, and `.alert`.
+
+```html_example
+<progress class="secondary" max="100" value="75"></progress>
+<progress class="success" max="100" value="75"></progress>
+<progress class="warning" max="100" value="75"></progress>
+<progress class="alert" max="100" value="75"></progress>
+```
+
+---
+
+## Native Meter
+
+For the *extra* adventurous developers out there, we also provide styles for the `<meter>` element. What's the difference? `<progress>` represents a value that changes over time, like storage capacity. `<meter>` represents a value that fluctates around some optimum value. It also has *no* support in Internet Explorer, Mobile Safari, or Android 2. [View `<meter>` element support.](http://caniuse.com/#search=meter)
+
+If you're using the Sass version of Foundation, add this line to your main Sass file to export the `<meter>` CSS:
+
+```scss
+@import foundation-progress-element;
+```
+
+The meter automatically colors itself based on the current values, and the defined low, medium, and high ranges. [Learn more about the mechanics of `<meter>` values.](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/The_native_form_widgets#Meters_and_progress_bars)
+
+```html_example
+<meter value="30" min="0" low="33" medium="66" optimum="100" max="100"></meter>
+<meter value="50" min="0" low="33" medium="66" optimum="100" max="100"></meter>
+<meter value="100" min="0" low="33" medium="66" optimum="100" max="100"></meter>
+```
// foundation.zurb.com
// Licensed under MIT Open Source
-////
-/// @group progress-bar
-////
-
-/// Height of a progress bar.
-/// @type Number
-$progress-height: 1rem !default;
-
-/// Background color of a progress bar.
-/// @type Color
-$progress-background: $medium-gray !default;
-
-/// Bottom margin of a progress bar.
-/// @type Number
-$progress-margin-bottom: $global-margin !default;
-
-/// Default color of a progress bar's meter.
-/// @type Color
-$progress-meter-background: $primary-color !default;
-
-/// Default radius of a progress bar.
-/// @type Number
-$progress-radius: $global-radius !default;
-
/// Adds styles for a progress bar container.
@mixin progress-container {
background-color: $progress-background;
'fieldset',
'select',
'range',
+ 'progress',
+ 'meter',
'error';
@mixin foundation-forms {
--- /dev/null
+$meter-height: $progress-height !default;
+$meter-radius: $progress-radius !default;
+$meter-background: $progress-background !default;
+$meter-fill-good: $success-color !default;
+$meter-fill-medium: $warning-color !default;
+$meter-fill-bad: $alert-color !default;
+
+@mixin foundation-meter-element {
+ meter {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ display: block;
+ width: 100%;
+ height: $meter-height;
+ margin-bottom: 1rem;
+
+ @if has-value($meter-radius) {
+ border-radius: $meter-radius;
+ }
+
+ // For Firefox
+ background: $meter-background;
+ border: 0;
+
+ // Chrome/Safari
+ &::-webkit-meter-bar {
+ background: $meter-background;
+
+ @if has-value($meter-radius) {
+ border-radius: $meter-radius;
+ }
+ }
+
+ &::-webkit-meter-inner-element {
+ @if has-value($meter-radius) {
+ border-radius: $meter-radius;
+ }
+ }
+
+ &::-webkit-meter-optimum-value {
+ background: $meter-fill-good;
+
+ @if has-value($meter-radius) {
+ border-radius: $meter-radius;
+ }
+ }
+
+ &::-webkit-meter-suboptimum-value {
+ background: $meter-fill-medium;
+
+ @if has-value($meter-radius) {
+ border-radius: $meter-radius;
+ }
+ }
+
+ &::-webkit-meter-even-less-good-value {
+ background: $meter-fill-bad;
+
+ @if has-value($meter-radius) {
+ border-radius: $meter-radius;
+ }
+ }
+
+ // Firefox
+ background: $meter-background;
+
+ &::-moz-meter-bar {
+ background: $primary-color;
+
+ @if has-value($meter-radius) {
+ border-radius: $meter-radius;
+ }
+ }
+
+ &:-moz-meter-optimum::-moz-meter-bar {
+ background: $meter-fill-good;
+ }
+
+ &:-moz-meter-sub-optimum::-moz-meter-bar {
+ background: $meter-fill-medium;
+ }
+
+ &:-moz-meter-sub-sub-optimum::-moz-meter-bar {
+ background: $meter-fill-bad;
+ }
+ }
+}
--- /dev/null
+// Foundation for Sites by ZURB
+// foundation.zurb.com
+// Licensed under MIT Open Source
+
+////
+/// @group progress-bar
+////
+
+/// Height of a progress bar.
+/// @type Number
+$progress-height: 1rem !default;
+
+/// Background color of a progress bar.
+/// @type Color
+$progress-background: $medium-gray !default;
+
+/// Bottom margin of a progress bar.
+/// @type Number
+$progress-margin-bottom: $global-margin !default;
+
+/// Default color of a progress bar's meter.
+/// @type Color
+$progress-meter-background: $primary-color !default;
+
+/// Default radius of a progress bar.
+/// @type Number
+$progress-radius: $global-radius !default;
+
+@mixin foundation-progress-element {
+ progress {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ display: block;
+ width: 100%;
+ height: $progress-height;
+ margin-bottom: $progress-margin-bottom;
+
+ @if hasvalue($progress-radius) {
+ border-radius: $progress-radius;
+ }
+
+ // For Firefox
+ background: $progress-background;
+ border: 0;
+
+ &::-webkit-progress-bar {
+ background: $progress-background;
+
+ @if hasvalue($progress-radius) {
+ border-radius: $progress-radius;
+ }
+ }
+
+ &::-webkit-progress-value {
+ background: $progress-meter-background;
+
+ @if hasvalue($progress-radius) {
+ border-radius: $progress-radius;
+ }
+ }
+
+ &::-moz-progress-bar {
+ background: $progress-meter-background;
+
+ @if hasvalue($progress-radius) {
+ border-radius: $progress-radius;
+ }
+ }
+
+ @each $name, $color in $foundation-palette {
+ &.#{$name} {
+ &::-webkit-progress-value {
+ background: $color;
+ }
+
+ &::-moz-progress-bar {
+ background: $color;
+ }
+ }
+ }
+ }
+}
border-radius: $slider-radius;
}
}
+
// Firefox
&::-moz-range-track {
-moz-appearance: none;
height: $slider-height;
background: #ccc;
}
+
&::-moz-range-thumb {
-moz-appearance: none;
background: $slider-thumb-color;