Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


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.


                - var n_rows = 10, n_cols = 15;
- var n_total = n_rows*n_cols;
- var n6gon = 6;

	while n_total--
		- var np6 = n6gon + 2;
			while np6--


                @import 'compass/css3';

$l6gon: 2em; // hexagon edge
$n6gon: 6; // number of hexagon edges
$ca6gon: 360deg/$n6gon;
$a6gon: ($n6gon - 2)*180deg/$n6gon; // hex ang
$dl6gon: 2*$l6gon; // large diagonal of hex
$ds6gon: 2*$l6gon*sin(.5*$a6gon); // small diag
$ri6gon: $l6gon*.5/tan(.5*$ca6gon);

$prism6h: .5*$l6gon;

$sa: abs($a6gon - 90deg); // skew angle
$sf: cos($sa);
$nrows: 10; // same as in Jade code
$ncols: 15; // same as in Jade code
$yunit: $dl6gon - .5*$l6gon;
$sw: ($ncols - 1.5)*$ds6gon;
$sh: $nrows*$yunit - .75*$dl6gon;
$t: 7s;

html { overflow: hidden; } // Edge scrollbar
body { background: #000; }

div { position: absolute; }

.scene {
	overflow: hidden;
	top: 50%; left: 50%;
	width: $sw; height: $sh;
	transform: translate(-50%, -50%);

.prism6 {
	transform-style: preserve-3d;
	animation: a $t ease-in-out infinite;
	@for $col from 0 to $ncols {
		&:nth-child(#{$ncols}n + #{$col + 1}) {
			animation-delay: $col*$t/$ncols;
	@for $row from 0 to $nrows {
		$y: $row*$yunit;
		$i: $row%2;
		@for $col from 0 to $ncols {
			$x: ($col - .5*$i)*$ds6gon;
			$idx: $row*$ncols + $col + 1;
			&:nth-child(#{$idx}) { margin: $y $x; }
	&__face {
		backface-visibility: hidden;
		background: currentColor;
		color: #bbb;
		&:nth-child(#{.5*$n6gon}n + 1) {
			color: #fff;
		&:nth-child(-n + #{$n6gon}) {
			margin: -$prism6h (-.5*$prism6h);
			height: $l6gon; width: $prism6h;
		@for $i from 0 to $n6gon {
			&:nth-child(#{$i + 1}) {
				transform: rotate($i*$ca6gon) 
					translate($ri6gon) rotateY(90deg);
		&:nth-child(n + #{$n6gon + 1}) {
			margin: -$l6gon;
			width: $dl6gon; height: $dl6gon;
				translateZ(.5*$prism6h) rotate(90deg) 
				skewX($sa) scaleY($sf);
			background: linear-gradient(-45deg, 
					transparent 25%, currentColor 0, 
					currentColor 75%, transparent 0);
			color: #ddd
		&:last-child {
			transform: rotateY(.5turn)
				translateZ(.5*$prism6h) rotate(90deg) 
				skewX($sa) scaleY($sf);

@keyframes a {
	#{800%/$ncols}, 100% {
		transform: perspective(40em)