123

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="row">
  <div class="small-12 columns">
    
<ul class="accordion" data-accordion>
  <li class="accordion-navigation active">
    <a href="#panel1a">Accordions animate when opening and closing</a>
    <div id="panel1a" class="content active">
      Panel 1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </div>
  </li>
  <li class="accordion-navigation">
    <a href="#panel2a">They are also partially blended into the page background</a>
    <div id="panel2a" class="content">
      Panel 2. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </div>
  </li>
  <li class="accordion-navigation">
    <a href="#panel3a">Long content just shows a scrollbar</a>
    <div id="panel3a" class="content">
      <p>What counts as "long" is defined by the max-height of the active content on line 45. In our case it's set at 60vh, which is 60% of the viewport height.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Debitis alias delectus eos fugit deserunt maiores repellat quos temporibus cumque quo soluta iure, et, accusamus, nemo. Voluptatum molestiae quod laborum voluptatem.</p>
      <p>Doloribus sed perspiciatis quos eaque cupiditate nihil fuga veniam nisi. Ex assumenda consequuntur ipsum nemo quaerat et, repellat qui impedit, mollitia ut veniam eligendi possimus fuga! Accusamus sequi harum dignissimos.</p>
      <p>Dicta delectus rerum reiciendis molestias eligendi, magnam deleniti sit perspiciatis quam molestiae provident ea aliquid eum officia eius odit, atque accusamus ex nemo placeat eos voluptatum. Quasi ipsam, ea nam!</p>
      <p>Incidunt doloribus similique, placeat, harum reprehenderit voluptate aliquam exercitationem obcaecati sequi. Dignissimos nam, corrupti quo eius officia distinctio enim vero optio expedita magnam assumenda illum, quae aut, ad omnis. A.</p>
      <p>Quae minima modi, rerum labore quos blanditiis incidunt tenetur ducimus aliquid placeat animi illo dicta porro, quisquam perferendis nobis consectetur saepe omnis esse iusto, dolorum qui eveniet? Ipsum, veniam veritatis?</p>
      <p>Doloribus sed perspiciatis quos eaque cupiditate nihil fuga veniam nisi. Ex assumenda consequuntur ipsum nemo quaerat et, repellat qui impedit, mollitia ut veniam eligendi possimus fuga! Accusamus sequi harum dignissimos.</p>
      <p>Dicta delectus rerum reiciendis molestias eligendi, magnam deleniti sit perspiciatis quam molestiae provident ea aliquid eum officia eius odit, atque accusamus ex nemo placeat eos voluptatum. Quasi ipsam, ea nam!</p>
    </div>
  </li>
</ul>
  </div>
</div>
            
          
!
            
              @import "compass/css3";

body
{
  background-color: rgba(rebeccapurple, 0.6115);
  padding: 2rem;
}
.accordion
{
	margin-left: 0;
	margin-bottom: 2rem;
	@include box-shadow(0 1px 3px rgba(black, 0.2));
	.accordion-navigation
	{
		@include transition(ease 0.4s all);
/* 		@include box-shadow(0 0 1px rgba(black, 0.2)); */
		background-color: rgba(white, 0.5);
		&.active
		{
			@include box-shadow(0 1px 10px rgba(black, 0.4));
			position: relative; // so box-shadow appears over other accordions
			background-color: rgba(white, 0.9);
			> a
			{
				border-bottom: 1px solid rgba(0,0,0,0.05);
				background: transparent;
			}
		}
		> a
		{
			@include transition(ease 0.4s all);
			background: transparent;
			&:hover
      {
        background-color: rgba(white, 0.75);
      }
		}
		> .content
		{
			display: block;
			max-height: 0;
			overflow-y: auto;
			padding: 0 1rem;
			@include transition(ease 0.4s all);
			&.active
			{
				max-height: 60vh;
				padding: 1rem;
				@include transition(ease 0.4s all);
				@include transition-delay(0.4s);
				background: transparent;
			}
		}
	}
}
            
          
!
            
              $(document).foundation();
            
          
!
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.

Console