Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="accordion-example">
  <h1>Frequently Asked Questions</h1>
  
  <div class="accordion-wrapper">
    <input type="checkbox" checked/>
    <div class="accordion-icon"></div>
    <div class="accordion">
      <h2>Are dogs really better than cats?</h2>
      <h3>I can't believe you're asking me this, but I'll indulge you.</h3>
    </div>
    <p>Doggo ipsum ruff woofer very taste wow lotsa pats pupperino long bois very taste wow, stop it fren long bois very jealous pupper fluffer. Many pats vvv smol borking doggo with a long snoot for pats the neighborhood pupper, long water shoob borkdrive. Very hand that feed shibe maximum borkdrive smol ur givin me a spook, very jealous pupper. Long doggo very taste wow much ruin diet, you are doing me a frighten. most angery pupper I have ever seen</p>
  </div>
  
  <div class="accordion-wrapper">
    <input type="checkbox" checked />
    <div class="accordion-icon"></div>
    <div class="accordion">
      <h2>What's the difference between a woofer and a pupper?</h2>
      <h3>Two distinct and equally beautiful classes of doggos.</h3>
    </div>
    <p>Doggo ipsum ruff woofer very taste wow lotsa pats pupperino long bois very taste wow, stop it fren long bois very jealous pupper fluffer. Many pats vvv smol borking doggo with a long snoot for pats the neighborhood pupper, long water shoob borkdrive. Very hand that feed shibe maximum borkdrive smol ur givin me a spook, very jealous pupper. Long doggo very taste wow much ruin diet, you are doing me a frighten. most angery pupper I have ever seen.</p>
  </div>
  
  <div class="accordion-wrapper">
    <input type="checkbox" checked />
    <div class="accordion-icon"></div>
    <div class="accordion">
      <h2>How much is too much snoot booping?</h2>
      <h3>No such thing.</h3>
    </div>
    <p>Doggo ipsum ruff woofer very taste wow lotsa pats pupperino long bois very taste wow, stop it fren long bois very jealous pupper fluffer. Many pats vvv smol borking doggo with a long snoot for pats the neighborhood pupper, long water shoob borkdrive. Very hand that feed shibe maximum borkdrive smol ur givin me a spook, very jealous pupper. Long doggo very taste wow much ruin diet, you are doing me a frighten. most angery pupper I have ever seen.</p>
  </div>
</div>
              
            
!

CSS

              
                //Colors
$bgColor: #fff
$secondaryColor: #6369D1
$tertiaryColor: #60E1E0
$black: #34435E

//Fonts
$fontSans: 'Lato', sans-serif

//Breakpoints
$smallBreakpoint: 350px
$largeBreakpoint: 1000px

//Animations
@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) 

//General Styles
body
  background: $bgColor
  display: flex
  align-items: center
  justify-content: center
  font-family: $fontSans
h1
  font-size: 1em
  line-height: 1.5em
  text-transform: uppercase
  letter-spacing: 0.075em
  font-weight: 400
  color: $secondaryColor
  margin-bottom: 2em
  animation: flipdown 0.5s ease both
  
h2
  font-size: 1.5em
  line-height: 1.25em
  font-weight: 900
  display: block
  margin: 0
  cursor: pointer
  color: $black
  transition: all 0.25s ease-in-out
h3, p
  font-size: 1em
  line-height: 1.75em
  letter-spacing: 0.01em
  font-weight: 400
  color: $black
p
  position: relative
  overflow: hidden
  max-height: 800px
  transition: all 0.3s ease-in-out
  opacity: 1
  transform: translate( 0 , 0 )  
  margin-top: 14px
  z-index: 2
  
.accordion-example
  padding: 2em 4em 0em
  
.accordion-wrapper
  position: relative
  padding: 24px 0 0 0
  margin: 0
  border-top: 1px solid lighten($black, 50)
  animation: flipdown 0.5s ease both

  &: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
    transform: rotate(90deg)
    margin-top: 16px
    right: 0

    &:before , &:after
      content: ""
      transition: all 0.25s ease-in-out
      position: absolute
      background-color: $secondaryColor
      width: 3px
      height: 18px
      
.accordion-wrapper 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
      &:before
        transform: rotate( 90deg )
.accordion-wrapper:hover
  h2
    color: $secondaryColor
          
//Media Queries
@media (min-width: $largeBreakpoint) 
  .accordion-wrapper
    max-width: 800px
    
@media (max-width: $smallBreakpoint) 
  .accordion-example
    padding: 2em 2em 0em
  .accordion-wrapper
    min-width: 250px

              
            
!

JS

              
                
              
            
!
999px

Console