Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ add another resource


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


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.


Save Automatically?

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.


                <div class="wrapper">
  <form action="">
    <label for="direction">Choose the transition position</label>
    <select name="direction" id="direction">
      <option value="left center">left center</option>
      <option value="right center">right center</option>
      <option value="center top">center top</option>
      <option value="center bottom">center bottom</option>
      <option value="center">center</option>
      <option value="left top">left top</option>
      <option value="right top">right top</option>
      <option value="left bottom">left bottom</option>
      <option value="right bottom">right bottom</option>

  <ul class="stats">
    <li class="stats__item">
      <h3>Number of users</h3>
    <li class="stats__item">
    <li class="stats__item">

  <p class="demo">This is a demo from my article <a href="">Understanding Clip Path in CSS</a></p>


                :root {
  --pos: left center;
  --size: 0;

.wrapper {
  max-width: 744px;
  margin: 2rem auto;

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-gap: 1rem;

.stats__item {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  padding: 1rem;
  border-radius: 5px;
  box-shadow: 0 3px 10px 0 rgba(#000, 0.1);
  overflow: hidden;
  cursor: pointer;

  p {
    /* z-index works becuase those are flex childs.. */
    z-index: 1;
    transition: 0.25s linear;

  h3 {
    color: grey;
    font-size: 0.8rem;

  p {
    font-size: 1.125rem;
    font-weight: bold;

  &:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #7777e9;
    clip-path: circle(var(--size) at var(--pos));
    transition: 0.4s linear;

  &:hover {
    p {
      color: #fff;

    &:before {
      --size: 300px;

form {
  margin-bottom: 1rem;

  @media (min-width: 680px) {
    margin-bottom: 3rem;

.demo {
  margin-top: 2rem;
  font-size: 14px;

body {
  font-family: "system-ui";
  line-height: 1.4;
  padding: 1rem;
  background-color: #f7f7f7;

* {
  box-sizing: border-box;



                const transPos = document.querySelector("#direction");

transPos.addEventListener("input", function () {
  let pos = this.value;"--pos", pos);