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.


                - 3.times do
			- 6.times do

	Everything is the same for these three scenes and objects they contain except the <code>height</code> of the scene. But since the <code>y</code> component of the <code>perspective-origin</code> is measured from the top of the scene and each cube is positioned right in the middle of its scene, our point of view is different for different scene heights so the way we see a cube depends on the <code>height</code> of the scene it is in.


                @import 'compass/css3';

$l: 6.5em;

.scene {
	margin: 1em;
	width: 30vw;
	display: inline-block;
	position: relative;
	perspective: 32em;
	perspective-origin: 50% 10%;
	box-shadow: 0 0 1px #222;
	vertical-align: middle;
	@for $i from 0 to 3 {
		&:nth-child(#{$i + 1}) {
			height: ($i + 1)*30vh;
	* {
		position: absolute;
		top: 50%; left: 50%;

.cube {
	transform-style: preserve-3d;
	transform: rotateY(30deg);
	&__face {
		margin: -.5*$l;
		width: $l; height: $l;
		box-shadow: inset 0 0 1px #222;
		background: rgba(#e18728, .32);
		@for $i from 0 to 6 {
			&:nth-child(#{$i + 1}) {
				transform: if($i < 4, rotateY($i*90deg), rotateX(pow(-1, $i)*90deg))

.inf {
	position: fixed;
	top: 0; left: 0;
	padding: .5em;
	width: 63vw;
	background: #be4c39;
	color: #eee;
	font: 1.25em/1.5 verdana, sans-serif;

code {
	color: lemonchiffon;
	font: 1.375em/1.09 monospace;