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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              mixin range(controller, type)
          .range-track-bar.progress-bar.progress-bar-striped.active(class='progress-bar-' + type ms-css-width='value + "%"')
        input.range-control(type='range' min='0' max='100' ms-duplex='value' ms-on-change='setValue')
          input.form-control.input-lg.text-center(type='number' min='0' max='100' ms-duplex-number='value')

    h1.text-center Bootstrap Ranges
      | Based on 
      a(href='https://getbootstrap.com/' target='_blank') Bootstrap
      |  & 
      a(href='https://github.com/RubyLouvre/avalon/' target='_blank') AvalonJS
      | . Another  
      a(href='https://codepen.io/Cweili/pen/bNWyLw' target='_blank') Tip on Top edition
      | .
  each type in ['primary', 'success', 'danger', 'warning', 'info']
    +range('range-' + type, type)

              @import "nib"

$range-size = 16px

  background: none
  border: 0

  appearance: none
  width: $range-size * 2
  height: @width
  border-width: 0
  border-radius: 50%
  background: #f0f0f2 linear-gradient(#f0f0f2, #c2c3cb)
  box-shadow: rgba(#000, .5) 0 ($range-size / 4) ($range-size / 2)

  position: relative
  margin-bottom: ($range-size / 2)
    margin: $range-size 0 0
    height: $range-size
      transition: none
    appearance: none
    absolute: top 0 left 0
    padding: 0
    -moz-transform: translate(0, $range-size)
    background: transparent
    box-shadow: none
    cursor: pointer
    cursor: w-resize
    cursor: -webkit-grab
    cursor:    -moz-grab
    cursor:     -ms-grab
    cursor:         grab
      cursor: -webkit-grabbing
      cursor:    -moz-grabbing
      cursor:     -ms-grabbing
      cursor:         grabbing
      outline: 0
      display: none
      height: $range-size * 3
      color: transparent
      margin: ($range-size / 2) 0 0
    display: block
    position: relative
    padding: 0
      padding: 0
      border: 0
      box-shadow: none
      font-weight: bold
// Others

  margin-top: 10px
  padding: 16px
  background: #e7e7e7
for i in 1..3
    @extends $h
.container .jumbotron
  margin-bottom: 16px
  padding: 8px 0
].forEach (type) ->
    $id: "range-#{type}"
    value: Math.round(Math.random() * 100)
    setValue: (e) ->
      # Fix the range won't update the value in IE
      @value = @value

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.