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.

            
              <button>Panic button</button>
            
          
!
            
              @import "compass/css3";

/*I just made this background and wanted to save it here*/
$colour:hsla(350,100%,25%,1);
$grey:desaturate($colour,90%);
body {
  background:lighten($grey,30%);
    background-image:
    linear-gradient(40deg,transparentize($grey,0.95),transparentize($colour,0.95)),

    linear-gradient(135deg,
        lighten($grey,18%) 0%,
        lighten($grey,18%) 10%,
        lighten($grey,25%) 11%,
        lighten($grey,25%) 40%,
        lighten($grey,35%) 41%,
        lighten($grey,35%) 50%,
        lighten($grey,18%) 51%,
        lighten($grey,18%) 60%,
        lighten($grey,25%) 61%,
        lighten($grey,25%) 90%,
        lighten($grey,35%) 91%)
    ;
    background-size:7px 7px, 4px 4px;
}


button {
  outline:none;
  font-family:'helvetica neue' sans-serif; font-size:2em;
  color:hsla(350,0%,100%,1); text-shadow:-1px -1px 1px hsla(350,0%,0%,0.7), 1px 1px 1px hsla(350,0%,100%,0.3);
  display:block; margin:2em auto; padding:23px 37px 25px 35px;
  cursor:pointer;
  background-color:hsla(350,80%,10%,1);
  background-image:
    linear-gradient(273deg,hsla(350,80%,60%,1) 30%, hsla(350,80%,50%,1) 40%)
  ;
  border:none; border-radius:16px;
  box-shadow:
    inset 0px 0px 1px 1px hsla(350,80%,30%,0.9),
    inset 0px 0px 2px 3px hsla(350,80%,50%,0.9),
    inset 1px 1px 1px 4px hsla(350,80%,100%,0.8),
    inset 0px 0px 2px 7px hsla(350,80%,60%,0.8),
    inset 0px 0px 4px 10px hsla(350,80%,50%,0.9),
    8px 10px 2px 6px hsla(350,80%,20%,0.55),
    0px 0px 3px 2px hsla(350,80%,40%,0.9),
    0px 0px 2px 6px hsla(350,80%,50%,0.9),
    /*0px 0px 2px 3px hsla(350,80%,60%,0.9),*/
    -1px -1px 1px 6px hsla(350,80%,100%,0.9),
    /*0px 0px 2px 8px hsla(350,80%,60%,0.9),*/
    0px 0px 2px 11px hsla(350,80%,50%,0.9),
    0px 0px 1px 12px hsla(350,80%,40%,0.9),
    1px 3px 14px 14px hsla(350,80%,0%,0.4)
  ;
}

button:active {
  color:hsla(350,0%,85%,1); padding:26px 34px 22px 38px;
  background-image:
    linear-gradient(273deg,hsla(350,80%,50%,1) 50%, hsla(350,80%,55%,1) 60%)
  ;
  box-shadow:
    inset 3px 4px 3px 2px hsla(350,80%,20%,0.55),
    inset 0px 0px 1px 1px hsla(350,80%,30%,0.9),
    inset -1px -1px 2px 3px hsla(350,80%,50%,0.9),
    inset -2px -2px 1px 3px hsla(350,80%,100%,0.8),
    inset 0px 0px 2px 7px hsla(350,80%,60%,0.8),
    inset 0px 0px 3px 10px hsla(350,80%,50%,0.9),
    
    0px 0px 3px 2px hsla(350,80%,40%,0.9),
    0px 0px 2px 6px hsla(350,80%,50%,0.9),
    /*0px 0px 2px 3px hsla(350,80%,60%,0.9),*/
    -1px -1px 1px 6px hsla(350,80%,100%,0.9),
    /*0px 0px 2px 8px hsla(350,80%,60%,0.9),*/
    0px 0px 2px 11px hsla(350,80%,50%,0.9),
    0px 0px 1px 12px hsla(350,80%,40%,0.9),
    1px 3px 14px 14px hsla(350,80%,0%,0.4)
  ;
}
            
          
!
            
              /*This was here as part of a bigger app, note you can use :active in CSS for this standalone case*/


var walkieTalkieButton = document.querySelector('.walkie-talkie');

walkieTalkieButton.addEventListener('mousedown', buttonDown, false);
walkieTalkieButton.addEventListener('mouseup', buttonUp, false);

function buttonDown() {
  walkieTalkieButton.classList.add('down-state');
}

function buttonUp() {
  walkieTalkieButton.classList.remove('down-state');
}

            
          
!
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