Files
ionic-framework/src/components/range/range.wp.scss
2016-12-05 10:16:40 -05:00

214 lines
5.3 KiB
SCSS

@import "../../themes/ionic.globals.wp";
// Windows Range
// --------------------------------------------------
/// @prop - Padding top/bottom of the range
$range-wp-padding-vertical: 8px !default;
/// @prop - Padding left/right of the range
$range-wp-padding-horizontal: 8px !default;
/// @prop - Height of the range slider
$range-wp-slider-height: 42px !default;
/// @prop - Width of the area that will select the range knob
$range-wp-hit-width: 42px !default;
/// @prop - Height of the area that will select the range knob
$range-wp-hit-height: $range-wp-slider-height !default;
/// @prop - Height of the range bar
$range-wp-bar-height: 2px !default;
/// @prop - Background of the range bar
$range-wp-bar-background-color: #bdbdbd !default;
/// @prop - Background of the active range bar
$range-wp-bar-active-background-color: color($colors-wp, primary) !default;
/// @prop - Width of the range knob
$range-wp-knob-width: 8px !default;
/// @prop - Height of the range knob
$range-wp-knob-height: $range-wp-knob-width * 3 !default;
/// @prop - Background of the range knob
$range-wp-knob-background-color: $range-wp-bar-active-background-color !default;
/// @prop - Border radius of the range knob
$range-wp-knob-border-radius: $range-wp-knob-width / 2 !default;
/// @prop - Width of the range tick
$range-wp-tick-width: $range-wp-bar-height !default;
/// @prop - Height of the range tick
$range-wp-tick-height: $range-wp-tick-width * 3 !default;
/// @prop - Border radius of the range tick
$range-wp-tick-border-radius: $range-wp-knob-width / 2 !default;
/// @prop - Background of the range tick
$range-wp-tick-background-color: $range-wp-bar-background-color !default;
/// @prop - Background of the active range tick
$range-wp-tick-active-background-color: $range-wp-bar-active-background-color !default;
/// @prop - Background of the range pin
$range-wp-pin-background-color: $range-wp-bar-active-background-color !default;
/// @prop - Color of the range pin
$range-wp-pin-color: color-contrast($colors-wp, $range-wp-bar-active-background-color) !default;
/// @prop - Font size of the range pin
$range-wp-pin-font-size: 12px !default;
/// @prop - Padding of the range pin
$range-wp-pin-padding: 8px !default;
.range-wp {
padding: $range-wp-padding-vertical $range-wp-padding-horizontal;
}
.range-wp [range-left] {
margin: 0 12px 0 0;
}
.range-wp [range-right] {
margin: 0 0 0 12px;
}
.range-wp.range-has-pin {
padding-top: $range-wp-padding-vertical + $range-wp-pin-font-size + $range-wp-pin-padding;
}
.range-wp .range-slider {
height: $range-wp-slider-height;
}
.range-wp .range-bar {
position: absolute;
top: ($range-wp-slider-height / 2);
left: 0;
width: 100%;
height: $range-wp-bar-height;
background: $range-wp-bar-background-color;
pointer-events: none;
}
.range-wp.range-pressed .range-bar-active {
will-change: left, right;
}
.range-wp.range-pressed .range-knob-handle {
will-change: left;
}
.range-wp .range-bar-active {
bottom: 0;
width: auto;
background: $range-wp-bar-active-background-color;
}
.range-wp .range-knob-handle {
position: absolute;
top: ($range-wp-slider-height / 2);
left: 0%;
margin-top: -($range-wp-hit-height / 2);
margin-left: -($range-wp-hit-width / 2);
width: $range-wp-hit-width;
height: $range-wp-hit-height;
text-align: center;
}
.range-wp .range-knob {
position: absolute;
top: ($range-wp-hit-height / 2) - ($range-wp-knob-height / 2) + ($range-wp-bar-height / 2);
left: ($range-wp-hit-width / 2) - ($range-wp-knob-width / 2);
width: $range-wp-knob-width;
height: $range-wp-knob-height;
border-radius: $range-wp-knob-border-radius;
background: $range-wp-knob-background-color;
pointer-events: none;
}
.range-wp .range-tick {
position: absolute;
top: ($range-wp-hit-height / 2) - ($range-wp-tick-height / 2) + ($range-wp-bar-height / 2);
margin-left: ($range-wp-tick-width / 2) * -1;
width: $range-wp-tick-width;
height: $range-wp-tick-height;
border-radius: $range-wp-tick-border-radius;
background: $range-wp-tick-background-color;
pointer-events: none;
}
.range-wp .range-tick-active {
background: $range-wp-tick-active-background-color;
}
.range-wp .range-pin {
position: relative;
top: -24px;
display: inline-block;
padding: $range-wp-pin-padding;
min-width: 28px;
border-radius: 50px;
font-size: $range-wp-pin-font-size;
text-align: center;
color: $range-wp-pin-color;
background: $range-wp-pin-background-color;
transform: translate3d(0, 28px, 0) scale(.01);
transition: transform 120ms ease;
}
.range-wp .range-knob-pressed .range-pin {
transform: translate3d(0, 0, 0) scale(1);
}
.range-wp.range-disabled {
opacity: .5;
}
// Generate Windows Range Colors
// --------------------------------------------------
@each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
.range-wp-#{$color-name} {
.range-bar-active,
.range-tick-active,
.range-knob,
.range-pin {
background: $color-base;
}
}
}