Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


Save Automatically?

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.


                <div class="rangeslider-wrap">
  <input type="range" min="150" max="210" step="0.1" labels="150, 160, 170, 180, 190, 200, 210">


                $primary: #0099FF;
$secondary: gray;
$roundness: 5px;

$sliderHeight: 4px;
$handleSize: 20px;
$valueWidth: 90px;
$labelMarkerHeight: 12px;

body {
  font-family: Helvetica, sans-serif;

.rangeslider-wrap {
  padding-top: 100px;

.rangeslider {
  position: relative;
  height: $sliderHeight;
  border-radius: $roundness;
  width: 100%;
  background-color: $secondary;
  &__handle {
    transition: background-color .2s;
    box-sizing: border-box;
    width: $handleSize;
    height: $handleSize;
    border-radius: 100%;
    background-color: $primary;
    touch-action: pan-y;
    cursor: pointer;
    display: inline-block;
    position: absolute;
    z-index: 3;
    top: -($handleSize/2) + ($sliderHeight/2);
    box-shadow: 0 1px 3px rgba(black, .5),
                inset 0 0 0 2px white;
    &__value {
      transition: background-color .2s, 
                  box-shadow .1s,
                  transform .1s;
      box-sizing: border-box;
      width: $valueWidth;
      text-align: center;
      padding: 10px;
      background-color: $primary;
      border-radius: $roundness;
      color: white;
      left: -($valueWidth/2 - $handleSize/2);
      top: -55px;
      position: absolute;
      white-space: nowrap;
      border-top: 1px solid darken($primary, 10%);
      box-shadow: 0 -4px 1px rgba(black, .07),
                  0 -5px 20px rgba(black, .3);
      &:before {
        transition: border-top-color .2s;
        position: absolute;
        bottom: -10px;
        left: calc(50% - 10px);
        content: "";
        width: 0; 
        height: 0; 
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid;
        border-top-color: $primary;
      &:after {
        content: " cm";
  &__fill {
    position: absolute;
    top: 0;
    z-index: 1;
    height: 100%;
    background-color: $primary;
    border-radius: $roundness;
  &__labels {
    position: absolute;
    width: 100%;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    &__label {
      font-size: 0.75em;
      position: relative;
      padding-top: 15px;
      color: $secondary;
      &:before {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        content: "";
        width: 1px;
        height: $labelMarkerHeight - 3px;
        border-radius: 1px;
        background-color: rgba($secondary, .5);
        height: $labelMarkerHeight;
        width: 2px;
      &:first-child:before { background-color: $primary }
      &:last-child:before { background-color: $secondary }
      &:first-child { transform: translateX(-48%) }
      &:last-child { transform: translateX(48%) }
  // active state
  &.rangeslider--active {
    .rangeslider__handle {
      &, *      { background-color: lighten($primary, 10%) }
      *:before  { border-top-color: lighten($primary, 10%) }
    .rangeslider__handle__value { 
      transform: translateY(-5px);
      box-shadow: 0 -3px 2px rgba(black, .04),
                  0 -9px 25px rgba(black, .15);


  // Feature detection the default is `true`.
    // Set this to `false` if you want to use
    // the polyfill also in Browsers which support
    // the native <input type="range"> element.
    polyfill: false,

    // Default CSS classes
    rangeClass: 'rangeslider',
    disabledClass: 'rangeslider--disabled',
    horizontalClass: 'rangeslider--horizontal',
    fillClass: 'rangeslider__fill',
    handleClass: 'rangeslider__handle',

    // Callback function
    onInit: function() {
      $rangeEl = this.$range;
      // add value label to handle
      var $handle = $rangeEl.find('.rangeslider__handle');
      var handleValue = '<div class="rangeslider__handle__value">' + this.value + '</div>';
      // get range index labels 
      var rangeLabels = this.$element.attr('labels');
      rangeLabels = rangeLabels.split(', ');
      // add labels
      $rangeEl.append('<div class="rangeslider__labels"></div>');
      $(rangeLabels).each(function(index, value) {
        $rangeEl.find('.rangeslider__labels').append('<span class="rangeslider__labels__label">' + value + '</span>');

    // Callback function
    onSlide: function(position, value) {
      var $handle = this.$range.find('.rangeslider__handle__value');

    // Callback function
    onSlideEnd: function(position, value) {}