Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <!--Pattern HTML-->
  <section id="pattern" class="pattern">
  	<div class="crumbs-container">
			<ul class="crumbs">
				<li><a href="#">Grandparent</a></li>
				<li><a href="#">Parent</a></li>
				<li><a href="#">Child</a></li>
				<li class="last"><a href="#">Grandchild</a></li>
			</ul>
		</div>
	</section>
	<!--End Pattern HTML-->
	
	
	<div class="container">	
		<!--Pattern Description-->
		<section class="pattern-description">
			<h1>Dropdown Breadcrumbs</h1>
			<p>A breadcrumb solution that exposes the last item for small screens and reveals the rest of the items in the trail when clicked. The entire trail is exposed when space becomes available.</p>
			<h2>Pros</h2>
			<ul>
				<li>Saves space by only exposing the last element in the breadcrumb trail.</li>
				<li>Small screen users are still able to traverse the breadcrumb trail</li>
			</ul>
			<h2>Cons</h2>
			<ul>
        <li>Accordion-like control doesn't necessarily map nicely to breadcrumb interaction</li>
        <li>JS dependancy - not necessarily a con, but worth keeping in mind that the Javascript dependency means more testing and consideration</li>
			</ul>
		</section>
		<!--End Pattern Description-->
		
		<!--Footer-->
		<footer role="contentinfo">   
			<div>
				<nav id="menu">
					<a href="https://bradfrost.github.com/this-is-responsive/patterns.html">&larr;More Responsive Patterns</a>
				</nav>
			</div>
		</footer>
		<!--End Footer-->
	</div>

              
            
!

CSS

              
                .crumbs-container {
  		position: relative;
			overflow: hidden;
			height: 3.2em;
			-webkit-transition: height 0.5s ease-out; 
			-moz-transition: height 0.5s ease-out;  
			-o-transition: height 0.5s ease-out; 
			transition: height 0.5s ease-out;
		}
		.crumbs-container.active {
			height: 13.6em;
		}
		.crumbs {
			width: 100%;
			position: absolute;
			bottom: 0;
			
		}
		.crumbs li a {
			display: block;
			padding: 1em;
			border-bottom: 1px solid #000;
		}
		.crumbs li:last-child a {
			border-bottom: 0;
		}
		#crumbs-trigger {
			position: absolute;
			bottom: 0;
			right: 0;
			display: block;
			font-size: 2em; 
			padding: 0 0.5em 0.2em;
		}
		
		@media all and (min-width: 32em) {
			.crumbs-container.active {
				height: 3.2em;
			}
			.crumbs {
				padding: 1em;
			}
			.crumbs li {
				display: inline-block;
			}
			.crumbs li a {
				display: inline;
				border: 0;
				padding: 0;
			}
			.crumbs li:after {
				content: '→';
				padding: 0 0.25em 0 0.5em;
				color: #999;
			}
			.crumbs li.last:before, .crumbs li.last:after {
				content: '';
			}
			#crumbs-trigger {
				display: none;
			}
		}
              
            
!

JS

              
                (function(w){
  		var $crumbsContainer = $('.crumbs-container');
			$(document).ready(function() {
				buildCrumbs();
			});
			
			function buildCrumbs() {
				$('<a href="#" id="crumbs-trigger">+</a>').appendTo($crumbsContainer);
				
				$('#crumbs-trigger').bind('click', function(e) {
					e.preventDefault();
					var $this = $(this);
					$crumbsContainer.toggleClass('active');
					
					if($crumbsContainer.hasClass('active')) {
						$this.text('-');
					} else {
						$this.text('+');
					}
				});

			}
			
			
		})(this);

              
            
!
999px

Console