css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              nav.navigation
  input.toggle(type='checkbox', id='more', aria-hidden='true', tabindex='-1')
  .navigation__inner
    .navigation__logo
      a(href='#').navigation__link Local news
    ul.navigation__list
      li.navigation__item: a(href='#').navigation__link News
      li.navigation__item: a(href='#').navigation__link Sport
      li.navigation__item: a(href='#').navigation__link Weather
      li.navigation__item: a(href='#').navigation__link TV
      li.navigation__item: a(href='#').navigation__link Radio
      li.navigation__item: a(href='#').navigation__link Travel
      li.navigation__item: a(href='#').navigation__link Music
      li.navigation__item: a(href='#').navigation__link Food
      li.navigation__item: a(href='#').navigation__link Arts
      li.navigation__item: a(href='#').navigation__link Earth
      li.navigation__item: a(href='#').navigation__link Local
    .navigation__toggle
      label(for='more', aria-hidden='true').navigation__link More

            
          
!
            
              $color--white = #FFFFFF
$color--off-white = #FAFAFA
$color--black = #000000
$color--light-grey = #E6E6E6
$color--grey = #CCCCCC

*
  box-sizing border-box

body
  margin 0
  background $color--light-grey
  font-family Helvetica, Arial, sans-serif
  
.navigation
  width 100%
  border-bottom 1px solid $color--grey
  background $color--white
  height 50px
  
.navigation__inner
  display flex
  max-width 900px
  height 50px
  margin 0 auto
  overflow hidden

  .toggle:checked ~ &
    height auto

.navigation__link
  display block
  padding 0 20px
  font-size 14px
  line-height 50px
  text-decoration none
  color $color--black
  cursor pointer
  
  &:hover
    text-decoration underline

.navigation__logo
  flex-shrink 0
  align-self flex-start
  border-left 1px solid $color--grey
  
  .navigation__link
    font-weight bold
  
.navigation__list
  display flex
  flex-wrap wrap
  margin 0
  padding 0
  list-style none
  background $color--white
  border 1px solid $color--grey
  border-top 0
  border-right 0

.navigation__item
  
  @media screen and (max-width: 400px)
    flex-basis 100%
  
.navigation__toggle
  flex-shrink 0
  background $color--white
  border-right 1px solid $color--grey
  border-bottom 1px solid $color--grey

  .navigation__link
    position relative
    padding-right 50px
    
    &:after
      content ''
      position absolute
      top 22px
      right 20px
      width 0
      height 0
      border-style solid
      border-width 5px 5px 0 5px
      border-color $color--black transparent transparent transparent
      
      .toggle:checked ~ .navigation__inner &
        border-width 0 5px 5px 5px
        border-color transparent transparent $color--black transparent

.toggle
  position absolute
  z-index -1
  opacity 0
            
          
!
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.
Loading ..................

Console