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

              
                - var url = 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/2017/17_05_a_amur_leopard_25.jpg';
- var data = { add: 'source-over', subtract: 'source-out', intersect: 'source-in', exclude: 'xor' }

pre
	span.token--decl
		span.token--prop --l0
		span.token--punc :
		span.token--val
			span.token--func repeating-linear-gradient
			span.token--punc (
			span.token--args
				span.token--arg
					span.token--ang
						span.token--num 90
						span.token--unit deg
				span.token--punc ,
				span.token--arg.break1
					span.token--keyw red
				span.token--punc ,
				span.token--arg
					span.token--keyw red
					|  
					span.token--pos
						span.token--num 1
						span.token--unit em
				span.token--punc ,
				span.token--arg.break2
					span.token--keyw transparent
					|  
					span.token--pos
						span.token--num 0
				span.token--punc ,
				span.token--arg
					span.token--keyw transparent
					|  
					span.token--pos
						span.token--num 4
						span.token--unit em
			span.token--punc )
		span.token--punc ;
	span.token--decl
		span.token--prop --l1
		span.token--punc :
		span.yoken--val
			span.token--func linear-gradient
			span.token--punc (
			span.token--args
				span.token--arg
					span.token--keyw red
				span.token--punc ,
				span.token--arg
					span.token--keyw transparent
			span.token--punc )
		span.token.punc ;

section
	- for(var p in data)
		figure
			img(src=url)
			figcaption
				pre
					span.token--decl
						span.token--prop -webkit-mask
						span.token--punc :
						span.token--val
							span.token--func var
							span.token--punc (
							span.token--arg
								span.token--prop --l1
							span.token--punc )
							span.token--punc ,
							span.token--func var
							span.token--punc (
							span.token--arg
								span.token--prop --l0
							span.token--punc )
						span.token--punc ;
					span.token--decl
						span.token--prop -webkit-mask-composite
						span.token--punc :
						span.token--val
							span.token--keyw #{data[p]}
						span.token--punc ;
					span.token--decl
						span.token--prop mask
						span.token--punc :
						span.token--val
							span.token--func var
							span.token--punc (
							span.token--arg
								span.token--prop --l1
							span.token--punc )
							span.token--keyw #{p}
							span.token--punc ,
							span.token--func var
							span.token--punc (
							span.token--arg
								span.token--prop --l0
							span.token--punc )
						span.token--punc ;
              
            
!

CSS

              
                $n: 4;
$w: 21.75rem;
$g: .5rem;

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	overflow-x: hidden;
	min-width: 200px;
	background: repeating-linear-gradient(45deg, #ccf, #ccf 2px, transparent 0, transparent 10px) 50%/ 100vw 100vh fixed;
	
	@for $i from 1 to $n {
		@media (max-width: ($n - $i + 1)*$w + ($n - $i + 2)*$g) {
			--n: #{$n - $i}
		}
	}
	
	@at-root {
		@media (max-width: 795px) {
			.break1:before { content: '\A        ' }
		}

		@media (max-width: 505px) {
			.break2:before { content: '\A        ' }
		}
	}
	
	@media (max-width: 350px) { --w: 100% }
}

body {
	font: 1.25em/ 1.5 consolas, monaco, monospace;
	
	@media (max-width: 390px) {
		font-size: 1em
	}
	
	@media (max-width: 310px) {
		font-size: .875em
	}
	
	@media (max-width: 270px) {
		font-size: .75em
	}
	
	@media (max-width: 235px) {
		font-size: .625em
	}
}

pre {
	padding: 1vmin;
	background: #262626;
	color: #ddd
}

.token {
	&--decl { display: block }
	
	&--func { color: #d285de }

	&--prop { color: #ff96aa }

	&--ang { color: #66c7ff }

	&--keyw, &--val { color: #ffeb66 }

	&--pos { color: #85edb0 }
	
	&--func, :not(:first-child) > &--keyw {
		&:before { content: ' ' }
	}
}

section {
	display: grid;
	place-content: center;
	grid-template-columns: repeat(var(--n, #{$n}), var(--w, #{$w}));
	grid-gap: $g;
	margin-top: .5em;
}

img {
	display: block;
	width: 100%
}
              
            
!

JS

              
                const _S = document.createElement('style'), 
			IND = [];

[...document.querySelectorAll('figcaption')].forEach((c, i) => {
	IND.push(`:nth-child(${i + 1}) > img { ${c.textContent} }`)
});

_S.textContent = `:root { ${document.querySelector('body > pre').textContent} }${IND.join('')}`;

document.body.appendChild(_S)
              
            
!
999px

Console