_progress-bars.scss 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // Foundation by ZURB
  2. // foundation.zurb.com
  3. // Licensed under MIT Open Source
  4. @import 'global';
  5. //
  6. // @variables
  7. //
  8. $include-html-media-classes: $include-html-classes !default;
  9. // We use this to set the progress bar height
  10. $progress-bar-height: rem-calc(25) !default;
  11. $progress-bar-color: $vapor !default;
  12. // We use these to control the border styles
  13. $progress-bar-border-color: scale-color($white, $lightness: 20%) !default;
  14. $progress-bar-border-size: 1px !default;
  15. $progress-bar-border-style: solid !default;
  16. $progress-bar-border-radius: $global-radius !default;
  17. // We use these to control the margin & padding
  18. $progress-bar-pad: rem-calc(2) !default;
  19. $progress-bar-margin-bottom: rem-calc(10) !default;
  20. // We use these to set the meter colors
  21. $progress-meter-color: $primary-color !default;
  22. $progress-meter-secondary-color: $secondary-color !default;
  23. $progress-meter-success-color: $success-color !default;
  24. $progress-meter-alert-color: $alert-color !default;
  25. // @mixins
  26. //
  27. // We use this to set up the progress bar container
  28. @mixin progress-container {
  29. background-color: $progress-bar-color;
  30. border: $progress-bar-border-size $progress-bar-border-style $progress-bar-border-color;
  31. height: $progress-bar-height;
  32. margin-bottom: $progress-bar-margin-bottom;
  33. padding: $progress-bar-pad;
  34. }
  35. // @mixins
  36. //
  37. // $bg - Default: $progress-meter-color || $primary-color
  38. @mixin progress-meter($bg:$progress-meter-color) {
  39. background: $bg;
  40. display: block;
  41. height: 100%;
  42. float: left;
  43. width: 0%;
  44. }
  45. @include exports("progress-bar") {
  46. @if $include-html-media-classes {
  47. /* Progress Bar */
  48. .progress {
  49. @include progress-container;
  50. // Meter
  51. .meter {
  52. @include progress-meter;
  53. &.secondary { @include progress-meter($bg:$progress-meter-secondary-color); }
  54. &.success { @include progress-meter($bg:$progress-meter-success-color); }
  55. &.alert { @include progress-meter($bg:$progress-meter-alert-color); }
  56. }
  57. &.secondary .meter { @include progress-meter($bg:$progress-meter-secondary-color); }
  58. &.success .meter { @include progress-meter($bg:$progress-meter-success-color); }
  59. &.alert .meter { @include progress-meter($bg:$progress-meter-alert-color); }
  60. &.radius { @include radius($progress-bar-border-radius);
  61. .meter { @include radius($progress-bar-border-radius - 1); }
  62. }
  63. &.round { @include radius(1000px);
  64. .meter { @include radius(999px); }
  65. }
  66. }
  67. }
  68. }