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

              
                <main>
	<header>
		<h1>Individual CSS Transform Properties Demo</h1>
	</header>
	<div class="warning">
		<p>⚠️ Your browser does not support <a href="https://drafts.csswg.org/css-transforms-2/#individual-transforms">Individual CSS Transform Properties</a> so this demo won't work properly. Please try Firefox 72 or Safari 14.1 or Chrome 104</p>
	</div>
	<div class="demowrapper">
		<div class="blockwrapper">
			<div class="block">no transform</div>
		</div>
		<div class="blockwrapper">
			<div class="block transform--legacy">legacy<br />(for reference)</div>
		</div>
		<div class="blockwrapper">
			<div class="block transform--individual">individual</div>
		</div>
		<div class="blockwrapper">
			<div class="block transform--transition">individual + transition</div>
		</div>
		<div class="blockwrapper">
			<div class="block transform--animation">individual + animation</div>
		</div>
	</div>
	<!--
	<footer>
		<p><em><a href="https://www.bram.us/2020/01/09/firefox-72-individual-transform-properties/">https://www.bram.us/2020/01/09/firefox-72-individual-transform-properties/</a></em></p>
	</footer>
	-->
</main>
              
            
!

CSS

              
                /** legacy CSS transform **/
.transform--legacy {
	transform: translateX(50%) rotate(30deg) scale(1.2);
}

/** Individual CSS transform properties **/
.transform--individual {
	scale: 1.2;
	rotate: 30deg;
	translate: 50% 0;
}

/** Individual CSS transform properties + transition **/
.transform--transition {
	transition: rotate 200ms ease-in-out, scale 500ms linear;
}
.transform--transition:hover {
	scale: 1.2;
	rotate: 30deg;
	translate: 50% 0;
}

/** Individual CSS transform properties + animation **/
@keyframes anim {
	25% {
		translate: 50% 0;
	}
	50% {
		rotate: 30deg;
	}
	75% {
		scale: 1.2;
	}
}

.transform--animation {
	animation: anim 3s alternate infinite;
}

/** show a warning in browers that don't support it **/
.warning {
	padding: 1em;
	border: 1px solid #ccc;
}

.warning p {
	margin: 0;
	padding: 0;
}

@supports (scale: 1) {
	.warning {
		display: none;
	}
}

/** default block styles **/

* {
	display: border-box;
}

body, .demowrapper {
	display: flex;
	justify-content: center;
	align-items: center;
}

.demowrapper {
	flex-direction: column;	
}

header, footer {
	text-align: center;
}

.blockwrapper {
	width: 10em;
	height: 10em;
	border-radius: 0.5em;
	margin: 4em;
	border: 0.2em dotted lightblue;
	text-align: center;
}

.block {
	width: 10em;
	height: 10em;
	border-radius: 0.5em;
	background: #ccc;
	border: 1px solid #666;

	opacity: 0.6;

	display: flex;
	align-items: center;
	justify-content: center;
}

              
            
!

JS

              
                
              
            
!
999px

Console