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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>Pure CSS close icon</h1>
<div class="header">
  <span class="close big"></span><ul><li>.close<li>.big</ul>
</div><div>
<ul class="variations">
  <li><span class="close hairline"></span><ul><li>.hairline</ul>
  <li><span class="close thick"></span><ul><li>.thick</ul>
  <li><span class="close black"></span><ul><li>.black</ul>
  <li><span class="close heavy"></span><ul><li>.heavy</ul>
  
  <li><span class="close pointy"></span><ul><li>.pointy</ul>
  <li><span class="close thick pointy"></span><ul><li>.pointy<li>.thick</ul>
  <li><span class="close black pointy"></span><ul><li>.pointy<li>.black</ul>
  <li><span class="close heavy pointy"></span><ul><li>.pointy<li>.heavy</ul>
  
  <li><span class="close rounded"></span><ul><li>.rounded</ul>
  <li><span class="close rounded thick"></span><ul><li>.rounded<li>.thick</ul>
  <li><span class="close rounded black"></span><ul><li>.rounded<li>.black</ul>
  <li><span class="close rounded heavy"></span><ul><li>.rounded<li>.heavy</ul>
  
  <li><span class="close blades"></span><ul><li>.blades</ul>
  <li><span class="close blades thick"></span><ul><li>.blades<li>.thick</ul>
  <li><span class="close blades black"></span><ul><li>.blades<li>.black</ul>
  <li><span class="close blades heavy"></span><ul><li>.blades<li>.heavy</ul>
    
  <li><span class="close warp"></span><ul><li>.warp</ul>
  <li><span class="close warp thick"></span><ul><li>.warp<li>.thick</ul>
  <li><span class="close warp black"></span><ul><li>.warp<li>.black</ul>
  <li><span class="close warp heavy"></span><ul><li>.warp<li>.heavy</ul>
    
  <li><span class="close fat"></span><ul><li>.fat</ul>
  <li><span class="close fat thick"></span><ul><li>.fat<li>.thick</ul>
  <li><span class="close fat black"></span><ul><li>.fat<li>.black</ul>
  <li><span class="close fat heavy"></span><ul><li>.fat<li>.heavy</ul>
</ul>
</div>
<small>Pure CSS close icon concept by <a href="https://codepen.io/ndeniche/">Rubén Reyes</a></small>
            
          
!
            
              @import "bourbon";

$blue: #1ebcc5;

body {
  padding: 2rem;
  font-family: Helvetica, sans-serif;
}

div {
  text-align: center;
}

a{
  text-decoration: none;
}

h1{
  color: $blue;
  text-align: center;
  margin: 0 0 50px 0;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header {
  ul {
    margin-top: 20px;
  }
}

.variations {
  width: 440px;
  display: inline-block;
  margin: 20px 0 0;
  li {
    width: 70px;
    margin: 15px 20px;
    display: inline-block;
    vertical-align: top;
    ul {
      li {
        margin: 0;
        text-align: left;
        display: block;
      }
    }
  }
}

.close{
  position: relative;
  display: inline-block;
  width: 50px;
  height: 50px;
  overflow: hidden;
  &:hover {
    &::before, &::after {
      background: $blue;
    }
  }

  &::before, &::after {
    content: '';
    position: absolute;
    height: 2px;
    width: 100%;
    top: 50%;
    left: 0;
    margin-top: -1px;
    background: #000;
  }
  &::before {
    @include transform(rotate(45deg));
  }
  &::after {
    @include transform(rotate(-45deg));
  }
  &.big {
    @include transform(scale(3));
  }
  &.hairline {
    &::before, &::after {
      height: 1px;
    }
  }
  &.thick {
    &::before, &::after {
      height: 4px;
      margin-top: -2px;
    }
  }
  &.black {
    &::before, &::after {
      height: 8px;
      margin-top: -4px;
    }
  }
  &.heavy {
    &::before, &::after {
      height: 12px;
      margin-top: -6px;
    }
  }
  &.pointy {
    &::Before, &::after {
      width: 200%;
      left: -50%;
    }
  }
  &.rounded {
    &::before, &::after {
      border-radius: 5px;
    }
  }
  &.blades {
    &::before, &::after {
      border-radius: 5px 0;
    }
  }
  &.warp {
    &::before, &::after {
      border-radius: 120% 0;
    }
  }
  &.fat {
    &::before, &::after {
      border-radius: 100%;
    }
  }
}

small {
  display: block;
  padding: 5rem;
  font: .8rem/1 sans-serif;
  color: #777;
  text-align: center;
}
small a { 
  color: $blue; 
  text-decoration: none; 
  border-bottom: 1px solid #ccc; 
}
small a:hover { border-bottom-color: #222; }
            
          
!
            
              /** Pure CSS close icon concept
  * by Rubén Reyes
  */
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console