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

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.

            
              <div class="accordion-example">
  <h1>HTML &amp; CSS-only Accordions</h1>
  
  <div class="accordion-wrapper">
    <input type="checkbox" checked/>
    <div class="accordion-icon"></div>
    <div class="accordion">
      <h2>Contact Information</h2>
      <h3>A mismatch from the client's original document and your upload.</h3>
    </div>
    <p>Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris.</p>
  </div>
  
  <div class="accordion-wrapper">
    <input type="checkbox" checked />
    <div class="accordion-icon"></div>
    <div class="accordion">
      <h2>Client's Content</h2>
      <h3>Clients maybe upset if they see text from their original document.</h3>
    </div>
    <p>Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris.</p>
  </div>
  
  <div class="accordion-wrapper">
    <input type="checkbox" checked />
    <div class="accordion-icon"></div>
    <div class="accordion">
      <h2>Template Content</h2>
      <h3>Leaving template content in a client's draft should be avoided whenever possible.</h3>
    </div>
    <p>Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris.</p>
  </div>
</div>
            
          
!
            
              $white: #ffffff
$primaryColor: #7462E0
$black: #000000
$sans: 'Proxima Nova', sans-serif

@keyframes flipdown
  0%
    opacity: 0
    transform-origin: top center
    transform: rotateX(-90deg)
  5%
    opacity: 1
  80%
    transform: rotateX(8deg)
  83%
    transform: rotateX(6deg)
  92%
    transform: rotateX(-3deg)
  100%
    transform-origin: top center
    transform: rotateX(0deg) 
  
.transition
  transition: all 0.25s ease-in-out

.flipIn
  animation: flipdown 0.5s ease both

body
  background: $primaryColor
  display: flex
  align-items: center
  justify-content: center
  
h1
  font-size: 1.8em
  line-height: 1.3em
  letter-spacing: 0.075em
  font-weight: 100
  text-transform: uppercase
  @extend .flipIn
  
h2
  font-size: 1.5em
  line-height: 1em
  font-weight: 500
  letter-spacing: 0.05em
  display: block
  background-color: $white
  margin: 0
  cursor: pointer
  
h3, p
  font-size: 1em
  line-height: 1.5em
  letter-spacing: 0.01em
  font-weight: 400
  color: $black

p
  position: relative
  overflow: hidden
  max-height: 800px
  @extend .transition
  opacity: 1
  transform: translate( 0 , 0 )  
  margin-top: 14px
  z-index: 2
  
.accordion-example
  padding: 10px 30px 20px
  margin: 5vh 12vw
  background-color: $white
  border-radius: 6px
  box-shadow: 1px 1px 14px 10px rgba(0,0,0, 0.1)
  
  .accordion-wrapper
    position: relative
    padding: 18px 0 0 0
    margin: 0
    border-top: 1px solid lighten($primaryColor, 25%)
    @extend .flipIn
      
    &:nth-of-type(1)
      animation-delay: 0.5s
    
    &:nth-of-type(2)
      animation-delay: 0.75s
        
    &:nth-of-type(3)
      animation-delay: 1.0s
    
    &:last-of-type
      padding-bottom: 0
    
    &:first-of-type
      border-top: 0
    
    .accordion
      user-select: none
      width: 92%
      
    .accordion-icon
      position: absolute
      width: 10px
      height: 10px
      border-color: $black
      border-bottom: 2px solid
      border-right: 2px solid
      transform: rotate(45deg)
      margin-top: 16px
      right: 0
      @extend: .transition
      transition-duration: 250ms
      
    input[type=checkbox]
      position: absolute
      cursor: pointer
      width: 100%
      height: 100%
      z-index: 1
      opacity: 0
      
      &:checked
        &~p
          margin-top: 0
          max-height: 0
          opacity: 0
          transform: translate( 0 , 50% )
            
        &~.accordion-icon
          transform: rotate( -45deg )
          
          
 
            
          
!
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