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="toggleWrapper">
  <input type="checkbox" class="dn" id="dn"/>
    <label for="dn" class="toggle">
    <span class="toggle__handler">
  <div class="bear-body">
    <span class="eye left"></span>
    <span class="eye right"></span>
              $brown: #7e2804;
$orange: #fe7702;
$darkBrown: #3d2526;
$yellow: #fdb300;
$tan: #dcc8a3;

body {
  background-color: #7994a5;
  height: 100vh;

.toggleWrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 0 200px;
  transform: translate3d(-50%, -50%, 0);

  input {
    position: absolute;
    left: -99em;

.toggle {
  cursor: pointer;
  display: inline-block;
  position: absolute;
  width: 90px;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  height: 40px;
  background-color: $tan;
  border-radius: 90px - 6;
  z-index: 2;
  transition: background-color 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);

.toggle__handler {
  display: inline-block;
  position: relative;
  z-index: 1;
  top: 3px;
  left: 3px;
  width: 40px - 6;
  height: 40px - 6;
  background-color: $brown;
  border-radius: 50px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform: rotate(-45deg);

input:checked {
  + .toggle {

    &:after {
      color: #ffffff;

    .toggle__handler {
      transform: translate3d(49px, 0, 0) rotate(0);
    + .bear-body {
      transform: rotateY(180deg);

.bear-body {
  position: relative;
  border-radius: 20px 10px 5px;

  border-bottom: 150px solid $brown;
  border-left: 20px solid transparent;
  border-right: 10px solid transparent;
  height: 0;
  width: 94px;

  &::after {
    content: '';
    position: absolute;
    height: 25px;
    width: 25px;
    border-radius: 50%;
    top: -16px;
    background: radial-gradient($tan 5px, $brown 6px);
  &::before {
    left: -12.5px;
  &::after {
    right: -12.5px;
  .eye {
    position: absolute;
    top: 18px;
    background: $darkBrown;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background-image: radial-gradient(circle at 4px, white 1px, $darkBrown 2px);

    &.left {
      left: 20px;
      animation: blink 3s ease-in-out infinite;
    &.right {
      left: 46px;
      animation: blink 3.5s ease-in-out infinite;

@keyframes blink {
  85% {
    transform: rotateX(0deg);
  90% {
    transform: rotateX(90deg);

🕑 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.