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

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

              
                <meta name="viewport" content="width=device-width, initial-scale=1.0">

<div class="container">
	<h1>Checkboxes</h1>
	<div class="wrap">
		<div class="material-checkbox red">
			<input type="checkbox" id="cb1">
			<label for="cb1">Danger</label>
		</div>
	</div>
	<div class="wrap">
		<div class="material-checkbox green">
			<input type="checkbox" id="cb2">
			<label for="cb2">Success</label>
		</div>
	</div>
	<div class="wrap">
		<div class="material-checkbox blue">
			<input type="checkbox" id="cb3">
			<label for="cb3">Primary</label>
		</div>
	</div>
	<div class="wrap">
		<div class="material-checkbox yellow">
			<input type="checkbox" id="cb4">
			<label for="cb4">Warning</label>
		</div>
	</div>
	<div class="wrap">
		<div class="material-checkbox default">
			<input type="checkbox" id="cb5">
			<label for="cb5">Default</label>
		</div>
	</div>
</div>

<span id="credits">
	<i class="mdi mdi-xml"></i>
	with
	<i class="mdi mdi-heart"></i>
	by
	<a href="https://codepen.io/GuiCavi/" target="_blank">
		<i class="mdi mdi-codepen"></i>
	</a>
</span>

              
            
!

CSS

              
                @import compass

@import url(https://fonts.googleapis.com/css?family=RobotoDraft)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$red: #db4437
$blue: #4285f4
$yellow: #f4b400
$green: #0f9d58
$default: #e7e6dd
$color-theme: ("red": $red, "green": $green, "blue": $blue, "yellow": $yellow, "default": $default)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@mixin dim($width, $height:$width)
	width: $width
	height: $height
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@function unpack($shorthand)
	@if length($shorthand) == 1
		@return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1)
	@else if length($shorthand) == 2
		@return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 1) nth($shorthand, 2)
	@else if length($shorthand) == 3
		@return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 3) nth($shorthand, 2)
	@else
		@return $shorthand
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@mixin pos($position: relative, $coordinates: null null null null)
	@if type-of($position) == list
		$coordinates: $position
		$position: relative

	$coordinates: unpack($coordinates)

	$offsets: (top: nth($coordinates, 1), right: nth($coordinates, 2), bottom: nth($coordinates, 3), left: nth($coordinates, 4))

	position: $position

	@each $offset, $value in $offsets
		@if is-length($value)
			#{$offset}: $value
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
*
	+box-sizing(border-box)
	&:before, &:after
		+box-sizing(border-box)
		
html
	height: 100%

body
	min-height: 100%
	font-family: 'Roboto', sans-serif
	background-color: #123456
	display: flex
	align-items: center
	justify-content: center

svg[hidden]:not(:root)
	display: none
////////////////////////////////////////////////////////////////////////
//////////////////// MIXINS
////////////////////////////////////////////////////////////////////////
@mixin material-colors
	@each $theme, $color in $color-theme
		.material-checkbox.#{$theme}
			.circle
				background-color: $color
			.check
				border-color: $color
////////////////////////////////////////////////////////////////////////
//////////////////// MATERIAL-CHECKBOX
////////////////////////////////////////////////////////////////////////
.material-checkbox
	position: relative
	display: inline-block
	vertical-align: middle
	input[type='checkbox']
		display: none
		&:checked ~ label
			.box
				opacity: 0
				+transform(scale(0) rotate(-180deg))
			.check
				opacity: 1
				+transform(scale(1) rotate(45deg))
			.circle
				+animation(checkboxRipple .3s ease)
	label
		cursor: pointer
		padding-left: 50px
		span
			display: block
			+pos(absolute, null null null 0)
		.circle
			background-color: rgba(51,51,51,0.67)
			top: -30px
			left: -30px
			z-index: 890
			+dim(80px)
			+border-radius(50%)
			+transform(scale(0))
		.box
			border: 2px solid #000
			z-index: 891
			+dim(20px)
			+transition(all .3s ease)
		.check
			top: -7px
			left: 6px
			border: 2px solid #0f9d58
			border-top: none
			border-left: none
			opacity: 0
			z-index: 892
			+dim(12px,24px)
			+transform(rotate(180deg))		
			+transition(all .3s ease)
////////////////////////////////////////////////////////////////////////
//////////////////// KEYFRAMES
////////////////////////////////////////////////////////////////////////
+keyframes(checkboxRipple)	
	0%
		opacity: 0
		+transform(scale(0))
	50%
		opacity: 0.67
	75%
		opacity: 0.1
		+transform(scale(1))
	100%
		opacity: 0
////////////////////////////////////////////////////////////////////////
//////////////////// INVOICING MIXINS
////////////////////////////////////////////////////////////////////////
+material-colors()
////////////////////////////////////////////////////////////////////////
//////////////////// STYLING OTHERS ELEMENTS
////////////////////////////////////////////////////////////////////////
.container
	padding: 20px
	background-color: #343434
	width: 300px
	+box-shadow(0px 1px 2px #000)

h1
	text-align: center
	color: #f0f0f0
	font-weight: bold
	margin: 0 0 15px
	font-size: 26px
	letter-spacing: 3px

.material-checkbox
	margin: 20px 0
	label
		color: #f0f0f0
	
#credits
	+text-shadow(1px 1px 2px #222)
	position: fixed
	bottom: 10px
	right: 10px
	font-size: 14px
	line-height: 1.8
	color: #fff
	i.mdi
		font-size: 28px
		vertical-align: middle
		margin: 0 10px
		&.mdi-heart
			color: #FF432F
		&.mdi-codepen
			color: #2AE052
		&.mdi-xml
			color: #FFE02F
              
            
!

JS

              
                (function($) {	

	$.fn.materialCheckbox = function(options) {
		var $label = this.find('label[for]');
		this.each(function() {
			$('<span class="box" />').prependTo($label);
			$('<span class="check" />').prependTo($label);
			$('<span class="circle" />').prependTo($label);
		});
		
		return this;
	};
	
	$('.material-checkbox').materialCheckbox();

}(jQuery));
              
            
!
999px

Console