Pen Settings



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


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.


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.


                - var n = 8, p = 12;
- var max = 360, val = max/8;

style :root { --n: #{n}; --val: #{val} }
	- for(var i = 0; i < n; i++)
		.slice(style=`--i: ${i}`)

form(style=`--min: ${min||0}; --max: ${max}`)
	input#a(type='range' value=val max=max)
	label(for='a') gradient angle


                $d: 20em;
$r: .5*$d;
$g: 4px;
$o: 2%;

body {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	min-height: 100vh;
	background: repeating-linear-gradient(-45deg, 
		#aaa 0, #aaa 2px, transparent 0, transparent 5px)

.wrap {
	--h: calc(#{$d}/var(--n));
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center

.slice {
	--parity: 0;
	--sign: calc(1 - 2*var(--parity));
	--m: calc(.5*var(--n)*(var(--n) + 1));
	--h: calc(#{$d}/var(--m));
	box-sizing: border-box;
	padding: calc(var(--i)*#{$g}/var(--n)) 0 calc((var(--n) - 1 - var(--i))*#{$g}/var(--n));
	width: $d; height: calc((var(--i) + 1)*var(--h));
	transform: translate(calc(var(--sign)*2%));
	background: linear-gradient(var(--a, calc(var(--val)*1deg)), #eccc05 15%, #c26e4c, #a63959, #4e2255, #333f3d 85%) calc((1 - var(--parity))*100%) calc(-.5*var(--i)*(var(--i) + 1)*var(--h))/ calc(100% + #{2*$o}) $d padding-box content-box;
	clip-path: circle($r at 50% calc(#{$r} - .5*var(--i)*(var(--i) + 1)*var(--h)));
	&:nth-of-type(2n) { --parity: 1 }

/* styles just to prettify the range input */
$track-w: 15em;
$track-h: .25em;
$thumb-d: 1.5em;
$track-c: #ccc;
$dist: $track-w - $thumb-d;

@mixin track() {
	box-sizing: border-box;
	border: none;
	width: $track-w; height: $track-h;
	background: $track-c;

@mixin thumb() {
	box-sizing: border-box;
	border: none;
	width: $thumb-d; height: $thumb-d;
	border-radius: 50%;
	background: #f90;

form {
	position: fixed;
	top: 0; left: 0;
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	padding: .5em 1.75em;
	width: $track-w; height: 3.5*$thumb-d;
	background: #232323;
	color: #fff;
	font: 1em/1 arial, sans-serif

[type='range'] {
	&, &::-webkit-slider-thumb {
		-webkit-appearance: none
	flex: 1;
	margin: 0;
	padding: 0;
	width: $track-w;
	min-height: $thumb-d;
	background: transparent;
	font: inherit;
	cursor: pointer;
	&::-webkit-slider-runnable-track {
		@include track()
	&::-moz-range-track { @include track }
	&::-ms-track { @include track }
	&::-webkit-slider-thumb {
		margin-top: .5*($track-h - $thumb-d);
		@include thumb
	&::-moz-range-thumb { @include thumb }
	&::-ms-thumb {
		margin-top: 0;
		@include thumb
	&::-ms-tooltip { display: none }
	~ output {
		display: none;
		.js & {
			display: block;
			position: absolute;
			left: .5*$thumb-d; top: 0;
			padding: .25em .5em;
			border-radius: 3px;
			transform: translate(calc((var(--val) - var(--min))/(var(--max) - var(--min))*#{$dist} - 50%));
			background: #95a;
			color: #eee;


                const _R = document.getElementById('a'), 
			_W = _R.parentNode, 
			_O = _R.nextElementSibling;


_R.addEventListener('input', e => {
	_O.value = _R.value;'--val', +_R.value)
}, false);