cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              // Events
input#app-event-1(type="checkbox")
input#app-event-2(type="checkbox")    
input#app-event-3(type="radio"
                  name="app-event-3"
                  checked)
input#app-event-4(type="radio"
                  name="app-event-3")
  
.body
  
  .app
    .app-menu

      .app-nav
        label.app-nav__icon(for="app-event-1")
        ul
          li: a(href="#") Home

      .app-menu__title Menu

      .app-search
        label.app-search__icon(for="app-event-2")
        .app-search__field
          input(type="text"
                placeholder="Search...")
    
    .app-header
      .app-header__image
        img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/169963/coffee-cup-thin.png")
        img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/169963/donut-thin.png")
      
      .app-tabs
        label.app-tabs__tab.app-tabs__tab--one(for="app-event-3") Coffee
        label.app-tabs__tab.app-tabs__tab--two(for="app-event-4") Donuts
        
    .app-body

      .app-panel.app-panel--one
        - var shots = ["Expresso", "Cappuccino", "Americano", "Cafe Latte", "Macchiato"]
        - var small = ["2.30", "3.10", "1.90", "2.60", "2.20"]
        - var large = ["2.90", "3.50", "2.20", "3.00", "2.70"]
        
        .app-panel__header
          span Shots
          span Sml
          span Lrg

        .app-panel__content
          .app-panel__column
            ul
              each value in shots
                li= value

          .app-panel__column
            ul
              each value in small
                li= value

          .app-panel__column
            ul
              each value in large
                li= value

      .app-panel.app-panel--two
        - var donuts = ["Regular", "Chocolate", "Glazed", "Sprinkles", "Coffee"]
        - var price = ["0.80", "2.10", "1.90", "2.60", "1.20"]
        
        .app-panel__header
          span Shots
          span PR

        .app-panel__content
          .app-panel__column
            ul
              each value in donuts
                li= value

          .app-panel__column
            ul
              each value in price
                li= value
            
          
!
            
              $white: #FFF;
$black: #000;
$dark-gray: #222;
$gray: #444;
$light-gray: #999;

html,
body {
  width: 100%;
  height: 100%;
}

body {
  background: #FF8A8A;
  color: $gray;
  font-family: 'Roboto';
  font-weight: 300;
  padding: 80px 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.body {
  z-index: 1;
  position: relative;
  background: $white;
  width: 300px;
  height: 500px;
  border-radius: 6px;
  box-shadow: 0 0 20px rgba($black, 0.2);
  margin: 0 auto;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  
  &-menu {
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 30px 30px 20px;

    &__title {
      font-size: 16px;
      font-weight: 500;
      letter-spacing: 1.2px;
      text-transform: uppercase;
    }
  }
  
  &-nav {
    display: inline-block;

    &__icon {
      position: relative;
      display: block;
      width: 14px;
      height: 10px;
      cursor: pointer;

      &:before,
      &:after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        display: block;
        background: $dark-gray;
        width: 100%;
        height: 1px;
        transition: 0.3s cubic-bezier(.28,.55,.36,1.18);
      }
      
      &:after {
        top: auto;
        bottom: 0;
      }
    }
    
    ul {
      display: none;
    }
  }
  
  &-search {
    &__icon {
      z-index: 1;
      position: relative;
      display: block;
      width: 14px;
      height: 14px;
      cursor: pointer;

      &:before,
      &:after {
        content: "";
        position: absolute;
        display: block;
      }
      
      &:before {
        top: 0;
        left: 0;
        width: 12px;
        height: 12px;
        border: 1px solid $dark-gray;
        border-radius: 100%;
        box-sizing: border-box;
      }
      
      &:after {
        right: 0;
        bottom: 0;
        background: $dark-gray;
        width: 1px;
        height: 6px;
        transform-origin: bottom right;
        transform: rotate(-45deg);
      }
    }
    
    &__field {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: $white;
      border-bottom: 1px solid rgba($black, 0.1);
      visibility: hidden;        
      opacity: 0;
      transition: 0.3s ease;
      
      input {
        position: absolute;
        bottom: 0;
        width: 100%;
        height: 100%;
        border: 0;
        padding: 50px 20px 0;
        font-size: 14px;
      }
    }
  }
  
  &-header {
    &__image {
      padding: 40px 0;

      img {
        display: block;
        margin: 0 auto;
        
        &:last-child {
          display: none;
        }
      }
    }
  }
  
  &-tabs {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;

    &__tab {
      margin: 0 15px;
      padding: 10px 0;
      color: $light-gray;
      font-size: 16px;
      font-weight: 500;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      cursor: pointer;
      transition: 0.3s ease;
      
      &--one {
        color: $dark-gray;
        box-shadow: inset 0 -2px 0 0 $dark-gray;
      }
    }
  }
    
  &-body {
    position: relative;
    display: flex;
    background: #EEF2F6;
    height: 100%;
  }
  
  &-panel {
    position: absolute;
    top: 20px;
    left: calc(100% - 20px);
    background: $white;
    width: 240px;
    height: calc(100% - 20px);
    padding: 20px 5px 0;
    box-sizing: border-box;
    transition: 0.6s cubic-bezier(.28,.55,.36,1.18);
    
    &--one {
      left: 20px;
    }
    
    &__header {
      display: flex;
      flex-direction: row;
      
      span {
        margin: 0 0 10px;
        padding: 0 15px;
        color: $light-gray;
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        
        &:first-child {
          width: 100%;
        }
      }
    }
    
    &__content {
      display: flex;
      flex-direction: row;
    }
    
    &__column {
      padding: 0 15px;
      color: $dark-gray;
  
      &:first-child {
        width: 100%;
        font-weight: 500;
      }
      
      li {
        padding: 10px 0;
      }
    }
  }
}

#app-event {
  &-1,
  &-2, 
  &-3,
  &-4 {
    display: none;
  }
  
  &-1 {
    &:checked {
      ~ .body .app .app-menu .app-nav .app-nav__icon {
        &:before {
          transform: translateY(-2px);
        }
        
        &:after {
          transform: translateY(2px);
        }
      }
    }
  }
  
  &-2 {
    &:checked {
      ~ .body .app .app-menu .app-search .app-search__field {
        visibility: visible;        
        opacity: 1;
      }
    }
  }

  &-4 {
    &:checked {
      ~ .body .app .app-header .app-header__image img {
        &:first-child {
          display: none;
        }
        
        &:last-child {
          display: block;
        }
      }
        
      ~ .body .app .app-header .app-tabs .app-tabs__tab--one {
        color: $light-gray;
        box-shadow: none;
      }
      
      ~ .body .app .app-header .app-tabs .app-tabs__tab--two {
        color: $dark-gray;
        box-shadow: inset 0 -2px 0 0 $dark-gray;
      }
      
      ~ .body .app .app-body .app-panel--one {
        left: calc(-100% + 80px);
      }
      
      ~ .body .app .app-body .app-panel--two {
        left: 40px;
      }
    }
  }
}
            
          
!
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.
Loading ..................

Console