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

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.

HTML

              
                - var d = 2000, o = -.5*d;
- var w = .8*d, h = .1*w;
- var x = .5*(d - w), y = .5*h;
- var sw = .005*d, fs = .07*d;
- var na = Math.round(.0625*fs), pa = .2*h;

svg(viewBox=[-d, o, 2*d, d].join(' ')
		xmlns='http://www.w3.org/2000/svg' 
		xmlns:xlink='http://www.w3.org/1999/xlink')
	style
		| svg > [d], g > [d] {
		| 	fill: none;
		| 	stroke: #ccc;
		| 	stroke-width: #{sw}
		| }
		| [x] {
		| 	fill: #777;
		| 	font: #{fs}px trebuchet ms, verdana, sans-serif
		| }
		| [id], #s ~ * { fill: #333 }
		| #s ~ * { font: 700 #{fs}px courier new, monospace }
		| [d*=v] + [d] { stroke: #95a }
		| #t { stroke: none; fill: url(#p) }
		| #t + * { stroke: #b53 }
		| #t + * ~ * {
		| 	stroke: #333;
		| 	marker-start: url(#s);
		| 	marker-end: url(#e)
		| }
		| #g ~ * {
		| 	fill: #95a;
		| 	font: #{fs}px comic sans ms, noteworthy, dancing script ot, ubuntu, cursive
		| }
		| #g ~ use ~ *, #p { fill: #b53 }
	text(x=x - d y=o + x) INITIAL
	text(x=x y=o + x) FINAL
	pattern#p(width=pa height=pa patternUnits='userSpaceOnUse')
		path(d=`M${.25*pa} 0H0v${.25*pa}
						M0 ${.75*pa}v${.25*pa}h${.25*pa}l${.75*pa}-${.75*pa}V0H${.75*pa}
						M${.75*pa} ${pa}h${.25*pa}V${.75*pa}`)
	marker#s(markerWidth=na markerHeight=na 
						viewBox='-8 -4 8 8' orient='auto' refX='-7')
		path(d='M-8 0 0-4V4')
	text(x=w + x - h + .3*fs y=1.7*h) k
	text(x=h - w - x - .9*fs y=-1.3*h) k
	marker#e(markerWidth=na markerHeight=na 
					 viewBox='0 -4 8 8' orient='auto' refX='7')
		path(d='M8 0 0-4V4')
	text(x=.5*w + x - .3*fs y=3.7*h) 1
	text(x=-.2*fs - .5*w - x y=-3.2*h) 1
	g#g
		path(d=`M${x} 0v${3.5*h}
						M${w + x} 0v${3.5*h}
						M${w + x - h} 0v${2*h}`)
		path(d=`M${x}${-y}h${w}V${y}H${x}z
						M${.5*w - .25*h} ${-h}
						q${.25*h} ${.8*h} ${.5*h} 0
						M${.5*w}${-.75*h}q0${-h} ${-.5*h}${-2*h}`)
		path#t(d=`M${w + x - h}${-y}h${h}V${y}h${-h}z`)
		path(d=`M${w + x - .75*h} ${-h}
							q${.25*h} ${.8*h} ${.5*h} 0
							M${w + x - .5*h}${-.75*h}q0${-h} ${-.5*h}${-2*h}`)
		path(d=`M${w + x} ${1.5*h}h${.8*h}
						M${w + x - 1.8*h} ${1.5*h}h${.8*h}`)
		path(d=`M${x} ${3*h}h${w}`)
	text(x=.5*w - 1.5*h y=-3*h) input
	text(x=-(.5*w + .5*h) y=3*h + .8*fs) input
	use(xlink:href='#g' transform='scale(-1)')
	text(x=w - h y=-3*h) thumb
	text(x=-(w + 1.5*h) y=3*h + .8*fs) thumb

// minimal SVG
<svg viewBox='-2000 -1000 4000 2000' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><style>svg>[d],g>[d]{fill:none;stroke:#ccc;stroke-width:10}[x]{fill:#777;font:140px trebuchet ms,verdana,sans-serif}[id],#s~*{fill:#333}#s~*{font:700 140px courier new,monospace}[d*=v]+[d]{stroke:#95a}#t{stroke:none;fill:url(#p)}#t+*{stroke:#b53}#t+*~*{stroke:#333;marker-start:url(#s);marker-end:url(#e)}#g~*{fill:#95a;font:140px comic sans ms,noteworthy,dancing script ot,ubuntu,cursive}#g~use~*,#p{fill:#b53}</style><text x='-1800' y='-800'>INITIAL</text><text x='200' y='-800'>FINAL</text><pattern id='p' width='32' height='32' patternUnits='userSpaceOnUse'><path d='M8 0H0v8M0 24v8h8l24-24V0H24M24 32h8V24'/></pattern><marker id='s' markerWidth='9' markerHeight='9' viewBox='-8 -4 8 8' orient='auto' refX='-7'><path d='M-8 0 0-4V4'/></marker><text x='1682' y='272'>k</text><text x='-1766' y='-208'>k</text><marker id='e' markerWidth='9' markerHeight='9' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><text x='958' y='592'>1</text><text x='-1028' y='-512'>1</text><g id='g'><path d='M200 0v560M1800 0v560M1640 0v320'/><path d='M200-80h1600V80H200zM760-160q40 128 80 0M800-120q0-160-80-320'/><path id='t' d='M1640-80h160V80h-160z'/><path d='M1680-160q40 128 80 0M1720-120q0-160-80-320'/><path d='M1800 240h128M1512 240h128'/><path d='M200 480h1600'/></g><text x='560' y='-480'>input</text><text x='-880' y='592'>input</text><use xlink:href='#g' transform='scale(-1)'/><text x='1440' y='-480'>thumb</text><text x='-1840' y='592'>thumb</text></svg>
              
            
!

CSS

              
                body {
	display: flex;
	flex-direction: column;
	margin: 0;
	height: 100vh;
}
              
            
!

JS

              
                
              
            
!
999px

Console