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

              
                #toggle
	span
#menu
	span#title Menu
	ul
		li
			a(href="#")
				span Home
		li
			a(href="#")
				span Forum
		li
			a(href="#")
				span Downloads
#wrapper
	#logo
		span Mobile Navigation Menu
	section Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis sunt mollitia molestiae maxime, voluptatibus, voluptas placeat minima natus temporibus culpa repudiandae! Nam porro molestiae possimus, laboriosam, vero tenetur consequatur voluptatibus?
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Quicksand');

@mixin transition($duration, $timing-func) {
	-webkit-transition: $duration $timing-func all;
	   -moz-transition: $duration $timing-func all;
			transition: $duration $timing-func all;
}

@mixin scale($size) {
	-webkit-transform: scale($size);
	   -moz-transform: scale($size);
			transform: scale($size);
}

@mixin rotate($deg) {
	-webkit-transform: rotate($deg);
	   -moz-transform: rotate($deg);
			transform: rotate($deg);
}

$bg: rgb(40,110,250);
$menu-bg: #fff;
$menu-hover: rgba(40,110,250,0.25);
$size: 5em;
$time: 350ms;
$degree: 135deg;
$timing: ease;

* {
	margin: 0;
	padding: 0;
	-webkit-box-sizing: border-box;
	   -moz-box-sizing: border-box;
			box-sizing: border-box;
}

body {
	background: $bg;
	color: #eee;
	font-family: 'Quicksand', sans-serif;
}

#toggle {
	position: fixed;
	z-index: 3;
	width: $size / 1.75;
	height: $size / 1.75;
	top: 0;
	left: 0;
	margin: 15px 0 0 15px;
	cursor: pointer;
	
	span {
		display: block;
		position: absolute;
		width: 100%;
		height: $size / 25;
		margin: $size / 4 0 0 0;
		background: #eee;
		@include transition($time, $timing);
		
		&:before,
		&:after {
			content: " ";
			position: absolute;
			width: 100%;
			height: $size / 25;
			background: #eee;
			@include transition($time, $timing);
		}
		
		&:before {
			margin: -$size / 5 0 0 0;
		}
		
		&:after {
			margin: $size / 5 0 0 0;
		}
	}
	
	&.open {
		span {
			background-color: transparent;
			
			&:before,
			&:after {
				margin: 0;
				background: $bg;
			}
			
			&:before {
				@include rotate($degree);
			}
			
			&:after {
				@include rotate(-$degree);
			}
		}
	}
}

#menu {
	visibility: hidden;
	opacity: 0;
	position: fixed;
	z-index: 2;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	text-align: center;
	background: $menu-bg;
	@include scale(1.5);
	@include transition($time, $timing);
	
	&.opened {
		visibility: visible;
		opacity: 1;
		@include scale(1);
		@include transition($time, $timing);
	}
	
	span {
		&#title {
			display: block;
			line-height: $size / 5;
			margin: 0 0 $size / 10 0;
			font-size: $size;
			color: $bg;
		}
	}
	
	ul {
		list-style: none;
		margin: 0 auto;
		
		li {
			display: block;
			width: 90%;
			height: 65px;
			margin: 0 auto $size / 10 auto;
			
			&:after {
				content: " ";
				position: absolute;
				width: 0%;
				height: 65px;
				margin: -65px 0 0 5%;
				left: 0;
				background: $bg;
				border-radius: $size / 20;
				@include transition($time, $timing);
			}
			
			&:hover {
				&:after {
					width: 90%;
				}
			}
			
			a {
				position: relative;
				z-index: 4;
				display: block;
				width: 100%;
				height: 65px;
				line-height: 65px;
				margin: 0 auto;
				color: $bg;
				text-decoration: none;
				border: 1px solid #ddd;
				border-radius: $size / 25;
				@include transition($time, $timing);
				
				&:hover {
					color: #eee;
					border-color: $bg;
				}
				
				span {
					font-size: $size / 3;
				}
				
				i {
					position: absolute;
					padding: 0 $size / 4 0 0;
					font-size: $size / 2.5;
				}
			}
		}
	}
}

#wrapper {
	width: 85%;
	margin: 0 auto;
	
	#logo {
		display: block;
		width: 100%;
		margin: 40px auto;
		text-align: center;
		
		span {
			font-size: $size / 1.5;
		}
	}
	
	section {
		font-size: $size / 4.5;
	}
}
              
            
!

JS

              
                $("#toggle").click(function() {
	$(this).toggleClass("open");
	$("#menu").toggleClass("opened");
});
              
            
!
999px

Console