Ghost theme (MIT license)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
5.6 KiB

10 years ago
// Foundation by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
10 years ago
@import 'global';
10 years ago
//
// @name _range-slider.scss
// @dependencies _global.scss
//
//
// @variables
//
$include-html-range-slider-classes: $include-html-classes !default;
// These variabels define the slider bar styles
$range-slider-bar-width: 100% !default;
$range-slider-bar-height: rem-calc(16) !default;
$range-slider-bar-border-width: 1px !default;
$range-slider-bar-border-style: solid !default;
$range-slider-bar-border-color: $gainsboro !default;
$range-slider-radius: $global-radius !default;
$range-slider-round: $global-rounded !default;
$range-slider-bar-bg-color: $ghost !default;
$range-slider-active-segment-bg-color: scale-color($secondary-color, $lightness: -1%) !default;
// Vertical bar styles
$range-slider-vertical-bar-width: rem-calc(16) !default;
$range-slider-vertical-bar-height: rem-calc(200) !default;
// These variabels define the slider handle styles
$range-slider-handle-width: rem-calc(32) !default;
$range-slider-handle-height: rem-calc(22) !default;
$range-slider-handle-position-top: rem-calc(-5) !default;
$range-slider-handle-bg-color: $primary-color !default;
$range-slider-handle-border-width: 1px !default;
$range-slider-handle-border-style: solid !default;
$range-slider-handle-border-color: none !default;
$range-slider-handle-radius: $global-radius !default;
$range-slider-handle-round: $global-rounded !default;
$range-slider-handle-bg-hover-color: scale-color($primary-color, $lightness: -12%) !default;
$range-slider-handle-cursor: pointer !default;
10 years ago
$range-slider-disabled-opacity: .7 !default;
10 years ago
$range-slider-disabled-cursor: $cursor-disabled-value !default;
10 years ago
//
// @mixins
//
@mixin range-slider-bar-base($vertical: false) {
border: $range-slider-bar-border-width $range-slider-bar-border-style $range-slider-bar-border-color;
margin: rem-calc(20 0);
10 years ago
position: relative;
10 years ago
-ms-touch-action: none;
touch-action: none;
@if $vertical == true {
display: inline-block;
height: $range-slider-vertical-bar-height;
10 years ago
width: $range-slider-vertical-bar-width;
10 years ago
} @else {
display: block;
height: $range-slider-bar-height;
10 years ago
width: $range-slider-bar-width;
10 years ago
}
}
@mixin range-slider-bar-style(
$bg: true,
$radius: false,
$round: false,
$disabled: false) {
@if $bg == true { background: $range-slider-bar-bg-color; }
@if $radius == true { @include radius($range-slider-radius); }
@if $round == true { @include radius($range-slider-round); }
@if $disabled == true {
10 years ago
cursor: $range-slider-disabled-cursor;
10 years ago
opacity: $range-slider-disabled-opacity;
}
}
@mixin range-slider-bar(
$bg: $range-slider-bar-bg-color,
$radius:false) {
@include range-slider-bar-base;
@include range-slider-bar-style;
}
@mixin range-slider-handle-base() {
10 years ago
border: $range-slider-handle-border-width $range-slider-handle-border-style $range-slider-handle-border-color;
cursor: $range-slider-handle-cursor;
10 years ago
display: inline-block;
10 years ago
height: $range-slider-handle-height;
10 years ago
position: absolute;
top: $range-slider-handle-position-top;
width: $range-slider-handle-width;
10 years ago
z-index: 1;
10 years ago
// This removes the 300ms touch delay on Windows 8
-ms-touch-action: manipulation;
10 years ago
touch-action: manipulation;
10 years ago
}
10 years ago
10 years ago
@mixin range-slider-handle-style(
$bg: true,
$radius: false,
$round: false,
$disabled: false) {
@if $bg == true { background: $range-slider-handle-bg-color; }
@if $radius == true { @include radius($range-slider-radius); }
@if $round == true { @include radius($range-slider-round); }
@if $disabled == true {
cursor: $cursor-default-value;
opacity: $range-slider-disabled-opacity;
}
&:hover {
background: $range-slider-handle-bg-hover-color;
}
}
10 years ago
10 years ago
@mixin range-slider-handle() {
@include range-slider-handle-base;
@include range-slider-handle-style;
}
// CSS Generation
@include exports("range-slider-bar") {
@if $include-html-range-slider-classes {
.range-slider {
@include range-slider-bar-base;
@include range-slider-bar-style($bg:true, $radius:false);
&.vertical-range {
@include range-slider-bar-base($vertical: true);
.range-slider-handle {
10 years ago
bottom: -($range-slider-vertical-bar-height - $range-slider-handle-width);
10 years ago
margin-#{$default-float}: -($range-slider-handle-width / 4);
10 years ago
margin-top: 0;
10 years ago
position: absolute;
}
.range-slider-active-segment {
10 years ago
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
border-top-left-radius: initial;
10 years ago
bottom: 0;
10 years ago
height: auto;
width: $range-slider-bar-height - rem-calc((strip-unit($range-slider-bar-border-width) * 2));
10 years ago
}
}
&.radius {
@include range-slider-bar-style($radius:true);
.range-slider-handle { @include range-slider-handle-style($radius: true); }
}
&.round {
@include range-slider-bar-style($round:true);
.range-slider-handle { @include range-slider-handle-style($round: true); }
}
&.disabled, &[disabled] {
@include range-slider-bar-style($disabled:true);
.range-slider-handle { @include range-slider-handle-style($disabled: true); }
}
}
.range-slider-active-segment {
10 years ago
background: $range-slider-active-segment-bg-color;
border-bottom-left-radius: inherit;
border-top-left-radius: inherit;
10 years ago
display: inline-block;
height: $range-slider-bar-height - rem-calc((strip-unit($range-slider-bar-border-width) * 2));
10 years ago
position: absolute;
10 years ago
}
.range-slider-handle {
@include range-slider-handle-base;
@include range-slider-handle-style($bg:true, $radius: false);
}
}
}