css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              .container
	.title-container
		h1.title.code &lt;details&gt; &amp; &lt;summary&gt;
		
	.card-list
		.card
			h3.card-title.code.code-details &lt;details&gt;
			p.card-description works like an accordian - but without the need for script, supported by most major browsers (except IE & Edge)

		.card
			h3.card-title.code.code-summary &lt;summary&gt;
			p.card-description To customize the title of 
				span.code &lt;details&gt;
				|  tag (of which would fallback to 'details' in most cases)

	.sample
		.sample-title code
		.sample-code
			.code 
				span.code-details &lt;details&gt;
				br
				| &nbsp;&nbsp;
				span.code-summary &lt;summary&gt;
				br
				| &nbsp;&nbsp;&nbsp;&nbsp;What did the cat says when the mouse got away?
				br
				| &nbsp;&nbsp;
				span.code-summary &lt;/summary&gt;
				br
				| &nbsp;&nbsp;You have got to be kitten me!
				br
				span.code-details &lt;/details&gt;

		.sample-title output
		.sample-html
			details.sample-html-details
				summary.sample-html-summary What did the cat says when the mouse got away?
				.speech You have got to be kitten me!
	
            
          
!
            
              $purple: #9796F0
$purple-dark: #783F8E
$pink: #FBC7D4
$pink-hot: #E36588
$green-pale: #E4F0D0
$grey: #738290
$rice: #FFFCF7
$white: #FFF
$pad: 20px
$ease-back: cubic-bezier(0.01, 0.29, 0.38, 2.37)

@mixin mobile
	@media (max-width: 500px)
		@content
	
.container
	padding: 0 $pad
	max-width: 800px
	margin: 0 auto

.title
	font-size: 3rem
	display: inline-block
	color: $purple
	background: linear-gradient(to right, $purple-dark, $purple 20%, $pink, $pink-hot)
	-webkit-background-clip: text
	-webkit-text-fill-color: transparent
	
.card
	border-radius: 10px
	background: $white
	padding: $pad
	box-shadow: 4px 4px 12px 1px rgba(0, 0, 0, 0.2)
	line-height: 1.5

	& + &
		margin-left: $pad

	&-list
		display: flex
		flex: 1
	
	&-title
		margin: 0 0 $pad 0
		letter-spacing: 1px
	
	&-description
		margin: 0
	
	&-details
		.card-title
			color: $purple-dark
	
	&-summary
		.card-title
			color: $pink-hot
	
	@include mobile
		flex: 1

.sample
	margin-top: $pad * 2
	border-radius: 10px
	overflow: hidden

	&-title
		line-height: 2
		font-size: 0.75rem
		background: $grey
		color: $white
		padding: 0 $pad
		letter-spacing: 1px 
	
		@extend .code

	&-code
		border-left: 2px dashed $green-pale
		border-right: 2px dashed $green-pale
		padding: $pad
		line-height: 1.5
	
	&-html
		padding: $pad
		background: $green-pale
	
		&-details
			&[open]
				.sample-html-summary:before
					content: '🙀'
					animation: cat 0.2s $ease-back

		&-summary
			list-style-image: none
			cursor: pointer
			padding-left: $pad * 3
			position: relative
	
			&:before
				content: '😼'
				position: absolute
				top: calc(50% - 18px)
				left: 0
				font-size: 2rem
	
			&:focus
				outline: none
	
			&::-webkit-details-marker
				display: none
			
	
.code
	font-family: 'Fira Mono', monospace

	&-details
		color: $purple-dark
	
	&-summary
		color: $pink-hot

.speech
	display: inline-block
	margin: $pad 0 0 7px
	padding: $pad
	background: $white
	border-radius: 0 10px 10px 10px
	position: relative
	animation: speech 0.3s $ease-back
	transform-origin: top left

	&:before
		content: ''
		position: absolute
		border: 8px solid transparent
		top: -16px
		left: 0
		border-bottom-color: $white
	
\:root
	font-size: 16px

html, body
	width: 100%
	height: 100%
	display: flex
	background: $rice
	color: $grey
	font-family: 'Roboto', sans-serif

*,
	box-sizing: border-box
	&:before, &:after
		box-sizing: inherit

@keyframes speech
	from
		opacity: 0
		transform: scale(0.98)
	to
		opacity: 1
		transform: none
	
@keyframes cat
	50%
		transform: scale(1.1)
            
          
!
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.
Loading ..................

Console