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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <head>
    <link href="https://fonts.googleapis.com/css?family=Catamaran:400,600,700|Merriweather+Sans:300,300i" rel="stylesheet">
</head>
<div id="js--site-overlay" class="site-overlay" data-open="false">
</div>
<menu id="js--menu" class="menu" data-open="true">
  <div id="js--menu-close" class="menu__close">
    <button class="button button--with-svg button--color-white button--small">
      <svg viewBox="0 0 24 24" color="currentColor">
    <path d="M 4.7070312 3.2929688 L 3.2929688 4.7070312 L 10.585938 12 L 3.2929688 19.292969 L 4.7070312 20.707031 L 12 13.414062 L 19.292969 20.707031 L 20.707031 19.292969 L 13.414062 12 L 20.707031 4.7070312 L 19.292969 3.2929688 L 12 10.585938 L 4.7070312 3.2929688 z"/>
</svg>
    </button>
  </div>
  <ul class="menu__container">
    <li class="menu__item">
      Home
    </li>
    <li class="menu__item">
      Projects
    </li>
    <li class="menu__item">
      Blog
    </li>
    <li class="menu__item">
      Contact
    </li>
  </ul>
</menu>
<header class="header">
  <div class="header__item">
    <div id="js--menu-link">
        <button class="button button--with-svg button--small button--color-gray">
      <svg class="svg-container" viewBox="0 0 24 24">
    <path d="M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"/>
</svg>
    </div>
  </div>
  <div class="header__item">
    <div class="flex-container">
      <div class="flex__item">
      </div>
      <div class="flex__item">
        <button class="button button--with-svg button--small button--with-svg-hover button--color-gray">
          <svg viewBox="0 0 32 32">
<path fill="currentColor" d="M16,0C7.2,0,0,7.2,0,16c0,8.8,7.2,16,16,16s16-7.2,16-16C32,7.2,24.8,0,16,0z M18.3,22.4
	c0,0-1.1,0.1-2.3,0.1s-2.3-0.1-2.3-0.1C10.9,22.1,8,21,8,16.2c0-1.4,0.5-2.5,1.3-3.4c-0.1-0.3-0.6-1.6,0.1-3.3c0,0,1.1-0.3,3.4,1.3
	c1-0.3,2.1-0.4,3.1-0.4c1.1,0,2.1,0.1,3.1,0.4c2.4-1.6,3.4-1.3,3.4-1.3c0.7,1.7,0.3,3,0.1,3.3c0.8,0.9,1.3,2,1.3,3.4
	C24,21,21.1,22.1,18.3,22.4z"/>
</svg>
        </button>
      </div>
      <div class="flex__item">
          <button class="button button--with-svg button--small button--with-svg-hover">
        <svg viewBox="0 0 32 32">
<path fill="currentColor" d="M28.2,0H3.8C1.7,0,0,1.7,0,3.8v24.4C0,30.3,1.7,32,3.8,32h24.4c2.1,0,3.8-1.7,3.8-3.8V3.8
	C32,1.7,30.3,0,28.2,0z M24,4h3c0.6,0,1,0.4,1,1v3c0,0.6-0.4,1-1,1h-3c-0.6,0-1-0.4-1-1V5C23,4.4,23.4,4,24,4z M16,9.9
	c3.4,0,6.2,2.7,6.2,6.1c0,3.4-2.8,6.1-6.2,6.1c-3.4,0-6.2-2.7-6.2-6.1C9.9,12.6,12.6,9.9,16,9.9z M28,29H4c-0.6,0-1-0.4-1-1V13h4
	c-0.5,0.8-0.7,2.1-0.7,3c0,5.4,4.4,9.7,9.7,9.7c5.4,0,9.7-4.4,9.7-9.7c0-0.9-0.1-2.3-0.8-3h4v15C29,28.6,28.6,29,28,29z"/>
</svg>
        </button>
      </div>
      <div class="flex__item">
          <button class="button button--with-svg button--small button--with-svg-hover button--color-gray">
        <svg class="svg-container" viewBox="0 0 32 32">
<path fill="currentColor" d="M30.7,0H1.3C0.6,0,0,0.6,0,1.3v29.3C0,31.4,0.6,32,1.3,32h29.3c0.7,0,1.3-0.6,1.3-1.3V1.3
	C32,0.6,31.4,0,30.7,0z M9.5,27.3H4.7V12h4.8V27.3z M7.1,9.9c-1.5,0-2.8-1.2-2.8-2.8c0-1.5,1.2-2.8,2.8-2.8c1.5,0,2.8,1.2,2.8,2.8
	C9.9,8.7,8.6,9.9,7.1,9.9z M27.3,27.3h-4.7v-7.4c0-1.8,0-4-2.5-4c-2.5,0-2.8,1.9-2.8,3.9v7.6h-4.7V12H17v2.1h0.1
	c0.6-1.2,2.2-2.5,4.5-2.5c4.8,0,5.7,3.2,5.7,7.3V27.3z"/>
</svg>
        </button>
      </div>
      <div class="flex__item">
       <button class="button button--with-svg button--small button--with-svg-hover button--color-gray">
        <svg class="svg-container"  width="16px" height="16px" viewBox="0 0 32 32">
<path fill="currentColor" d="M32,6.1c-1.2,0.5-2.4,0.9-3.8,1c1.4-0.8,2.4-2.1,2.9-3.6c-1.3,0.8-2.7,1.3-4.2,1.6C25.7,3.8,24,3,22.2,3
	c-3.6,0-6.6,2.9-6.6,6.6c0,0.5,0.1,1,0.2,1.5C10.3,10.8,5.5,8.2,2.2,4.2c-0.6,1-0.9,2.1-0.9,3.3c0,2.3,1.2,4.3,2.9,5.5
	c-1.1,0-2.1-0.3-3-0.8c0,0,0,0.1,0,0.1c0,3.2,2.3,5.8,5.3,6.4c-0.6,0.1-1.1,0.2-1.7,0.2c-0.4,0-0.8,0-1.2-0.1
	c0.8,2.6,3.3,4.5,6.1,4.6c-2.2,1.8-5.1,2.8-8.2,2.8c-0.5,0-1.1,0-1.6-0.1C2.9,27.9,6.4,29,10.1,29c12.1,0,18.7-10,18.7-18.7
	c0-0.3,0-0.6,0-0.8C30,8.5,31.1,7.4,32,6.1z"/>
</svg>
        </button>
      </div>
    </div>
  </div>
</header>
<section class="grid">
  <main class="main">
    <h1 class="heading heading--level-1">Heading Level 1 with extra text</h1>
    <h2 class="heading heading--level-2">Heading Level 2 with extra text</h2>
    <h3 class="heading heading--level-3">Heading Level 3 with extra text</h3>
    <h4 class="heading heading--level-4">Heading Level 4 with extra extra extra text</h4>
    <h5 class="heading heading--level-5">Heading Level 5</h5>
    <p>Chocolate liquorice marshmallow tart jelly pastry macaroon danish. Donut toffee muffin fruitcake jelly beans pastry carrot cake dessert. Gingerbread caramels marshmallow lemon drops. Cupcake gingerbread dessert pie liquorice candy danish ice cream.
      Sweet roll cupcake marshmallow cake. Apple pie sesame snaps bonbon jelly-o dessert. Chocolate bar sweet roll wafer cotton candy carrot cake tart. Ice cream pudding toffee jelly beans. Ice cream donut dessert cake cake chocolate. Chocolate sugar
      plum jelly. Chocolate bar sugar plum cookie tart caramels macaroon croissant. Candy canes sugar plum fruitcake caramels halvah. <a href="#">Cake macaroon</a> jelly chupa chups cake gingerbread bonbon.</p>
    <p>

      Sweet roll caramels jelly-o lollipop jujubes pastry croissant. Jujubes soufflé cake cake fruitcake danish jelly beans pudding sweet. Sesame snaps dragée dessert pastry candy canes tart cotton candy candy dessert. Halvah lollipop lollipop chocolate wafer
      cupcake jelly-o biscuit. Pastry jelly dragée marzipan danish marshmallow sweet. Pastry dragée gummies sesame snaps marshmallow pudding. Soufflé liquorice muffin chupa chups oat cake gummi bears dessert toffee. Jujubes cookie lollipop chocolate bar
      topping. Cookie cotton candy oat cake bear claw cookie lollipop. Sweet jujubes bonbon sesame snaps chocolate cake toffee. Brownie candy canes apple pie tiramisu caramels marshmallow. Cake powder donut toffee tootsie roll cookie chocolate.
    </p>
    <ul class="list list--separators-gray">
      <li>
        <div class="module">
          List Item
        </div>
      </li>
      <li>
        <div class="module">
          List Item
        </div>
      </li>
    </ul>
    <ul class='list list--text'>
      <li>The first thing</li>
      <li>The second thing</li>
    </ul>
  </main>
</section>
              
            
!

CSS

              
                /* CSS Reset */
html, body, menu, ul, li, button, a {
  padding: 0;
  margin: 0;
  list-style: none;
  text-decoration: none;
  border: 0;
  font-family: Arial, sans-serif;
}

:root {
  --cream: #F7ECE1;
  --lavender: #8D86C9;
  --purple: #725AC1;
  --dark-purple: #242038;
  --gray: #202020;
  --gray-light: #e2e2e2;
  --padding: 12px;
  font-size: 16px;
  color: var(--gray);
}

/* Site Overlay */
.site-overlay {
  transition: opacity 0.1s ease-in; 
  opacity: 0;
}
.site-overlay[data-open='true'] {
  z-index: 1;
  position: fixed;
  top:    0;
  left:   0;
  bottom: 0;
  right:  0;
  background-color: var(--gray);
  opacity: 0.2;
}

/* Menu */
.menu {
  font-family: 'Merriweather Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: lowercase;
  z-index: 2;
  width:  20vw;
  height: 100vh;
  position: fixed;
  background-color: var(--dark-purple);
  color: var(--cream);
  top: 0;
  left: -20vw;
  transition: left 0.2s ease;
}
.menu[data-open='true'] {
  left: 0;
  transition: left 0.3s ease;
}
.menu__container {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.menu__item {
  width: 90%;
  padding: 5%;
  transition: all 0.2s ease-out;
  text-align: center;
}
.menu__item:hover {
  color: var(--purple);
  background-color: var(--dark-purple);
  opacity: 0.9;
  filter: brightness(150%);
}
.menu__close {
  padding: 15px 0 0 25px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  width: 80%;
  height: 50px;
  padding: 0 10%;
  background-color: white;
  border-bottom: 1px solid var(--gray-light);
}

/* Grid */
.grid {
  height: 100%;
  display: grid;
  grid-template-columns: 10% 1fr 3fr 1fr 10%;
  grid-template-rows: 100px 100vh;
}

.main {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
  min-height: 80vh;
}
/* Mega Screens */
@media only screen and (min-width: 1367px) { 
  .menu {
    width: 20vw;
    left: -20vw;
  }
  .grid {
    grid-template-columns: 10% 1fr 768px 1fr 10%; 
  }
}

/* Half Screen & Tablet */
@media only screen and (max-width: 640px) {
  .grid {
    grid-template-columns: 10% 1fr 10%;
  }
  .main {
    grid-column: 2 / 3;
  }
  .menu {
    width: 40vw;
    left: -40vw;
  }
}

/* Mobile */
@media only screen and (max-width: 400px) {
  .menu {
    width: 50vw;
    left: -50vw;
  }
}

/* Typography */
.heading {
  font-family: 'Catamaran', sans-serif;
  font-weight: 600;
}
.heading--level-1 {
  font-size: 3rem;
  line-height: 2.7rem;
}
.heading--level-2 {
  font-size: 2.25rem;
  line-height: 2.2rem;
}
.heading--level-3 {
  font-size: 1.75rem;
  line-height: 1.7rem;
}
.heading--level-4 {
  font-size: 1rem;
  line-height: 1.2rem;
}
.heading--level-5 {
  font-size: 0.87rem;
  line-height: 1.1rem;
}

/* Body */
p {
  font-family: 'Merriweather Sans', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
}
p + p {
  padding: 2.5rem 0;
}

/* Links */
a {
  color: var(--purple);
  font-family: inherit;
}
a:hover {
  color: var(--lavender);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--lavender);
}

/* List */
ul.list {
}
ul.list--text li {
  padding: calc(var(--padding) / 2);
  list-style: disc inside;
}
ul.list--separators-gray li {
  border-bottom: 1px solid var(--gray);
}

/* Module */
.module {
  padding: var(--padding);
}
.module--padding-small {
  padding: calc(var(--padding) / 2);
}

/* Flex Container */
.flex-container {
  display: flex;
}

/* Buttons */
.button {
}
.button--small {
  padding: 16px;
}
.button--small svg {
  position: absolute;
  top: -4px;
  left: -4px;
  height: 16px;
  width: 16px;
}
.button--with-svg {
  position: relative;
  background-color: transparent;
}
.button--with-svg-hover:hover {
  transition: all 1s ease;
  border-radius: 2px;
  background-color: var(--gray-light);
}
.button--with-svg svg {
  position: absolute;
  padding: 12px;
}
.svg-container {
  padding: 12px;
}
.button--color-white {
  color: white;
  fill: white;
}
.button--color-gray {
  color: var(--gray);
  fill: var(--gray);
}
              
            
!

JS

              
                const menuLink = document.getElementById("js--menu-link");
const menu = document.getElementById("js--menu");
const overlay = document.getElementById("js--site-overlay");
const close = document.getElementById("js--menu-close");

menuLink.addEventListener("click", () => {
  menu.dataset.open = "true";
  overlay.dataset.open = "true";
});

close.addEventListener("click", () => {
  menu.dataset.open = "false";
  overlay.dataset.open = "false";
});

overlay.addEventListener("click", () => {
  menu.dataset.open = "false";
  overlay.dataset.open = "false";
});

              
            
!
999px

Console