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

              
                .card I'm a card with an inner glow
              
            
!

CSS

              
                @property --a { /* must register --a 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 {
	/* hide outer part of glow */
	overflow: hidden;
	/* needed for absolutely positioned pseudo */
	position: relative;
	/* adjust width as needed IF it's even necessary to set */
	width: Min(12.5em, 80vmin);
	/* adjust aspect-ratio OR height IF height not given by content */
	aspect-ratio: 1;
	/* round outer card corners */
	border-radius: .5em;
	
	/* text & layout styles below just for prettifying */
	place-self: center;
	place-content: center;
	padding: .5em;
	color: #ededed;
	font: clamp(1em, 2vw + 2vh, 2em) sans-serif;
	text-align: center;
	text-transform: uppercase;
	text-wrap: balance
}

.card::before {
	/* grid doesn't work for stacking when a stacked item is text node */
	position: absolute;
	/* place behind card content, so card text is selectable, etc */
	z-index: -1;
	/* best if inset is at least half the border-width with minus */
	inset: -1em;
	/* reserve space for border */
	border: solid 1.25em;
	border-image: 
		/* adjust gradient as needed, I just used a random palette */
		conic-gradient(from var(--a), #669900, #99cc33, #ccee66, 
				#006699, #3399cc, #990066, #cc3399, 
				#ff6600, #ff9900, #ffcc00, #669900) 1;
	/* blur this pseudo */
	filter: blur(.75em);
	/* tweak animation duration as necessary */
	animation: a 4s linear infinite;
	/* needed so pseudo is displayed */
	content: ''
}

/* animate --a from its initial-value 0deg to 1turn */
@keyframes a { to { --a: 1turn } }


/* prettifying and layout stuff, not needed for card glow part */
html, body, div { display: grid }

html { min-height: 100% }

body {
	background: /* just to illustrate card transparency */
		url(https://images.unsplash.com/photo-1729824346255-52a8f898fe84?w=1400) 
			50%/ cover #212121;
	/* darken image (multiplying its RGB channels with 
	 * those of background-color) for better text contrast */
	background-blend-mode: multiply
}
              
            
!

JS

              
                
              
            
!
999px

Console