Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <!--we use checkbox hack to make this-->
<input type="checkbox" id="menu"/>
  <nav>
    <!--label is inside the drawer but drawer is moved to left(-100%) when checkbox is not checked but the label is moved from left to 200px so it will look like when drawer is closed the label is there to open a drawer-->
    <label for="menu">
      <!--burger menu without cheese-->
        <span></span>
        <span></span>
    </label>
    <li><a href="#">One</a></li>
    <li><a href="#">Two</a></li>
    <li><a href="#">Three</a></li>
    <li><a href="#">Four</a></li>
    <li><a href="#">Five</a></li>
  </nav>

<section>
  <article>
  <h1>Pure CSS Slide-in Drawer</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elit nunc, lacinia ut leo vitae, dictum molestie nisl. Integer imperdiet elementum gravida. Phasellus ultrices eleifend arcu, in posuere massa luctus sed. Donec id orci ullamcorper, maximus nisi eu, imperdiet nibh. Nulla sodales, augue sit amet malesuada ullamcorper, erat enim sagittis ipsum, eget gravida arcu turpis sagittis dui. Pellentesque sit amet mauris nunc. Cras ut iaculis tortor. Maecenas consectetur odio ac semper fermentum. Donec a consequat quam, nec feugiat lacus. Vivamus vehicula lacus a felis tristique venenatis. Vestibulum sollicitudin facilisis ipsum sed blandit. Morbi metus dolor, vehicula id hendrerit a, tincidunt ultricies nulla.</p>
    </article>
</section>
              
            
!

CSS

              
                body,
html {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: linear-gradient(to right, #FFC371, #FF5F6D);
  font-family: 'Quicksand', sans-serif;
}

/*hide the checkbox*/
input {
  display: none;
}

/*label for checkbox*/
label{
  position: fixed;
  cursor: pointer;
  /*this prevent the label from moving to left when drawer is closed*/
  left: 200px;
  width: 50px;
  height: 50px;
  background-color: rgba(6,26,38,0.9);
  -webkit-tap-highlight-color: transparent;
}

/*burger menu without cheese*/
label span{
  display: block;
  width: 30px;
  height: 1px;
  background-color: #cdcdcd;
  position: relative;
  margin-bottom: 10px;
  top: 18px;
  left: 10px;
  transition: all 0.4s ease-in-out;
}

/*drawer moved to left (-100%)*/
nav {
  position: fixed;
  margin: 0;
  width: 200px;
  height: 100%;
  background: rgba(6,26,38,0.9);
  transition: transform 0.4s ease;
  transform: translateX(-100%);
}

/*just a lists inside a drawer*/
nav li{
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  list-style-type: none;
  cursor: pointer;
  padding: 15px 0 15px 10px;
}

nav a{
  text-decoration: none; 
  color: #f1efe9;
  outline: none;
}

/*drawer links hover underline effects*/
nav li:after{
  content: '';
  position: absolute;
  margin-top: 30px;
  left: 0%;
  width: 0%;
  height: 1px;
  background: linear-gradient(to right, #FFC371, #FF5F6D);
  transition: width 0.5s ease-in-out;
}
nav li:before{
  content: '';
  position: absolute;
  margin-top: 30px;
  right: 0%;
  width: 0%;
  height: 1px;
  background: linear-gradient(to right, #FF5F6D, #FFC371);
  transition: width 0.5s ease-in-out;
}
nav li:hover:before, nav li:hover:after{
  width: 50%;
}

/*main section*/
section{
  transition: transform 0.4s ease;
  line-height: 30px;
  margin: 60px;
  color: #282828;
}

h1{
  text-align: center;
  color: #282828;
}

/*when input is checked we will move the drawer back to place*/
input:checked ~ nav{
  transform: translateX(0%);
}

/*move the section further to the right when input is checked*/
input:checked ~ section{
  transform: translateX(200px);
}

/*when input is checked we make the burger menu to look like crossmark (X)*/
input:checked ~ nav label span:first-child{
  transform: rotate(45deg);
  transform-origin: 30% 0%;
}

/*when input is checked we make the burger menu to look like crossmark (X)*/
input:checked ~ nav label span:nth-last-child(1){
  transform: rotate(-45deg);
  transform-origin: 20% 0%;
}
              
            
!

JS

              
                //Pure CSS
              
            
!
999px

Console