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.

            
              <div class="range">
    <span class="lbl-lft">0</span>
    <span class="lbl-rgt">100</span>
    <input type="range" id="range-input" oninput="updateVal(this.value)"/>
    <div id="range-value" class="range-thumb"></div>
  </div>

  <div class="resize">Resize to width = 768px for fluid slider</div>
            
          
!
            
              $primary: #626CE4

body
  font-family: 'Roboto', sans-serif
  -webkit-font-smoothing: antialiased
  text-rendering: optimizelegibility

*,
*::before,
*::after
  box-sizing: border-box

.range
  width: 234px
  height: 48px
  border: 0
  background: $primary
  position: absolute
  top: 45%
  left: 50%
  margin-left: -117px
  &:before, &:after
    content: ''
    position: absolute
    top: 0
    z-index: -1
    height: 100%
    width: 28px
    background: $primary
    pointer-events: none
  &:before
    left: -28px
    border-radius: 5px 0 0 5px
  &:after
    right: -28px
    border-radius: 0 5px 5px 0
  input
    -webkit-appearance: none
    position: absolute
    width: calc(100% + 40px)
    height: 100%
    margin: 0
    background-color: transparent
    outline: none
    left: -20px
    -webkit-tap-highlight-color: transparent
    &::-webkit-slider-thumb,
    &::-webkit-media-slider-thumb
      opacity: 0
    &:hover + .range-thumb,
    &:active + .range-thumb
      @media screen and (max-width: 768px)
        transform: translateY(-48px)
      &::before
        display: block

.lbl-lft,.lbl-rgt
  position: absolute
  top: -15px
  color: #1a1a1a
  font-size: 12px
  font-weight: 700
.lbl-lft
  left: -28px
.lbl-rgt
  right: -28px
  text-align: left

.range-thumb
  position: absolute
  top: 0px
  margin-left: -24px
  border-radius: 50%
  border: 5px solid $primary
  background: white
  height: 48px
  width: 48px
  outline: none
  transition: transform .3s ease
  text-align: center
  font-size: 12px
  line-height: 38px
  color: #1a1a1a
  font-weight: 700
  pointer-events: none
  &::before
    display: none
    content: ''
    position: absolute
    z-index: 1
    top: 53px
    left: 50%
    transform: translateX(-50%)
    border-radius: 3px
    width: 2px
    height: 28px
    margin-left: -3px
    background: rgba(white,.25)
    box-shadow: 6px 0 0 rgba(white,.25)
  &::after
    content: ''
    position: absolute
    bottom: -5px
    left: -5px
    width: 48px
    height: 10px
    background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDhweCIgaGVpZ2h0PSIxMHB4IiB2aWV3Qm94PSIwIDAgNDggMTAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ3ICg0NTM5NikgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+Q29tYmluZWQgU2hhcGU8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz48L2RlZnM+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iQXJ0Ym9hcmQiIGZpbGw9IiM2MTY4RTciPgogICAgICAgICAgICA8cGF0aCBkPSJNMTEuMTU0NjA2NCwyLjE4MjkyMDUxZS0xMiBMNC40NzIyMTMwMSwyLjE4MjkyMDUxZS0xMiBDNS40MjIyOTI4NiwxLjA2MTUxMjk4IDYsMi40NjMyOTExMyA2LDQgQzYsNy4zMTM3MDg1IDMuMzEzNzA4NSwxMCAwLDEwIEw0OCwxMCBDNDQuNjg2MjkxNSwxMCA0Miw3LjMxMzcwODUgNDIsNCBDNDIsMi40NjMyOTExMyA0Mi41Nzc3MDcxLDEuMDYxNTEyOTggNDMuNTI3Nzg3LDAgTDQzLjUyNzc4NywyLjE4MjkyMDUxZS0xMiBMMzYuODQ1MzkzNiwyLjE4MjkyMDUxZS0xMiBDMzMuNDYzMzI1NSwzLjEwNDc5MzA5IDI4Ljk1Mjk4NzQsNSAyNCw1IEMxOS4wNDcwMTI2LDUgMTQuNTM2Njc0NSwzLjEwNDc5MzA5IDExLjE1NDYwNjQsMi4xOTQyNDQ3OWUtMTIgWiIgaWQ9IkNvbWJpbmVkLVNoYXBlIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=')
    background-repeat: no-repeat
    background-position: center

.resize
  position: fixed
  bottom: 20px
  left: 0
  width: 100%
  text-align: center
  font-size: 14px
  font-weight: 500
  color: #C8CCD4
            
          
!
            
              var rangeVal = document.getElementById('range-value');
var rangeInp = document.getElementById('range-input');

var updateVal = function(val) {
  rangeVal.innerHTML = val;
  rangeVal.style.left = val + '%';
};

updateVal(rangeInp.value);
            
          
!
999px
🕑 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.

Console