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="grid">
  <div>
    <h1>CSS Filters + mix-blend-mode extreme contrast</h1>
    <p>hover or focus an image to see the original photo.</p>
  </div>
  <figure>
    <img src="https://images.unsplash.com/photo-1552168324-d612d77725e3?crop=entropy&cs=srgb&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3MTQ5NTU1ODB8&ixlib=rb-4.0.3&q=85" alt="A person tossing an analog camera into the air in a darkened room with blue and red lighting. " title="photo by Julius Drost for Unsplash">
  </figure>
  <figure>
    <img src="https://images.unsplash.com/photo-1566737236500-c8ac43014a67?crop=entropy&cs=srgb&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3MTQ5NTU3MTJ8&ixlib=rb-4.0.3&q=85" alt="A group of people partying in a room lit with neon lights. " title="photo by Aleksandr Popov for Unsplash">  
  </figure>
  <figure>
    <img src="https://images.unsplash.com/photo-1571450669798-fcb4c543f6a4?crop=entropy&cs=srgb&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3MTQ5NTU4Njl8&ixlib=rb-4.0.3&q=85" alt="'Let's Get Weird' in pink neon. " title="photo by Jon Tyson for Unsplash">
  </figure>
</div>
              
            
!

CSS

              
                @import url(https://fonts.bunny.net/css?family=underdog:400);

body {
  background-color: black;
  background-image: 
    radial-gradient(circle at center, transparent, black),
    repeating-linear-gradient(90deg, black, hsla(0, 0%, 16%, 1) 2px, black 2px);
  color:white;
  font-family:system-ui, sans-serif;
  height: 100svh;
  padding: 0.8rem 2rem;
  display: grid;
  place-items: center;
 
}

h1 {
  font-family: "Underdog", system-ui, sans-serif;
  font-size: clamp(2rem, 1.652rem + 1.739vw, 3rem);
}

p{
  font-size:1.1rem;
}

.grid {
  display: grid;
  gap:1.2rem;
  grid-template-columns: repeat(2, 1fr);
  max-width: 50rem;
  
  >*{
    padding: 10px;
    margin:0;
  }
}

figure,
img {
	transition: all .2s ease-in-out;
}

figure{
  background-color: white;
	mix-blend-mode: plus-lighter;
  
  &:nth-of-type(1){
    background-color: deeppink;
  }
  &:nth-of-type(2){
    background-color: yellowgreen;
  }
}

img {
  cursor: pointer;
  aspect-ratio: 1/1;
  object-fit: cover; 
  width: 100%;
  
  filter: grayscale(100%) contrast(2) brightness(2) blur(0.5px);
	mix-blend-mode: hard-light;
  
  // this is just to keep the image borders sharp.
  clip-path: rect(1% 99% 99% 1%);
}

figure:has(img:hover, img:focus) {
	background-color: white;
	mix-blend-mode: normal;
	
	img{
		mix-blend-mode: normal;
		filter: none;
	}
}

@media screen and (max-width: 600px){
  
  .grid{
    padding:1rem;
    
    >* { grid-column: auto / span 2;}
  } 
  
}

              
            
!

JS

              
                
              
            
!
999px

Console