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

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

              
                - 5.times do
	%details{onclick: "closeAll(this.parentNode);"}
		%summary Look under me
		%h1 Hello, you! 
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Lato:400,900|Open+Sans:400,800')

body
	min-height: 100vh
	padding: 10vh 0
	box-sizing: border-box
	background: #440099
	display: flex
	justify-content: flex-start
	flex-direction: column
	counter-reset: section
	font-family: 'Open Sans', sans-serif
	font-weight: 800
	overflow-x: hidden
	
details
	max-width: 800px
	width: 100%
	padding: 0 30px
	margin: 0 auto
	box-sizing: border-box
	
summary
	position: relative
	font-size: 56px
	outline: 0
	overflow: hidden
	cursor: crosshair
	transition: all .1s ease-out
	clip-path: polygon(25px 0%, 100% 0%, calc(100% - 25px) 100%, 0% 100%)
	background: #FEDD00
	padding: 20px 15px 18px 35px
	font-size: 2em
	font-family: "Lato", sans-serif
	font-weight: bold
	color: #333
	text-transform: uppercase
	margin: 0 0 15px
	list-style-type: none
	&::marker
		display: none
	&::-webkit-details-marker
		display: none
	&:hover
		text-indent: 30px
		&:before
			text-indent: -10px
	&:before
		counter-increment: section
		content: counter(section)
		position: absolute
		color: rgba(#000, .5)
		left: 2%
		top: -30px
		font-size: 112px
		font-family: 'Open Sans', sans-serif
		font-weight: 800
		transition: all .1s ease-out
		mix-blend-mode: overlay
	&:after
		content: '+'
		position: absolute
		font-size: 1.5em
		right: 35px
		top: 50%
		color: #000
		line-height: 0
		transform: translatey(-50%)
		mix-blend-mode: overlay

details[open] 
	summary
		text-indent: 30px
		&:before
			text-indent: -10px
		&:after
			content: "–"

details[open] summary ~ *
	animation: animationRotate .4s ease-out forwards
	color: white

@keyframes animationRotate
	from
		opacity: 0
	to
		opacity: 1
		transform: translatex(50%)
	
              
            
!

JS

              
                const closeAll = (openDetails) => {
  let list = document.querySelectorAll("details")
	for (var item of list)
    if(item != openDetails)
			item.removeAttribute("open")
}
              
            
!
999px

Console