Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <form oninput="changeVar(rangeField.value,rangeField.min, rangeField.max)">
  <label class="sliderBar">Custom slider con datalist
  <input id="rangeField" type="range" min="-5" max="5" value="0" step="1" list="mydata">
<!-- <output id="output" value="0">0</output> -->
<datalist id="mydata">
    <option value="-5"></option>
    <option value="-4"></option>
    <option value="-3"></option>
    <option value="-2"></option>
    <option value="-1"></option>
    <option value="0"></option>
    <option value="1"></option>
    <option value="2"></option>
    <option value="3"></option>
    <option value="4"></option>
    <option value="5"></option>


                $spacing: 12px;
$module: 48px;
:root {
  --progressW: 50%;
* {
  box-sizing: border-box;
.sliderBar {
  display: block;
  width: 100%;
  position: relative;
  padding: 0 $spacing;
@mixin track() {
  height: 2px;
  padding: 0;
  cursor: pointer;
  background: #ccc;
@mixin thumb() { 
  box-sizing: border-box;/*FF*/
  -webkit-appearance: none;
  width: $module/2;
  height: $module/2;
  margin-top: -$spacing;
  border: $spacing/2 solid #eee;
  border-radius: 50%;
  background: #999;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5)
@mixin active() {
  width: $module*0.75;
  height: $module*0.75;
  margin-top: -$spacing*1.5;
  background: #99F;
@mixin progress() {
  background: #99F;
  height: 2px;

[type=range] {
  -webkit-appearance: none;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  &::-webkit-slider-runnable-track { @include track }
  &::-moz-range-track { @include track }
  &::-ms-track { @include track }

  &::-webkit-slider-thumb { @include thumb }
  &::-moz-range-thumb { @include thumb }
  &::-ms-thumb { @include thumb }

  &:active::-webkit-slider-thumb { @include active }
  &:active::-moz-range-thumb { @include active }
  &:active::-ms-thumb { @include active }
  &::-moz-range-progress { @include progress }
  &::-ms-fill-upper { @include progress }
[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #99F 0%, #99F var(--progressW), #ccc var(--progressW), #ccc 100%);
input[type=range] ~ datalist {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: $spacing;
  width: calc(100% - #{$spacing}*2);
  margin: $spacing*3 0;
  padding: 0;
input[type=range] ~ datalist option {
    display: block;
    width: $module/2;
    background: 0 0;
    padding: 0;
    text-align: center;
input[type=range] ~ datalist option:after{
  content: attr(value); 


                function changeVar(value, min, max){
  var range = max - min;
  var progressW = (value-min)/range*100 +'%';
  $('#rangeField').css('--progressW', progressW);
  //console.log(progressW + '' +((value-min)*100/range)+'%');