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

              
                <img src="https://picsum.photos/id/49/300/250" alt="An old city">
<img src="https://picsum.photos/id/57/250/250" alt="A random road between buildings" style="--c: #8C2318;--t:3px;--g: 10px;--s: 50px">
              
            
!

CSS

              
                @property --p {
  syntax: "<percentage>";
  initial-value: 0%; /* you can start at 50% for a different effect */
  inherits: true;
}

img {
  --t: 5px;  /* control the thickness */
  --s: 40px; /* control the size of the dash (update it to understand what it does) */
  --g: 8px;  /* control the gap */
  --c: #68B3AF;
  
  padding: 
    calc(var(--g) + var(--t)) var(--g)
    var(--g) calc(var(--g) + var(--t));
  border: solid #0000;
  border-width: 0 var(--t) var(--t) 0; 
  background:
    conic-gradient(at var(--p) var(--p), #0000 75%,var(--c) 0)
     0 0/var(--s) var(--s) round padding-box border-box;
  -webkit-mask: 
    conic-gradient(
      from 90deg at calc(2*var(--t)) calc(2*var(--t)),
      #0000 25%,#000 0) calc(-1*var(--t)) calc(-1*var(--t)),
    linear-gradient(#000 0 0) content-box;
  transition: --p .6s;
  cursor: pointer;
}
img:hover {
   --p: 100%;
}

/* a fallback for firefox until better support of @property
   the below won't work on Chrome otherwise I would use it as the main trick
*/
@supports (-moz-appearance: none) {
  img {
    --p: 1em;
    font-size: 0px;
    transition: .6s;
  }
  img:hover {
    --p: 1em;
    font-size: calc(1.5*var(--s));
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-content: center;
  grid-auto-flow: column;
  gap: 50px;
  background: #FAD089;
}
              
            
!

JS

              
                
              
            
!
999px

Console