123

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.

            
              div.container <!--adjust position(not required) -->
  input.toggle#toggle(type="checkbox")
  label.toggle-label(for="toggle")
    span.toggle-icon
    span.toggle-text

            
          
!
            
              fontSize(n)
  font-size (n*10)px
  font-size (n)rem

subscript(content)
  position absolute
  width 100%
  left 0
  content content
  transition all 500ms ease-in-out

show()
  visibility visible
  opacity 1

hide()
  visibility hidden
  opacity 0

.toggle
  display none

.toggle-label
  cursor pointer
  display block
  width 45px
  height 45px
  user-select none
  -webkit-tap-highlight-color transparent

.toggle-label:active
  -webkit-tap-highlight-color transparent

.toggle-label
  cursor pointer
  .toggle-icon
  .toggle-icon:before
  .toggle-icon:after
    position relative
    display block
    top 50%
    left 50%
    height 3px
    width 32px
    background #5d809d
    content ''
    transition all 500ms ease-in-out
  .toggle-text
    position relative
    display block
    top calc(100% - 15px)
    height 14px
    fontSize 0.8
    color #5d809d
    text-align center
    &:before
      subscript('MENU')
      show()
    &:after
      subscript('CLOSE')
      hide()

.toggle-label
  .toggle-icon
    transform translate3d(-50%, -5px, 0)
  .toggle-icon:before
    transform translate3d(-50%, -11.5px, 0)
  .toggle-icon:after
    transform translate3d(-50%, 5px, 0)

.toggle:checked ~ .toggle-label
  .toggle-icon
    background-color transparent
  .toggle-icon:before
  .toggle-icon:after
    top 0

.toggle:checked ~ .toggle-label
  .toggle-icon:before
    transform translateX(-50%) rotate(45deg)
    top 1.5px
  .toggle-icon:after
    transform translateX(-50%) translateY(-10px) rotate(-45deg)
    top 8.5px
  .toggle-text
    &:before
      hide()
    &:after
      show()

html
  // sets the base font to 10px for easier math
  font-size 62.5%

body
  font-size 1.4em
  font-family 'メイリオ','Hiragino Kaku Gothic Pro',Meiryo,'ヒラギノ角ゴ Pro W3','MS PGothic','MS UI Gothic',Helvetica,Arial,sans-serif

// adjust position(not required)
.container
  display flex
  align-items center
  justify-content center
  height 200px

            
          
!
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