css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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="accordion">
      
        <ul class="accordion__wrapper">
          
          <li class="accordion__header">
            <h1>Accordion Header</h1>
          </li> <!-- accordion__header -->
          
          <li class="accordion__item">
            <input type="checkbox" checked>
            <span class="entypo-up-open-big"></span>
            <h2>Accordion Panel 1</h2>
            <div class="panel">
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim. Phasellus molestie magna non est.</p>
  
              <p>Bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin quis tortor orci. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu ullamcorper orci. Quisque eget odio ac lectus vestibulum faucibus eget in metus. In pellentesque faucibus vestibulum.</p>
            </div> <!-- panel -->
          </li> <!-- accordion__item -->
          
          <li class="accordion__item">
            <input type="checkbox" checked>
            <span class="entypo-up-open-big"></span>
            <h2>Accordion Panel 2</h2>
            <div class="panel">
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin quis tortor orci. Etiam at risus et justo dignissim congue. Donec congue lacinia dui.</p>
            </div> <!-- panel -->
          </li> <!-- accordion__item -->
          
          <li class="accordion__item">
            <input type="checkbox" checked>
            <span class="entypo-up-open-big"></span>
            <h2>Accordion Panel 3</h2>
            <div class="panel">
              <p>Ut in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin quis tortor orci. Etiam at risus et justo dignissim congue. Donec congue.</p>
  
              <p>Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu ullamcorper orci. Quisque eget odio ac lectus vestibulum faucibus eget in metus. In pellentesque faucibus vestibulum. Nulla at nulla justo.</p>
            </div> <!-- panel -->
          </li> <!-- accordion__item -->
          
          <li class="accordion__item">
            <input type="checkbox" checked>
            <span class="entypo-up-open-big"></span>
            <h2>Accordion Panel 4</h2>     
            <div class="panel media">
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim. Phasellus molestie magna non est.</p>
  
              <p>Bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin quis tortor orci. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu ullamcorper orci. Quisque eget odio ac lectus vestibulum faucibus eget in metus. In pellentesque faucibus vestibulum.</p>
            </div> <!-- panel -->
          </li> <!-- accordion__item -->
          
        </ul> <!-- accordion__wrapper -->
      </div> <!-- accordion -->
            
          
!
            
              // Import Fonts
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,800);
@import url(http://weloveiconfonts.com/api/?family=entypo);

// Global Styles
body {
  background: #eaeaea;
  font-family: 'Open Sans' Helvetica, sans-serif;
  font-size: 16px;
  line-height: 24px;
}

h1, h2 {
  font-weight: 800;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 18px;
  line-height: 27px;
}

p {
  margin: 1rem 0;
}

[class*="entypo-"]:before {
  font-family: 'entypo', sans-serif;
}

// Begin Pattern Styles
.accordion {
  
  $accordion-border-radius: 4px;
  $accordion-border-color: #eaeaea;
  $accordion-padding: 1rem;
  $accordion-heading-color: #ff9e2c;
  $accordion-icon-color: #ff9e2c;
  
  margin: 0 auto;
  width: 50%;
  
  &__wrapper {
    border: 1px solid $accordion-border-color;
    border-radius: $accordion-border-radius;
    list-style: none;
    margin: $accordion-padding 0;
    width: 100%;
  }
  
  &__header, &__item {
    float: left;
    padding-left: $accordion-padding;
    padding-right: $accordion-padding;
    padding-top: $accordion-padding;
    position: relative;
    width: 100%;
  }
  
  &__header {
    background: $accordion-heading-color;
    border-bottom: 1px solid darken($accordion-heading-color, 10);
    border-top-left-radius: $accordion-border-radius;
    border-top-right-radius: $accordion-border-radius;
    color: #fff;
    padding-bottom: $accordion-padding;
    
  }
  
  &__item {
    background: #fff;
    border-bottom: 1px solid $accordion-border-color;
    margin-bottom: 1px;
    padding-bottom: $accordion-padding / 2;
    
    &:last-of-type {
      border: 0;
      border-radius: $accordion-border-radius;
      padding-bottom: 0;
    }
    
    // The accordion chevron icon
    span {
      color: $accordion-icon-color;
      margin-top: $accordion-padding;
      position: absolute;
      right: $accordion-padding;
      top: 0;
      transition: all 0.2s ease-in;
    }
    
    input[type=checkbox] {
      position: absolute;
      cursor: pointer;
      width: 100%;
      height: 100%;
      z-index: 1;
      opacity: 0;
      
      &:checked {
      
        // Ensures panels are closed until checked
        &~div.panel {
          float: left;
          margin: 5px 0;
          max-height: 0;
          opacity: 0;
          transform: translate(0, 50%);
        }
        
        // Rotate chevron icon on selection  
        &~span {
          transform: rotate( 180deg );
        }
      
      }
      
    }
    
  }

}
            
          
!
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