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

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

              
                <main class="main">
	<details class="menu" open>
		<summary class="menu-button">
			<svg class="icon">
				<use closed xlink:href="#icon-tags" />
				<use open xlink:href="#icon-close" />
			</svg>
		</summary>
		<ul class="menu-list">
			<li class="item title">Menu list</li>
			<li class="item item-4"><a href="#">Lorem</a></li>
			<li class="item item-5"><a href="#">ipsum</a></li>
			<li class="item item-1"><a href="#">dolor sit</a></li>
			<li class="item item-2"><a href="#">consectetur</a></li>
			<li class="item item-3"><a href="#">Nesciunt ratione</a></li>
		</ul>
	</details>
	<section class="sect">
		<article class="art">
			<h1>&lt;details&gt; Menu in css</h1>
			<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Illo, optio dolorum hic, voluptatem ipsum adipisci rerum libero, dicta consequatur amet exercitationem laborum iusto numquam corporis blanditiis recusandae mollitia distinctio animi.</p>
			<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Veritatis dolorum rem, fugiat aspernatur expedita amet praesentium sed, excepturi alias magnam officia aliquid iure blanditiis, sunt atque illo quis minus delectus beatae ab porro. Voluptatem, ratione velit asperiores ipsam, aperiam distinctio illo blanditiis molestias earum voluptas perspiciatis eius cupiditate cumque delectus autem minus nisi harum atque. Reiciendis quisquam eaque eum tempora sint ratione fugiat commodi. Nulla doloribus quasi, fugit ab animi magnam perspiciatis itaque voluptatum, nostrum laborum exercitationem id adipisci aut quia eius eos saepe possimus tempore. Vitae veritatis quo ex vel soluta ullam! Quas perferendis quod enim debitis voluptatibus minima corrupti eaque? Autem quam nobis, incidunt earum in harum. Sit nemo quaerat officia est, magni praesentium laboriosam ipsa fugit beatae ducimus, quod perferendis? Delectus sed recusandae laudantium maxime iste modi est asperiores aliquid dolor ut soluta enim, eveniet dolore similique tenetur minus veniam suscipit, id voluptates omnis aliquam voluptatem cum sunt? Natus maxime velit dicta assumenda ex? Debitis sapiente minus magni aliquid quo animi. Reiciendis numquam et veritatis laboriosam deserunt similique, odio adipisci consequatur blanditiis, voluptatibus deleniti cumque culpa eligendi ut laborum quos consectetur debitis placeat, saepe nihil eaque hic. Ipsa, iusto incidunt soluta nam iste voluptatem aliquid architecto sed nesciunt impedit tempora ipsum, dolores modi explicabo reprehenderit earum ratione repellat nulla ea necessitatibus. Obcaecati quibusdam ex maxime mollitia adipisci, voluptatem explicabo facilis a. Eaque dolorum voluptatem aliquam at quo architecto quis ab, labore placeat, sint delectus ipsam deserunt ex quibusdam consequuntur pariatur quidem expedita recusandae distinctio? Sed laborum hic quidem eveniet voluptatum provident optio quod inventore quis iusto odit animi sapiente vero, error aliquid deleniti reprehenderit aperiam eos ratione architecto doloremque incidunt praesentium. Laudantium totam voluptate, sed enim quaerat, ducimus modi quae repellendus corporis eum saepe ut quod nisi nostrum ipsam repellat neque facere. Modi ullam cupiditate laborum tenetur omnis odit voluptatem consequuntur exercitationem pariatur! Reiciendis ratione officia voluptates enim ad distinctio beatae obcaecati aliquid quasi labore fugit, repellendus, nisi, nobis minima culpa qui sit quia hic eius commodi! Laborum incidunt autem beatae magni, esse sed. Reprehenderit ab temporibus nostrum unde odit ipsa perspiciatis commodi recusandae placeat eos cupiditate quis illo, voluptatem adipisci labore voluptate nobis quisquam cumque deserunt quasi rem ea. Voluptate obcaecati, ratione in quisquam corporis provident aliquam dolore aliquid mollitia explicabo expedita deserunt, aperiam, eius vero id voluptas? Ea voluptas corrupti tempora saepe dolore sit minus error. Tenetur velit reiciendis, maxime obcaecati cupiditate aut aliquam provident accusantium enim atque ea dicta, esse recusandae eligendi amet deleniti. Incidunt, animi magni nemo amet, laborum tempora autem quibusdam adipisci corporis deserunt accusantium facere quisquam excepturi nisi recusandae consequatur cum architecto minima eaque repellat obcaecati numquam cumque totam odio. Soluta assumenda mollitia blanditiis quidem recusandae hic odio magni odit! Rerum, impedit molestias quas eaque iste voluptatibus quos sunt quisquam unde corrupti alias obcaecati, totam incidunt veritatis cupiditate illum, soluta expedita accusamus. Asperiores necessitatibus alias aliquid explicabo at officiis illo voluptatem ipsam architecto earum ad, vitae mollitia assumenda unde error commodi quisquam labore! A voluptatum, quasi ab nam vero quisquam ad.</p>
			<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolore, aliquam rerum totam eos, tempore culpa quaerat velit laudantium maxime ex beatae consectetur atque nisi eaque sapiente odio corrupti! Doloremque natus tempora nihil. Quod, delectus dolorum perspiciatis quaerat pariatur odit distinctio suscipit laudantium quos ex tempora perferendis? Reiciendis, dolore nulla pariatur aspernatur provident unde vel distinctio facilis suscipit aut. Quas alias perferendis, laudantium similique, obcaecati ratione illum omnis itaque reiciendis, voluptas vel explicabo perspiciatis esse! Dolor atque est totam, mollitia at necessitatibus possimus qui minus suscipit neque cumque assumenda enim, facere iure? Deserunt voluptatem modi pariatur ut praesentium accusamus similique provident reiciendis obcaecati. Ad dolor excepturi, optio atque neque inventore fugit nostrum sit odio. Ad recusandae omnis repellat tempore quo saepe illum culpa asperiores dignissimos exercitationem quia, veritatis impedit iusto eligendi, et quas inventore delectus distinctio porro rerum veniam deserunt. Hic quam quibusdam quos praesentium illo id culpa officiis consequuntur eaque mollitia unde, inventore optio eligendi dolorem ipsum voluptatum, temporibus veniam, debitis accusamus sapiente blanditiis assumenda minus perspiciatis! Libero dignissimos asperiores cum impedit ad neque nobis dolor atque quibusdam suscipit quaerat non ducimus incidunt minima cumque enim ipsa corrupti facilis odit, maxime deleniti id quae labore. Cumque eaque quasi recusandae unde, vero at! Hic repudiandae sed amet saepe illo eius sint at, voluptates porro expedita debitis illum. Consequatur, asperiores ratione eos, quod tempore, obcaecati aspernatur voluptates alias commodi dignissimos nihil ut voluptas excepturi nulla ea eaque accusamus quidem perspiciatis consectetur rerum provident deleniti sed? Dolorem.</p>
		</article>
	</section>
</main>
<div class="svgs">
	<svg xmlns="http://www.w3.org/2000/svg">
		<filter id="dropshadow" height="130%">
  <feGaussianBlur in="SourceAlpha" stdDeviation="3"/> <!-- stdDeviation is how much to blur -->
  <feOffset dx="2" dy="2" result="offsetblur"/> <!-- how much to offset -->
  <feComponentTransfer>
    <feFuncA type="linear" slope="0.5"/> <!-- slope is the opacity of the shadow -->
  </feComponentTransfer>
  <feMerge> 
    <feMergeNode/> <!-- this contains the offset blurred image -->
    <feMergeNode in="SourceGraphic"/> <!-- this contains the element that the filter is applied to -->
  </feMerge>
</filter>
		<symbol id="icon-menu" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-ccw">
	<polyline points="20,8.5 15.5,8.5 15.5,4 "/>
	<path d="M4.062,3.969c0,16.031,0.021,15.969,15.969,15.969"/>
	<path d="M9.688,4c0,10.292,0.021,10.312,10.312,10.312"/>
		</symbol>
		<symbol id="icon-tags" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-ccw">
			<line x1="17.327" y1="0" x2="24.303" y2="6.975"/>
			<line x1="8.849" y1="0" x2="23.966" y2="15.117"/>
			<line x1="0" y1="0" x2="23.943" y2="23.943"/>
		</symbol>
		<symbol id="icon-close" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-ccw" style="filter: drop-shadow(1px 1px 0 rgba(0,0,0,.5));">
	<line x1="4.442" y1="4.442" x2="19.558" y2="19.558"/>
	<line x1="4.442" y1="19.558" x2="19.558" y2="4.442"/>
		</symbol>
</svg>

</div>
              
            
!

CSS

              
                // vars

$random_color: rgba(rd(255),rd(255),rd(255),.5);

$c: ( // colors
	t: rgba(0,0,0,0),
	s: #000,
	w: #fff,
	gr: desaturate(rgb(rd(255),rd(255),rd(255)), 100%),
	r: rgb(rd(255),rd(150),rd(150)),
	g: rgb(rd(150),rd(255),rd(150)),
	b: rgb(rd(150),rd(150),rd(255)),
	bg: darken($random_color, 35%),
	cp: ( // color palette
		1: #41444b,
		2: #52575d,
		3: #cabfab,
		4: #dfd8c8,
		5: #5d5d5d,
		6: #F0AE2C,
		7: #F9D00F,
		8: #00adb5
	),
);

// settings
$f: unquote("'Podkova', serif");
$fb: unquote("'Trebuchet MS', Helvetica, sans-serif");
$fz: 16px;
// uncomment for responsive font-size
// $fz: unquote('calc(1.1vw + 1.1vh - .6vmin)');
// @media screen and (max-width: 600px) {
// 	body > * {
// 		font-size: 1.5em;
// 	}
// }

$time: .5s;

$theease: overshot;


// ease():
// default, in-cubic, out-cubic, in-out-cubic, in-circ, out-circ, in-out-circ, in-expo, out-expo, in-out-expo, in-quad, out-quad, in-out-quad, in-quart, out-quart, in-out-quart, in-quint, out-quint, in-out-quint, in-sine, out-sine, in-out-sine, in-back, out-back, in-out-back, liquid", bounce, in-out-bounce, perpetuum, impetus, full-circle, gravity, overshot, downhill, pendulum, wtf, swing
// --------- defaults ---------
* {
	&:focus {
		outline: 0;
	}
	
	&, &:before, &:after {
		box-sizing: border-box;
	}
}

// touch cursor effect
@media screen and (max-width: 64em) {
	*:active {
		cursor: url(https://i.imgur.com/0vIPd79.png) 16 12, auto;
	}
}
// @include placeholder(){
// 		font-family: $f;
// }
// --------------------
html {
	body {
		font-family: $f;
		font-size: $fz;
		color: clr(w);
		background-color: clr(cp, 5);
		min-height: 100vh;
		width: 100vw;
	}
	
	&, body {
		// overflow: hidden;
	}
}

.svgs {
	display: none;
}

.main {
	display: flex;
	width: 100vw;
	min-height: 100vh;
}

.sect {
	width: 100%;
	transition: all $time;
	background-color: clr(cp, 1);
	background-image: linear-gradient(
				to bottom right,
				clr(t) 0%,
				rgba(clr(cp, 8), .125) 100%
	);
	display: flex;
	justify-content: space-around;
	padding: 5em 3em;
	transform-origin: center 25vh;
	box-shadow: 0 0 10em 1em rgba(clr(s), .25);
	
	.art {
		max-width: 64em;
	}
	
	h1 {
		font-size: 2rem;
		margin-bottom: 0.5em;
	}
	
	p {
		max-width: 32rem;
		font-size: 1.2em;
		line-height: 1.3;
		margin: 1em 0;
	}
}

.menu-button {
	&::-webkit-details-marker {
		display: none;
	}
	list-style: none;
	color: clr(w);
	position: fixed;
	right: 0;
	top: 0;
	z-index: 1;
	transition: right $time*.5 ease($theease),
					background $time/3 ease($theease);
	
	&:after {
		content: '';
		width: 100vw;
		height: 100vh;
		position: absolute;
		right: 0;
		top: 0;
		z-index: -1;
		background-color: rgba(clr(s), .5);
		opacity: 0;
		pointer-events: none;
		transition: opacity $time ease($theease);
	}
	
	.icon {
		border-radius: 0 0 0 0;
		width: 3em;
		height: 3em;
		padding: 0.5em;
		position: relative;
		z-index: 1;
		color: clr(cp, 8);
		overflow: hidden;
		// box-shadow: inset 0 0 0 0 clr(cp, 2);
		background-image: radial-gradient(
			circle at center,
			clr(cp, 2),
			clr(cp, 2) 50%,
			clr(t) 50.1%,
			clr(t)
			);
		background-repeat: no-repeat;
		background-size: 0%;
		background-position: 50% 50%;
		transition: transform $time ease($theease),
						 border-radius $time ease($theease),
						 background-size $time ease($theease);
			
		
		use {
			transition: opacity $time ease($theease);
		}
		[open] {
			opacity: 0;
		}
		[closed] {
			opacity: 1;
		}
	}
}


.menu-list {
	width: 250px;
	max-width: 0;
	height: 100vh;
	background-color: clr(cp, 2);
	padding: 1em 2em;
	overflow: hidden;
	transition: all $time;
	box-shadow: -1em 0 2em rgba(clr(s), .25);
	animation: reveal $time ease($theease) 1 reverse;
	font-size: 1.25em;
	
	.item {
		white-space: nowrap;
		line-height: 1.3;
		
		&.title {
			font-size: 1.3em;
			color: clr(cp, 3);
			margin-bottom: .5em;
		}
	}
}

.menu {
	position: fixed;
	right: 0;
	z-index: 10;
	
	&[open] {
		
		+ .sect {
			transform: translateX(-10%) scale(.75);
			// width: 75vw;
			pointer-events: none;
			user-select: none;
			
		}
		
		.menu-list {
			animation: reveal $time ease($theease) 1 forwards;
		}
		
		.menu-button {
			right: 250px; 
			transition: right $time*.8,
							background $time/3 ease($theease);
			
		&:after {
			opacity: 1;
			pointer-events: all;
		}
			
			.icon {
				transform: rotate(180deg);
				// box-shadow: inset 0 0 0 1.5em clr(cp, 2);
				background-size: 300%;
				border-radius: 0 1em 0 0;
				transition: transform $time ease($theease),
								 border-radius $time ease($theease),
								 background-size $time/2 $time/2 ease($theease);
				
				[open] {
					opacity: 1;
				}
				[closed] {
					opacity: 0;
				}
			}
		}
	}
}

@keyframes reveal {
	to {
		max-width: 250px;
	}
}


              
            
!

JS

              
                
              
            
!
999px

Console