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.

            
              		<input  type="checkbox" id="drawer-toggle" name="drawer-toggle"/>
		<label for="drawer-toggle" id="drawer-toggle-label"></label>
		<header>Header</header>
		<nav id="drawer">
			<ul>
				<li><a href="demos/pure-css-drawer-menu.html#">Menu Item</a></li>
				<li><a href="demos/pure-css-drawer-menu.html#">Menu Item</a></li>
				<li><a href="demos/pure-css-drawer-menu.html#">Menu Item</a></li>
				<li><a href="demos/pure-css-drawer-menu.html#">Menu Item</a></li>
			</ul>
		</nav>
		<div id="page-content">
			<p>
			Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin egestas et odio ut eleifend. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis eget commodo ligula, non pretium nibh. Aenean sed nibh a nunc pharetra vehicula. Nullam nec ipsum felis. Praesent sodales metus justo, sed dignissim justo consequat vel. Quisque congue malesuada eleifend. Duis ut velit et enim adipiscing ultrices. Curabitur ornare cursus tortor sit amet sollicitudin.
			</p>
		</div>
            
          
!
            
              body {
  margin-top:44px;
}
* {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	-o-box-sizing: border-box;
	box-sizing: border-box;
	-webkit-transition: .25s ease-in-out;
	-moz-transition: .25s ease-in-out;
	-o-transition: .25s ease-in-out;
	transition: .25s ease-in-out;
	margin: 0;
	padding: 0;
	-webkit-text-size-adjust: none;
}

/* Makes sure that everything is 100% height */

html,body {
	height: 100%;
	overflow: hidden;
}

/* gets the actual input out of the way; we're going to style the label instead */

#drawer-toggle {
	position: absolute;
	opacity: 0;
}

#drawer-toggle-label {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	left: 0px;
	height:50px;
	width: 50px;
	display: block;
	position: fixed;
	background: rgba(255,255,255,.0);
	z-index: 1;
}

/* adds our "hamburger" menu icon */

#drawer-toggle-label:before {
	content: '';
	display: block;
	position: absolute;
	height: 2px;
	width: 24px;
	background: #8d8d8d;
	left: 13px;
	top: 18px;
	box-shadow: 0 6px 0 #8d8d8d, 0 12px 0 #8d8d8d;
}

header {
	width: 100%;
	position: fixed;
	left: 0px;
	background: #efefef;
	padding: 10px 10px 10px 50px;
	font-size: 30px;
	line-height: 30px;
	z-index: 0;
}

/* drawer menu pane - note the 0px width */

#drawer {
	position: fixed;
	top: 44px;
	left:-300px;
	height: 100%;
	width: 300px;
	background: #2f2f2f;
	overflow-x: hidden;
	overflow-y: scroll;
	padding: 20px;
	-webkit-overflow-scrolling: touch;
}

/* actual page content pane */

#page-content {
	margin-left: 0px;
	margin-top: 50px;
	width: 100%;
	height: calc(100% - 50px);
	overflow-x:hidden;
	overflow-y:scroll;
	-webkit-overflow-scrolling: touch;
	padding: 20px;
}

/* checked styles (menu open state) */

#drawer-toggle:checked ~ #drawer-toggle-label {
	height: 100%;
	width: calc(100% - 300px);
	background: rgba(255,255,255,.8);
}

#drawer-toggle:checked ~ #drawer {
    left:0;
}

#drawer-toggle:checked ~ #drawer-toggle-label, #drawer-toggle:checked ~ header {
	left: 300px;
}

#drawer-toggle:checked ~ #page-content {
	margin-left: 300px;
}

/* Menu item styles */
#drawer ul {
    list-style-type:none;
}
#drawer ul a {
    display:block;
    padding:10px;
    color:#c7c7c7;
    text-decoration:none;
}

#drawer ul a:hover {
    color:white;
}

/* Responsive MQ */

@media all and (max-width:350px) {

	#drawer-toggle:checked ~ #drawer-toggle-label {
		height: 100%;
		width: 50px;
	}
	
	#drawer-toggle:checked ~ #drawer-toggle-label, #drawer-toggle:checked ~ header {
		left: calc(100% - 50px);
	}
	
	#drawer {
	    width:calc(100% - 50px);
	    left: -100%;
	}
	
	#drawer-toggle:checked ~ #page-content {
		margin-left: calc(100% - 50px);
	}

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