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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                mixin hex()
	- var base_angle = 2*Math.PI/6;
	- var pts_txt = '';
	- for(var i = 0; i < 6; i++) {
		- var curr_angle = (i - .5)*base_angle;
		- var x = .5*(1 + Math.cos(curr_angle)).toFixed(2);
		- var y = .5*(1 + Math.sin(curr_angle)).toFixed(2);
		- pts_txt += x + ',' + y + ' ';
	-}
	polygon(points=`${pts_txt.trim()}`)

svg
	defs
		clipPath#cp(clipPathUnits='objectBoundingBox')
			+hex()

div
	div
              
            
!

CSS

              
                $layer-width: 2em;
$max-width: 12*$layer-width;
$g1: conic-gradient(#c9c9c9 60deg, #999 60deg 180deg, #383838 180deg 300deg, #c9c9c9 300deg);
$g2: conic-gradient(#606060 120deg, #c1c1c1 120deg 240deg, #858585 240deg);

@mixin size($k: 1) {
	width: calc(100% - #{2*$k*$layer-width});
	height: calc(100% - #{2*$k*$layer-width});
}

html {
	background: #e4e4e4;
	
	&:after {
		position: absolute;
		top: 0; right: 0; bottom: 0; left: 0;
		background-image: url(http://www.transparenttextures.com/patterns/redox-01.png), 
			url(http://www.transparenttextures.com/patterns/redox-02.png), 
			url(http://www.transparenttextures.com/patterns/rice-paper-3.png);
		opacity: .4;
		content: ''
	}
}

div {
	&, &:before, &:after {
		position: absolute;
		top: 50%; left: 50%;
		transform: translate(-50%, -50%);
		-webkit-clip-path: url(#cp);
		clip-path: url(#cp);
	}
	
	width: $max-width; height: $max-width;
	
	&:before, &:after {
		z-index: -1;
		content: '';
	}
	
	&:before { @include size(); }
	&:after { @include size(2); }
	div { @include size(3); }
	&:before, div, div:after { background: $g1; }
	&:after, div:before { background: $g2; }
}
              
            
!

JS

              
                
              
            
!
999px

Console