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

              
                
<svg width='0' height='0'>
  <filter id='smoo'>
    <feComponentTransfer>
      <feFuncA type='discrete' tableValues='0 1'/>
    </feComponentTransfer>
    <feGaussianBlur stdDeviation='3'/>
    <feComponentTransfer>
      <feFuncA type='table' tableValues='-2 3'/>
    </feComponentTransfer>
  </filter>
</svg>
<div class='grid'>
  <div class='item'>
    <p class='content'>Topping caramels croissant fruitcake liquorice croissant shortbread cake powder. Cupcake sweet jelly-o pudding jelly-o dessert bear claw. Brownie cotton candy pastry marshmallow sweet. Jelly-o toffee powder caramels sweet roll ice cream muffin lollipop sesame snaps. Biscuit sugar plum carrot cake wafer fruitcake sweet lollipop. Cookie candy canes tart jelly cake. Brownie fruitcake chocolate cheesecake cheesecake pudding chocolate cake fruitcake chocolate. Liquorice tiramisu pastry donut chupa chups. Croissant toffee tiramisu danish bonbon halvah. Pastry tart fruitcake bear claw dessert wafer powder lollipop. Lemon drops jujubes croissant croissant liquorice donut tiramisu tiramisu cookie.</p>
  </div>
  <div class='item'></div>
  <div class='item'></div>
  <div class='item'></div>
  <div class='item'></div>
</div>
              
            
!

CSS

              
                html, body, div { display: grid }

[height='0'] { position: absolute }

.grid {
	--s: .75em; /* grid gap space */
	grid-gap: var(--s);
	grid-template-columns: 
		repeat(4, minmax(100px, 1fr));
	/* to make font size relative to box size */
	container-type: inline-size;
	width: min(100%, 50em)
}

.item {
	--r: 1.5cqi; /* corner rounding, relative to box size */ 
	aspect-ratio: 1; /* make items square */
	border-radius: var(--r);
	background: #eceff5
}

.item:first-child {
	/* span 2 rows & 2 cols starting from top left corner */
	grid-area: 1/ 1/span 2/ span 2;
	background: none;
	color: #fff;
	
	&::before {
		--o: calc(50% - .5*var(--s));
		grid-area: 1/ 1;
		z-index: -1; /* place behind text */
		/* exclude bottom right quarter */
		background: 
			conic-gradient(from 90deg at var(--o) var(--o), 
					#0000 25%, #0e64ad 0%);
		/* smooth rounded corners */
		filter: blur(calc(.5*var(--r) - 1px)) 
			url(#smoo);
		content: ''
	}
	
	/* text inside corner box */
	.content {
		grid-area: 1/ 1;
		margin: 0;
		padding: .5em;
		font: 2cqi sans-serif;
		
		/* this is to allow text wrapping around the corner */
		&::before {
			--y: calc(50% - var(--s));
			float: right;
			width: calc(50% + var(--s)); 
			height: 100%;
			shape-outside: 
				polygon(100% var(--y), 0 100%, 0 var(--y));
			content: ''
		}
	}
}

.item:nth-child(4) { grid-area: 2/ 2 }
              
            
!

JS

              
                
              
            
!
999px

Console