cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <div class='flex'> 
  <p class='p'>Expanding hamburger menu that displays the intent of the button more clearly than a typical hamburger menu icon.</p>
  <div class='wrapper'>
      <div class='bun'>
          <div class='bigmac'>
              <span class='meat'>MENU</span>
          </div>
      </div>
  </div>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Lato);


//vars
$primary   : #F5F8DE;
$secondary : #9E2B25;

$menu      : $secondary;
//

* {
  box-sizing : border-box;
}

body {
  width : 100%;
  height : 100%;
  background-color : $primary;
}

.p {
  max-width   : 740px;
  padding     : 20px;
  margin      : 50px auto 0;
  font-family : 'Lato', sans-serif;
  font-size   : 1.5em;
  line-height : 1.5;
  color       : $secondary;
}

.wrapper {
  width  : 60px;
  margin : 0 auto;
}

.bigmac {
  position         : absolute;
  top              : 27px;
  left             : 10px;
  height           : 6px;
  width            : 40px;
  background-color : $secondary;
  transition       : background-color 100ms ease-in;
  
  &::before {
    content          : '';
    position         : absolute;
    top              : -12px;
    left             : 0;
    height           : 6px;
    width            : 40px;
    background-color : $secondary;
    transition       : all 150ms ease-in-out;
  }
  
  &::after {
    content          : '';
    position         : absolute;
    bottom           : -12px;
    left             : 0;
    height           : 6px;
    width            : 40px;
    background-color : $secondary;
    transition       : all 150ms ease-in-out;
  }
  
  .meat {
    height          : 60px;
    width           : 60px;
    position        : absolute;
    top             : -27px;
    left            : -10px;
    font-family     : 'Lato', sans-serif;
    font-size       : 0em;
    line-height     : 60px;
    text-align      : center;
    text-decoration : none;
    color           : $menu;
    cursor          : pointer;
    user-select     : none;
    z-index         : 2;
    transition      : font-size 275ms ease-out;
  }

}

.bun {
  position : relative;
  width    : 60px;
  height   : 60px;
  
  &:hover {
    .bigmac {
      background-color : transparent;

      .meat {
        font-size : 1.25em;
      }

      &::before {
        width : 60px;
        left  : -10px;
        top   : -22px;
      }

      &::after {
        width  : 60px;
        left   : -10px;
        bottom : -22px;
      }

    }

  }

}

@media screen and (max-width : 30em) {
  .bigmac {
    background-color : transparent;

    .meat {
      font-size : 1.25em;
    }

    &::before {
      width : 60px;
      left  : -10px;
      top   : -22px;
    }

    &::after {
      width  : 60px;
      left   : -10px;
      bottom : -22px;
    }

  }

}

.flex {
    display: flex;
    flex-direction: column;
}
            
          
!
            
              let burger = document.querySelector('.meat');

burger.addEventListener('click', () => {
  burger.textContent === "MENU" ? burger.textContent = "CLOSE" : burger.textContent = "MENU";
});

            
          
!
999px
Loading ..................

Console