Pen Settings



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


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


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.


Auto Save

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.


				| Horizontal Offset: 
				span#horizontal-label 0px
			input#horizontal(type='range', name='horizontal', min='-50', max='50', step='1', value='0')
				| Vertical Offset: 
				span#vertical-label 0px
			input#vertical(type='range', name='vertical', min='-50', max='50', step='1', value='0')
				| Expansion: 
				span#expansion-label 0px
			input#expansion(type='range', name='expansion', min='-50', max='50', step='1', value='0')
				| Blur: 
				span#blur-label 4px
			input#blur(type='range', name='blur', min='0', max='100', step='1', value='4')
				| Opacity: 
				span#opacity-label 0.3
			input#opacity(type='range', name='opacity', min='0', max='1', step='0.01', value='0.3')
			label(for='bgc') Background:
			input#bgc(type="color", name='bgc', value='#c8c8c8')
			label(for='shc') Shadow:
			input#shc(type="color", name='shc', value='#000000')


                @import url(",400i,700")

	box-sizing: border-box

html, body
	padding: 0
	margin: 0
	font-family: 'Roboto'

html, body, #app
	width: 100%
	height: 100%

	display: grid
	grid-template: 75vh auto / 1fr

	background-color: rgb(239, 239, 239)
	height: 75vh
	box-shadow: inset 0 0 50px rgba(#000, .25)
	position: relative

		background-color: #fff
		width: 300px
		height: 300px
		border-radius: 12px
		// centering
		position: absolute	
		top: 50%
		left: 50%
		transform: translate(-50%, -50%)
	padding: 8px
	display: grid
	grid-template: repeat(3, 1fr) / repeat(2, 1fr)
	text-align: center
	padding: 4px
	position: relative
	top: 50%
	transform: translatey(-50%)

		display: block
		text-transform: uppercase
		font-size: 13px
		font-weight: bold
		letter-spacing: 0.5px
		color: rgba(0, 0, 0, .8)
	display: grid
	grid-template: 1fr / 1fr 1fr



const app = document.querySelector('#app'),
			preview = document.querySelector('#preview'),
			box = document.querySelector('#box');

const h = document.querySelector('#horizontal'),
			v = document.querySelector('#vertical'),
			b = document.querySelector('#blur'),
			e = document.querySelector('#expansion'),
			o = document.querySelector('#opacity'),
			bg = document.querySelector('#bgc'),
			shc = document.querySelector('#shc');

function updateLabel(el) {
	let label = document.querySelector(`#${}-label`);
	label.innerText = != 'opacity' ? el.value + 'px' : el.value;

function rgb(hexc) {
	return hexc.match(/[A-Za-z0-9]{2}/g).map(function(v) { return parseInt(v, 16) }).join(",");

function sbs() {
	let shadow = `${h.value}px ${v.value}px ${b.value}px ${e.value}px rgba(${rgb(shc.value)}, ${o.value})`; = shadow;
}; sbs();

document.querySelectorAll('input').forEach(i => {
	i.onmousemove = (e) => { sbs(); updateLabel( };
	i.onchange = (e) => { sbs(); updateLabel( };

bgc.onchange = (e) => = bgc.value;