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

              
                <form>
	<input id="one" type="radio" name="radios" value="one">
	<input id="two" type="radio" name="radios" value="two">
	<input id="three" type="radio" name="radios" value="three">
	<input id="four" type="radio" name="radios" value="four">
	<span></span>
	<label for="one">One</label>
	<label for="two">Two</label>
	<label for="three">Three</label>
	<label for="four">Four</label>
</form>
              
            
!

CSS

              
                $lightBg: "https://assets.codepen.io/416221/light_wood.jpeg"
$darkBg: "https://assets.codepen.io/416221/dark_wood.jpeg"
$dur: 0.5s

*
	border: 0
	box-sizing: border-box
	margin: 0
	padding: 0
\:root
	font-size: calc(32px + (40 - 32)*(100vw - 320px)/ (1024 - 320))
body
	background:
		image: url($lightBg)
		position: 50% 50%
	color: #381803
	display: flex
	font: 1em Nunito, sans-serif
	height: 100vh
	line-height: 1.5
form
	margin: auto
	max-width: 10em
	padding: 1.5em 0
	position: relative
	label:before, span:before
		border-radius: 50%
		content: ""
	label
		cursor: pointer
		display: flex
		letter-spacing: 0.1em
		text-transform: uppercase
		&:before
			background: radial-gradient(100% 100% at 33% 33%,rgba(0,0,0,0.25) 25%,rgba(0,0,0,0) 50%), radial-gradient(100% 100% at 67% 67%,rgba(255,255,255,0.15),rgba(255,255,255,0) 50%)
			box-shadow: 0 0 0.75em #000 inset
			display: inline-block
			margin-right: 0.375em
			width: 1.5em
			height: 1.5em
		&:not(:last-of-type)
			margin-bottom: 1.5em
	span
		position: absolute
		top: 1.75em
		left: 0.25em
		width: 1em
		height: 1em
		transition: transform $dur/2 linear
		z-index: 1
		&, &:before
			display: block
		&:before
			background:
				color: #2762f3
				image: radial-gradient(10% 10% at 50% 50%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0)), radial-gradient(12% 12% at 60% 25%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0)), radial-gradient(100% 100% at 60% 50%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.25) 50%)
			border-radius: 50%
			box-shadow: 0 0.1em 0.1em 0 rgba(0,0,0,0.5), 0 0 0.1em 0.1em rgba(0,0,0,0.25) inset
			width: 100%
			height: 100%

input
	position: fixed
	top: -1.5em
	left: -1.5em

@for $s from 1 through 4
	$yPos: 3em * ($s - 1)
	input:nth-of-type(#{$s}):checked ~ span
		transform: translateY($yPos)
		&:before
			animation: wobble#{$s} $dur linear forwards
	@keyframes wobble#{$s}
		from, to
			transform: translateY(0) scale(1)
		25%
			transform: translateY(0) scale(1.33)
		50%
			transform: translateY(0.25em) scale(1)
		67%
			transform: translateY(-0.15em) scale(1)
		83%
			transform: translateY(0.07em) scale(1)

/* Dark mode */
@media screen and (prefers-color-scheme: dark)
	body
		background:
			image: url($darkBg)
		color: #c58b50
              
            
!

JS

              
                
              
            
!
999px

Console