-
-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45abf7d
commit 067a186
Showing
7 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php sect('styling'); ?> | ||
<h1>Styling</h1> | ||
|
||
<section> | ||
|
||
<div class="view"> | ||
<p>noUiSlider, by default, comes with a design with large handles and box shadows. In general, larger handles make range sliders easier to use on mobile devices and touch screens.</p> | ||
|
||
<p>It is recommended to use the default stylesheet, overriding where necessary, as a starting point when re-styling noUiSlider.</p> | ||
|
||
<p>When the slider handles are restyled to be smaller, <code>.noUi-touch-area</code> should be styled to be larger, to be easier to click or touch. The sliders in this example show the larger touch area when hovered.</p> | ||
|
||
<p>See <a href="/nouislider/more/#section-styling">the documentation on styling</a> for further tips and an overview of classes.</p> | ||
|
||
<div class="example"> | ||
<div class="slider-styled" id="slider-round"></div> | ||
<div class="slider-styled" id="slider-square" style="margin-top: 30px"></div> | ||
<?php run('styling'); ?> | ||
</div> | ||
</div> | ||
|
||
<div class="side"> | ||
|
||
<pre><code> | ||
<div class="slider-styled" id="slider-round"></div> | ||
<div class="slider-styled" id="slider-square"></div> | ||
</code></pre> | ||
|
||
<div class="viewer-header">Basic styling</div> | ||
|
||
<div class="viewer-content"> | ||
<?php loadShowCSS('styling'); ?> | ||
</div> | ||
|
||
<div class="viewer-header">Styling the touch area</div> | ||
|
||
<div class="viewer-content"> | ||
<?php loadShowCSS('styling-touch-area'); ?> | ||
</div> | ||
|
||
<div class="viewer-header">Styling round slider</div> | ||
|
||
<div class="viewer-content"> | ||
<?php loadShowCSS('styling-round'); ?> | ||
</div> | ||
|
||
<div class="viewer-header">Styling square slider</div> | ||
|
||
<div class="viewer-content"> | ||
<?php loadShowCSS('styling-square'); ?> | ||
</div> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#slider-round { | ||
height: 10px; | ||
} | ||
|
||
#slider-round .noUi-connect { | ||
background: #c0392b; | ||
} | ||
|
||
#slider-round .noUi-handle { | ||
height: 18px; | ||
width: 18px; | ||
top: -5px; | ||
right: -9px; /* half the width */ | ||
border-radius: 9px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#slider-square { | ||
border-radius: 0; | ||
} | ||
|
||
#slider-square .noUi-handle { | ||
border-radius: 0; | ||
background: #2980b9; | ||
height: 18px; | ||
width: 18px; | ||
top: -1px; | ||
right: -9px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.slider-styled .noUi-handle:hover .noUi-touch-area { | ||
border: 1px solid transparent; | ||
position: absolute; | ||
top: -10px; | ||
left: -10px; | ||
right: -10px; | ||
bottom: -10px; | ||
width: auto; | ||
height: auto; | ||
} | ||
|
||
/* Show a border when hovering the area the handle responds to */ | ||
.slider-styled .noUi-handle:hover .noUi-touch-area { | ||
border: 1px dashed #7f7f7f; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.slider-styled, | ||
.slider-styled .noUi-handle { | ||
box-shadow: none; | ||
} | ||
|
||
/* Hide markers on slider handles */ | ||
.slider-styled .noUi-handle::before, | ||
.slider-styled .noUi-handle::after { | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var roundSlider = document.getElementById('slider-round'); | ||
|
||
noUiSlider.create(roundSlider, { | ||
start: 50, | ||
connect: 'lower', | ||
range: { | ||
'min': 0, | ||
'max': 100 | ||
} | ||
}); | ||
|
||
var squareSlider = document.getElementById('slider-square'); | ||
|
||
noUiSlider.create(squareSlider, { | ||
start: 50, | ||
range: { | ||
'min': 0, | ||
'max': 100 | ||
} | ||
}); |