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

              
                <div class='card' contenteditable>(semi)transparent card + rounded corners + rainbow border + glow</div>
              
            
!

CSS

              
                // the rainbow palette
$c: #f94144, #f3722c, #f8961e, #f9844a, #f9c74f, #90be6d, #43aa8b, #4d908e, #277da1, #577590;
$b: 6px; // border-width
$r: 2em; // blur radius

@property --Ξ± { /* must register --Ξ± to animate it */
	syntax: '<angle>';
	initial-value: 0deg;
	/* used only on pseudo, nowhere to be inherited, 
	 * better perf if set false, see 
	 * https://www.bram.us/2024/10/03/benchmarking-the-performance-of-css-property/ */
	inherits: false
}

.card {
	/* needed for absolutely positioned pseudo */
	position: relative;
	/* set dimensions IF even necessary to set, 
	 * not given by content or parent layout */
	max-width: 15em;
	aspect-ratio: 3/ 2;
	/* transparent, just to reserve the space */
	border: solid $b #0000;
	padding: .75em; /* space between border & text */
	border-radius: 1em; /* round corners */
	/* (semi)transparent background, can be 
	 * a gradient with (semi)transparent stops */
	background: #edabab21;
		
	&::before, &::after {
		/* full opaque coverage of its box */
		--full: conic-gradient(red 0 0);
		/* grid doesn't work for stacking 
		 * when a stacked item is text node */
		position: absolute;
		/* equal to the border-width with minus */
		inset: -1*$b;
		/* inherit parent box model & rounded corners */
		border: inherit;
		border-radius: inherit;
		/* reserve no-clip space for glow */
		box-shadow: 0 0 3*$r rgba(0 0 0/ .001);
		background: 
			conic-gradient(from var(--Ξ±), 
					#{$c}, #{nth($c, 1)}) border-box;
		/* make everything inside padding-box transparent
		 * by subtracting padding-box from no-clip box */
		mask: var(--full) no-clip subtract, 
			var(--full) padding-box;
		/* don't get in the way of selecting text */
		pointer-events: none;
		/* animate gradient start angle */
		animation: Ξ± 4s linear infinite;
		content: ''
	}
	
	/* turn one pseudo layer into glow */
	&::after { filter: blur($r) }
}

@keyframes Ξ± { to { --Ξ±: 1turn } }

/* layout & prettifying */
html, body, div {
	box-sizing: border-box;
	display: grid;
	place-items: center
}

html { min-height: 100% }

body {
	background: 
		url(https://images.unsplash.com/photo-1735542214686-a745d3684c39?w=1400) 
			5%/ cover #212121;
	background-blend-mode: multiply;
	color: #dedede;
	font: 300 clamp(.875em, 5vw, 2.5em) saira, sans-serif;
	text-align: center;
	text-wrap: balance
}
              
            
!

JS

              
                
              
            
!
999px

Console