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.


                <div class="shape">


                @use "sass:math";

@import url(",700");

body {
	font-family: "Open Sans", sans-serif;
	margin: 0;
	padding: 1rem;
	min-height: 100vh;
	display: grid;
	gap: 1rem;
	place-content: center;

.shape {
	width: min(20rem, 90vmin);
	height: min(20rem, 90vmin);
	position: relative;
	background: whitesmoke;
	border: 1px solid lightgrey;
	&::after {
		content: '';
		position: absolute;
		inset: 0;
		background: linear-gradient(45deg, deeppink, orange);
		clip-path: var(--clip);


Math.sin(θ) = opposite / hypotenuse
Math.cos(θ) = adjacent / hypotenuse
Math.tan(θ) = opposite / adjacent

const shape = document.querySelector('.shape')

const plotPoints = (radius, numberOfPoints) => {

	// step used to place each point at equal distances
	const angleStep = (Math.PI * 2) / numberOfPoints
	// x and y position to center the path
	const xPosition = shape.clientWidth / 2
	const yPosition = shape.clientHeight / 2

	// keep track of our points
	const points = []

	for (let i = 1; i <= numberOfPoints; i++) {
		// For every other point, multiply by half the radius
		const radiusAtPoint = i % 2 === 0 ? radius * 0.5 : radius
		// x & y coordinates of the current point
		const x = xPosition + Math.cos(i * angleStep) * radiusAtPoint
		const y = yPosition + Math.sin(i * angleStep) * radiusAtPoint

		// push the point to the points array
		points.push({ x, y })
	return{ x, y }) => {
		return `${x}px ${y}px`
}'--clip', `polygon(${plotPoints(100, 24)