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="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>
              
            
!

CSS

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

JS

              
                $(document).foundation();
              
            
!
999px

Console