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

              
                ul.grid
	each color in ['blue', 'green', 'red', 'yellow']
		each size in ['small', 'large']
			li.cell(class='is-' + size + ' is-' + color)
              
            
!

CSS

              
                body
	display flex
	justify-content center
	align-items center
	min-height 100vh
	background-size 300px
	background-repeat no-repeat

.grid
	animation spin 2.5s cubic-bezier(0.5, 0, 0.5, 1) infinite
	display grid
	grid-gap 20px
	grid-template-columns repeat(4, 1fr)
	grid-template-rows repeat(4, 1fr)
	width 300px
	height @width	
	grid-template-areas ". blue-small green-large ." "blue-large blue-large green-large green-small" "red-small red-large yellow-large yellow-large" ". red-large yellow-small ."
	
colors = {
	'blue': #6ecadc
  'green': #3eb991
  'red': #e01563
	'yellow': #e9a820
}
sizes = small, large

.cell
	align-items end
	justify-content end
	display flex
	&::before
		content ''
		display block
		width 100%
		height @width
		border-radius 100px
	
	&.is-large::before
		animation widen 2.5s cubic-bezier(0.5, 0, 0.5, 1) infinite

	for name, color in colors
		for size in sizes
			&.is-{name}::before
				background: color

			&.is-{name}.is-{size}
				grid-area unquote(name + '-' + size)
				
				&::before
					if size == small
						animation fade 2.5s cubic-bezier(0.5, 0, 0.5, 1) infinite

						if name == 'blue'
							border-bottom-right-radius 0
						else if name == 'green'
							border-bottom-left-radius 0
						else if name == 'red'
							border-top-right-radius 0
						else if name == 'yellow'
							border-top-left-radius 0

					else
						if name == 'blue'
							animation-name widen-w
							margin-right auto
						else if name == 'green'
							animation-name widen-h
							margin-bottom auto
						else if name == 'red'
							animation-name widen-h
							margin-top auto
						else if name == 'yellow'
							animation-name widen-w
							margin-left auto

@keyframes spin
	0%
		transform rotate(0)
	100%
		transform rotate(720deg)

@keyframes widen-w
	0%, 100%
		width 100%
	50%, 70%
		width 60px

@keyframes widen-h
	0%, 100%
		height 100%
	50%, 70%
		height 60px

@keyframes fade
	0%, 100%
		transform scale(1)
	50%, 70%
		transform scale(0)
		
              
            
!

JS

              
                
              
            
!
999px

Console