Gitlab CSE Unil

bootstrap-slider.scss 2.64 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*!
 * Slider for Bootstrap
 *
 * Copyright 2012 Stefan Petre
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * using the fork at https://github.com/seiyria/bootstrap-slider
 */
//$import '../bower_components/bootstrap/less/variables.less';
$line-height-base: 20px;
$border-radius-base: 4px;
$import '../lib/bootstrap/less/mixins.less'; // BootStrap mixins


.slider {
	display: inline-block;
	vertical-align: middle;
	position: relative;
	&.slider-horizontal {
		width: 210px;
		height: $line-height-base;
		.slider-track {
			height: $line-height-base/2;
			width: 100%;
			margin-top: -$line-height-base/4;
			top: 50%;
			left: 0;
		}
		.slider-selection {
			height: 100%;
			top: 0;
			bottom: 0;
		}
		.slider-handle {
			margin-left: -$line-height-base/2;
			margin-top: -$line-height-base/4;
			&.triangle {
    			border-width: 0 $line-height-base/2 $line-height-base/2 $line-height-base/2;
				width: 0;
				height: 0;
				border-bottom-color: #0480be;
				margin-top: 0;
			}
		}
	}
	&.slider-vertical {
		height: 80px;
		width: $line-height-base;
		.slider-track {
			width: $line-height-base/2;
			height: 100%;
			margin-left: -$line-height-base/4;
			left: 50%;
			top: 0;
		}
		.slider-selection {
			width: 100%;
			left: 0;
			top: 0;
			bottom: 0;
		}
		.slider-handle {
			margin-left: -$line-height-base/4;
			margin-top: -$line-height-base/2;
			&.triangle {
				border-width: $line-height-base/2 0 $line-height-base/2 $line-height-base/2;
				width: 1px;
				height: 1px;
				border-left-color: #0480be;
				margin-left: 0;
			}
		}
	}
	&.slider-disabled {
		.slider-handle {
			#gradient > @include vertical(#dfdfdf, #bebebe);
            cursor: not-allowed;
		}
		.slider-track {
			#gradient > @include vertical(#e5e5e5, #e9e9e9);
            cursor: not-allowed;
		}
	}
	input {
		display: none;
	}
	.tooltip-inner {
		white-space: nowrap;
	}
}
.slider-track {
	position: absolute;
	cursor: pointer;
	#gradient > @include vertical(#f5f5f5, #f9f9f9);
	@include box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
	border-radius: $border-radius-base;
}
.slider-selection {
	position: absolute;
	#gradient > @include vertical(#f9f9f9, #f5f5f5);
	@include box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));
	@include box-sizing(border-box);
	border-radius: $border-radius-base;
}
.slider-handle {
	position: absolute;
	width: $line-height-base;
	height: $line-height-base;
	#gradient > @include vertical(#149bdf, #0480be);
	@mixin box-shadow(~"inset 0 1px 0 rgba(255,255,255,@mixin 2), 0 1px 2px rgba(0,0,0,.05)");
	opacity: 0.8;
	border: 0px solid transparent;
	&.round {
		border-radius: 50%;
	}
	&.triangle {
		background: transparent none;
	}
}