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

              
                <main>
  <article>
    <ul>
      <li>
        <a class="hover-link" href="#"><span>Example Link</span></a>
      </li>
      <li>
        <a class="hover-link" href="#"><span>A second link</span></a>
      </li>
      <li>
        <a class="hover-link" href="#"><span>This lovely link</span></a>
      </li>
      <li>
        <a class="hover-link" href="https://github.com/MaggieAppleton/maggieappleton.com-V2/blob/2ff406427709c487af9037f4bdc17e0ef56c2900/components/links/UnderlineHoverLink.js#L22"><span>Click here for the source of this code</span></a>
      </li>
    </ul>
  </article>
</main>
              
            
!

CSS

              
                :root {
  --color-sea-blue: #04a5bb;
  --color-bright-crimson: #960462;
  --color-crimson: #5f023e;
}

/*

Link styles from: https://github.com/MaggieAppleton/maggieappleton.com-V2/blob/2ff406427709c487af9037f4bdc17e0ef56c2900/components/links/UnderlineHoverLink.js#L22
*/

a {
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  outline: none;
  padding-bottom: 0.25rem;

  &:focus {
    outline: 2px solid darkblue;
    border-radius: 2px;
  }

  &::before {
    content: "";
    transform-origin: 50% 100%;
    background: var(--color-sea-blue);
    transition: clip-path 0.3s, transform 0.3s cubic-bezier(0.2, 1, 0.8, 1);
    position: absolute;
    width: 100%;
    height: 1px;
    top: 95%;
    left: 0;
    pointer-events: none;
    clip-path: polygon(
      0% 0%,
      0% 100%,
      0 100%,
      0 0,
      100% 0,
      100% 100%,
      0 100%,
      0 100%,
      100% 100%,
      100% 0%
    );
  }

  &:hover::before {
    transform: translate3d(0, 2px, 0) scale3d(1, 2, 1);
    clip-path: polygon(
      0% 0%,
      0% 100%,
      100% 100%,
      50% 0,
      50% 0,
      50% 100%,
      50% 100%,
      0 100%,
      100% 100%,
      100% 0%
    );
  }

  span {
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.8, 1);
    color: var(--color-bright-crimson);
  }

  &:hover span {
    transform: translate3d(0, -2px, 0);
    color: var(--color-crimson);
  }
}

/*

General page setup styles
*/

* {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 18px;
  line-height: 1.45;
}

body {
  margin: 0;
}

main {
  background-image: linear-gradient(to bottom left, #e0f2fe 0%, #94a3b8 100%);
  display: grid;
  height: 100svh;
  place-items: center;
}

article {
  background-color: #f6f5f1;
  border-radius: 1rem;
  box-shadow: 0.3em 0.3em 1em oklch(0.1 0.2 240 / 0.15);
  color: #f1f5f9;
  padding: 1rem;
  width: min(500px, 90vw);

  & h1 {
    line-height: 1.1;
    margin: 0;
  }

  & p {
    margin: 0.75rem 0 0;
  }

  & a {
    color: inherit;
  }

  & a:focus {
    outline-offset: 4px;
  }

  & ul {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console