<ul class="accordion">
  <li class="accordion-item">
    <input id="s1" class="hide" type="checkbox">
    <label for="s1"class="accordion-label">First</label>
    <ul class="accordion-child">
      <li>
        <label>
          <input type="checkbox"> Item 1
        </label>
      </li>
      <li>
        <label>
          <input type="checkbox"> Item 2
        </label>
      </li>
   </ul>
  </li>
  <li class="accordion-item">
    <input id="s2" class="hide" type="checkbox" checked>
    <label for="s2" class="accordion-label">Second</label>
    <p class="accordion-child">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce quis ultrices nunc. Suspendisse a magna purus. In hac habitasse platea dictumst. Nullam sed nisl quis sem dignissim luctus. Etiam luctus mauris nulla, et efficitur massa efficitur ac.</p>
  </li>
</ul>
$border-color: #e0e0e0;

*,*:before,*:after{
  box-sizing: border-box;
}

html,
body{
  height: 100%;
}

body{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale; 
  font-family: roboto, helvetica, arial, san-serif;
  color: #666;
  background: #e0e0e0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: inherit;
}


.hide{
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  width: 1px;
}

.accordion{
  background: #fff;
  width: 400px;
  border: 1px solid $border-color;
}

.accordion-item{
	position: relative;
	width: 100%;
  border-bottom: 1px solid $border-color;
  
	&:last-child{
		border-bottom: none;
	}

}

.accordion-label{
	padding: 20px 0 20px 30px;
	width: 100%;
	display: block;
  font-size: 18px;
  
  &:hover{
    cursor: pointer;
  }

	&:before{
    content: '';
    position: absolute;
    height: 5px;
    width: 5px;
    top: 22px;
    left: 12px;
    display: inline-block;
    border-left: 5px solid #999;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
	}

	input[type=checkbox]:checked ~ &:before{
		transform: rotate(90deg);
	}
}

.accordion-child{
  margin: 0;
  overflow: hidden;

  transition: all 0.3s ease;
  
  opacity: 0;
  height: 0;
  transform: scale(1,0);
  transform-origin: center top;
  
	input[type=checkbox]:checked ~ &{

    border: 1px solid $border-color;
    margin: 0 -20px 15px -20px;
    background: #fff;
    box-shadow: 0 3px 6px 1px rgba(0,0,0,0.16);
 	  padding: 30px;
    
    height: auto;
    opacity: 1;
    transform: scale(1,1);
    
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.