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

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

              
                input#toggle.sr-only(type="checkbox")
label(for="toggle")
.box
  span think
h1 Tap!
              
            
!

CSS

              
                :root
  --step 0.2s
  --open-deg 130deg
  --slide 55%
  --bg hsl(0, 0%, 92%)
  --stroke hsl(0, 0%, 15%)

*
*:after
*:before
  box-sizing border-box
  
body
  display grid
  place-items center
  min-height 100vh
  background var(--bg)
  
span
  font-family sans-serif
  font-size 10vmin
  font-weight 500
  
@property --think-y-out
  inherits true
  syntax '<percentage>'
  initial-value 0%

@property --think-y-down
  inherits true
  syntax '<percentage>'
  initial-value 0%
  
@property --think-x
  inherits true
  syntax '<percentage>'
  initial-value 0%
  
@property --box-open
  inherits true
  syntax '<angle>'
  initial-value 0deg
  
@property --box-close
  inherits true
  syntax '<angle>'
  initial-value 0deg
  
@property --box-x
  inherits true
  syntax '<percentage>'
  initial-value 0%
  
label
  height 100vh
  width 100vw
  position fixed
  z-index 2
  display block
  
.sr-only
  position absolute
  width 1px
  height 1px
  padding 0
  margin -1px
  overflow hidden
  clip rect(0, 0, 0, 0)
  white-space nowrap
  border-width 0
  
:checked ~ .box
  --box-open calc(var(--open-deg) * -1)
  --box-close calc(var(--open-deg) * 1)
  --box-x calc(var(--slide) * -1)
  --think-x calc(var(--slide) * 2)
  --think-y-out -100%
  --think-y-down 100%
  // Steps when opening
  --open-index 0
  --close-index 4
  --slide-index 2
  --up-index 1
  --down-index 3
  
.box
  // default transitions
  --open-index 4
  --close-index 0
  --slide-index 2
  --up-index 3
  --down-index 1
  
  aspect-ratio 1 / 1
  display grid
  place-items center
  position relative
  transform translate(var(--box-x), 0)
  transition --box-open var(--step) calc(var(--step) * var(--open-index)), --box-x var(--step) calc(var(--step) * var(--slide-index)), --box-close var(--step) calc(var(--step) * var(--close-index))
  
  &:after
  &:before
    --clip inset(1.1vmin 0 0 0)
    content ''
    box-shadow 0 0 0 1vmin var(--stroke) inset
    position absolute
    inset 0
    z-index -1
    -webkit-clip-path var(--clip, inset(1vmin 0 0 0))
    clip-path var(--clip, inset(1vmin 0 0 0))
  
  &:before
    --clip inset(0 0 calc(100% - 1.1vmin) 0)
    transform-origin 0.5vmin 0.5vmin
    transform rotate(var(--box-open)) rotate(var(--box-close))
    
span
  display grid
  place-items center
  height 100%
  width 100%
  padding 2vmin
  color var(--stroke)
  transition --think-y-out var(--step) calc(var(--step) * var(--up-index)), --think-x var(--step) calc(var(--step) * var(--slide-index)), --think-y-down var(--step) calc(var(--step) * var(--down-index))
  transform translate(var(--think-x), var(--think-y-out)) translate(0, var(--think-y-down))

  
h1
  position fixed
  bottom 1rem
  right 1rem
  font-size 2.5rem
  font-weight bold
  font-family sans-serif
  color hsl(0, 0%, 45%)
  margin 0
              
            
!

JS

              
                
              
            
!
999px

Console