-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slider #2 #329
base: master
Are you sure you want to change the base?
Slider #2 #329
Changes from all commits
0ef35fc
ed11203
ffeee27
e02ee89
c47b9a5
859a765
7aaa249
c4109e4
a6fb622
1aac9fc
bdae232
0e52aef
8b64392
a0e4051
e9e6a76
49cb546
2bfa649
e214e0a
5de2d5a
1d966cd
9853064
8740721
5d36dbf
b55c632
24d14fe
bc4e61d
6d9904b
e13d34a
bbae8e9
e64f990
9fcc157
0e5abcb
a786774
52d583f
e35334b
bad3cf8
c5f4c58
4ed2140
82bb780
f8fa77b
78e26f6
b695bb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,80 @@ | ||||||||||||||||
.slider { | ||||||||||||||||
padding: @padding-large; | ||||||||||||||||
padding-top: @padding-large * 2; | ||||||||||||||||
|
||||||||||||||||
.bar { | ||||||||||||||||
height: @slider-bar-thickness; | ||||||||||||||||
position: relative; | ||||||||||||||||
|
||||||||||||||||
.background { | ||||||||||||||||
position: absolute; | ||||||||||||||||
top: 0; | ||||||||||||||||
height: 100%; | ||||||||||||||||
background-color: @slider-bar-background; | ||||||||||||||||
|
||||||||||||||||
&:last-of-type { | ||||||||||||||||
right: 0; | ||||||||||||||||
width: 100%; | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
.range { | ||||||||||||||||
position: absolute; | ||||||||||||||||
top: 0; | ||||||||||||||||
height: 100%; | ||||||||||||||||
background-color: @slider-range-color; | ||||||||||||||||
z-index: @slider-z-index - 1; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
.control { | ||||||||||||||||
position: relative; | ||||||||||||||||
width: @slider-control-width; | ||||||||||||||||
height: @slider-control-height; | ||||||||||||||||
top: 50%; | ||||||||||||||||
left: 0; | ||||||||||||||||
float: left; | ||||||||||||||||
transform: translate(-100%, -50%); | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
background-color: @slider-control-background; | ||||||||||||||||
cursor: ew-resize; | ||||||||||||||||
border-radius: @slider-control-border-radius; | ||||||||||||||||
z-index: @slider-z-index; | ||||||||||||||||
|
||||||||||||||||
.control-popover { | ||||||||||||||||
position: absolute; | ||||||||||||||||
display: inline-table; | ||||||||||||||||
top: -1.4em; | ||||||||||||||||
width: 2.5em; | ||||||||||||||||
height: 2em; | ||||||||||||||||
transform: translate(-30%, -50%); | ||||||||||||||||
Comment on lines
+45
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
text-align: center; | ||||||||||||||||
background-color: @slider-control-popover-background; | ||||||||||||||||
font-size: 11px; | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
border-radius: @border-radius-base; | ||||||||||||||||
|
||||||||||||||||
span { | ||||||||||||||||
display: table-row; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
&::before { | ||||||||||||||||
content: ''; | ||||||||||||||||
position: absolute; | ||||||||||||||||
width: 0; | ||||||||||||||||
height: 0; | ||||||||||||||||
left: 0; | ||||||||||||||||
right: 0; | ||||||||||||||||
margin-left: auto; | ||||||||||||||||
margin-right: auto; | ||||||||||||||||
bottom: -4px; | ||||||||||||||||
border-left: 10px solid transparent; // lesshint variableValue: false | ||||||||||||||||
border-right: 10px solid transparent; // lesshint variableValue: false | ||||||||||||||||
border-top: 10px solid @slider-control-popover-background; // lesshint variableValue: false | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
.range, | ||||||||||||||||
.control { | ||||||||||||||||
transition: all 0.2s ease-out; | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#### Examples | ||
|
||
With initial values set and popover displayed: | ||
|
||
```js | ||
<Slider | ||
displayPopover | ||
onSlide={value => console.log(value)} | ||
initialValue={{ from: 0, to: 700 }} | ||
min={0} | ||
max={1000} | ||
step={10} | ||
/> | ||
``` | ||
|
||
Without initial values and without popover displayed: | ||
|
||
```js | ||
<Slider onSlide={value => console.log(value)} min={-100} max={100} step={1} /> | ||
``` | ||
|
||
#### Less variables | ||
|
||
```less | ||
@slider-bar-background: lighten(@grey-lighter, 8%); | ||
@slider-bar-thickness: 5px; | ||
@slider-z-index: 2; | ||
@slider-range-color: @info; | ||
JakeSidSmith marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@slider-control-width: 15px; | ||
@slider-control-height: 15px; | ||
@slider-control-background: @info; | ||
@slider-control-border-radius: 20px; | ||
@slider-control-popover-background: lighten(@info, 25%); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there more than one background?