Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                .keyboard
  .row.row-1
    .key{'data-key' => '96'}
      .top &#126;
      .bottom &#96;
    .key{'data-key' => '49'}
      .top !
      .bottom 1
    .key{'data-key' => '50'}
      .top @
      .bottom 2
    .key{'data-key' => '51'}
      .top #
      .bottom 3
    .key{'data-key' => '52'}
      .top $
      .bottom 4
    .key{'data-key' => '53'}
      .top %
      .bottom 5
    .key{'data-key' => '54'}
      .top ^
      .bottom 6
    .key{'data-key' => '55'}
      .top &
      .bottom 7
    .key{'data-key' => '56'}
      .top *
      .bottom 8
    .key{'data-key' => '57'}
      .top (
      .bottom 9
    .key{'data-key' => '48'}
      .top )
      .bottom 0
    .key{'data-key' => '45'}
      .top.t-higher _
      .bottom -
    .key{'data-key' => '61'}
      .top +
      .bottom.b-closer =
    .key.key-special-r.key-delete{'data-key' => '8'}
      %span delete
  .row.row-2
    .key.key-tab.key-special-l
      %span tab
    .key{'data-key' => '113'} Q
    .key{'data-key' => '119'} W
    .key{'data-key' => '101'} E
    .key{'data-key' => '114'} R
    .key{'data-key' => '116'} T
    .key{'data-key' => '121'} Y
    .key{'data-key' => '117'} U
    .key{'data-key' => '105'} I
    .key{'data-key' => '111'} O
    .key{'data-key' => '112'} P
    .key{'data-key' => '91'}
      .top {
      .bottom [
    .key{'data-key' => '93'}
      .top }
      .bottom ]
    .key{'data-key' => '92'}
      .top &#124;
      .bottom \
  .row.row-3
    .key.key-caps.key-special-l
      %span caps lock
    .key{'data-key' => '97'} A
    .key{'data-key' => '115'} S
    .key{'data-key' => '100'} D
    .key{'data-key' => '102'} F
    .key{'data-key' => '103'} G
    .key{'data-key' => '104'} H
    .key{'data-key' => '106'} J
    .key{'data-key' => '107'} K
    .key{'data-key' => '108'} L
    .key{'data-key' => '59'}
      .top.t-higher :
      .bottom ;
    .key{'data-key' => '39'}
      .top "
      .bottom '
    .key.key-return.key-special-r{'data-key' => '13'}
      %span return
  .row.row-4
    .key.key-shift-l.key-special-l
      %span shift
    .key{'data-key' => '122'} Z
    .key{'data-key' => '120'} X
    .key{'data-key' => '99'} C
    .key{'data-key' => '118'} V
    .key{'data-key' => '98'} B
    .key{'data-key' => '110'} N
    .key{'data-key' => '109'} M
    .key{'data-key' => '44'}
      .top <
      .bottom ,
    .key{'data-key' => '46'}
      .top >
      .bottom .
    .key{'data-key' => '47'}
      .top ?
      .bottom &#47;
    .key.key-shift-r.key-special-r{'data-key' => '16'}
      %span shift
  .row.row-5
    .key.key-narrow.key-special-l
      %span fn
    .key.key-narrow.key-special-l
      %span control
    .key.key-narrow.key-special-l
      %span option
    .key.key-command-l.key-special-l
      .command-symbol-r &#8984;
      %span command
    .key.key-space{'data-key' => '32'}
    .key.key-command-r.key-special-r
      .command-symbol-l &#8984;
      %span command
    .key.key-narrow.key-special-r
      %span option
    .key.key-arrow.key-arrow-l
      %svg
        %polygon{ style:'fill:#6E6F71', points:"3.9,4.7 0,2.4 3.9,0"}
    .key.key-arrow.key-arrow-u
      %svg
        %polygon{ style:'fill:#6E6F71', points:"0,3.9 2.4,0 4.7,3.9"}
    .key.key-arrow.key-arrow-d
      %svg
        %polygon{ style:'fill:#6E6F71', points:"4.7,0 2.4,3.9 0,0"}
    .key.key-arrow.key-arrow-r
      %svg
        %polygon{ style:'fill:#6E6F71', points:"0,0 3.9,2.4 0,4.7"}


              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Varela+Round)

.keyboard
  background-image: linear-gradient(#cccdce, #e1e1e2 7%, #cdcfcf)
  border: 1px solid rgba(0,0,0,.07)
  border-radius: 1em
  box-shadow: inset 0 0 5px rgba(255,255,255,.26), 0 1px 0 #8b8e90, 0 2px 0 #a6a9ab, 0 3px 0 #919191, 0 4px 5px rgba(0,0,0,.5)
  margin: 50px auto 0
  padding: 3em 1em 1em 
  width: 51em
  
.row
  margin: 0 auto .5em
  position: relative
  &:last-child
    margin-bottom: 0
  
.key
  background-image: linear-gradient(#edeeef, #f6f7f8)
  border-bottom: .1em solid #dbdbdc
  border-top: .1em solid #fff
  border-radius: 0.25em
  box-shadow: 0 1px 3px #67696e, inset 0 0 5px #fff
  box-sizing: border-box
  display: inline-block
  color: #6e6f71
  font-family: varela round
  height: 3em
  margin-right: 0.25em
  overflow: hidden
  padding-top: 1em
  position: relative
  text-align: center
  text-shadow: 0 1px 0 #fff  
  width: 3em
  z-index: 100
  &:last-child
    margin-right: 0

//Gradient borders
.key:before,
.key:after
  background-image: linear-gradient(#fff, #dbdbdc)
  bottom: 0
  content: ""
  position: absolute
  top: 0
  width: .1em
  z-index: 200

.key:before
  left: 0
  
.key:after 
  right: 0
  
// Special Keys    
.key-tab
  width: 5em
.key-caps
  width: 5.5em
.key-return
  width: 6em
.key-shift-l
  width: 7.1em
.key-shift-r
  width: 7.9em
.key-delete
  width: 5em
.key-narrow
  width: 2.75em
.key-command-l,
.key-command-r
  width: 4.5em  
.key-space
  width: 17em
  
//Alignments
.key-special-l
  padding-left: .5em
  padding-top: 1.5em
  text-align: left 
.key-special-r
  padding-right: .5em
  padding-top: 1.5em
  text-align: right
.command-symbol-r
  margin: -1.5em 0.25em 0.25em 0
  text-align: right
.command-symbol-l
  margin: -1.5em 0 0.25em 0.25em
  text-align: left
  
//Type sizing
span
  font-size: 55%
.top,
.bottom
  font-size: 80%
.command-symbol-l,
.command-symbol-r
  font-size: 90%
 
//Multi-label keys
.top  
  margin-top: -.75em
.bottom
  margin-top: .25em
.t-higher
  margin-top: -1em
.b-closer
  margin-top: 0
  
//Arrow keys
.key-arrow
  height: 1.35em
  padding: 0
.key-arrow-u
  position: absolute
svg
  width: 0.25em
  margin: 0.5em auto
  
//Active
.is-active
  background-image: linear-gradient(#3092d9, #50abe3)
  border-bottom-color: #4998c9
  border-top-color: #349fec
  box-shadow: 0 1px 3px rgba(15,42,60,.8), inset 0 0 3px #6bbaf0
  color: #fff
  text-shadow: 0 1px 0 #205f8c
  cursor: pointer
  
.is-active:before,
.is-active:after
  background-image: linear-gradient(#349fec, #4998c9)
              
            
!

JS

              
                # JS concept contributed by Nick Walsh 
# https://twitter.com/nickawalsh
$ ->
  $(window).on 'keypress', (e) ->
    $('.key').removeClass('is-active')
    $("[data-key=#{e.which}]").addClass('is-active')
              
            
!
999px

Console