Pen Settings



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


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


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.


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.


    - 5.times do |i|
        %h2= i + 1
      %h2 6

  %button.toggle Prev
  %button.toggle{'data-toggle' => 'next'} Next


                // ----- Carousel ----- //

  overflow: hidden

  display: flex
  left: -100%
  list-style: none
  margin: 0
  padding: 0
  position: relative
  transform: translateX(100%)
  @media (min-width: 30em)
    left: -50%
    transform: translateX(50%)
  @media (min-width: 40em)
    left: -33.33333%
    transform: translateX(33.33333%)
// States
  transform: translateX(-100%)
  @media (min-width: 30em)
    transform: translateX(-50%)
  @media (min-width: 40em)
    transform: translateX(-33.33333%)
  transform: none
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1)
// ----- Seats ----- //
  background: #ddd
  flex: 1 0 100%
  order: 2
    background: #d5d5d5
  @media (min-width: 30em)
    flex-basis: 50%
  @media (min-width: 40em)
    flex-basis: 33.33333%
// States
  order: 1
// ----- Presentation ----- //

  color: #aaa
  font-size: 7em
  font-weight: normal
  margin: 0
  padding: 0.6em 0
  text-align: center
  padding: 2em
  text-align: center
    background: #aaa
    border: 0
    border-radius: 0.25em
    color: #eee
    padding: 0.5em 1em
      background: magenta


                carousel = $('.carousel')
seats = $('.carousel-seat')

next = (el) -> if > 0 then else seats.first()
prev = (el) -> if el.prev().length > 0 then el.prev() else seats.last()

$('.toggle').on('click', (e) ->
  el = $('.is-ref').removeClass('is-ref')

  if $(e.currentTarget).data('toggle') is 'next'
    new_seat = next(el)
    new_seat = prev(el)
  new_seat.addClass('is-ref').css('order', 1)
  new_seat = next(new_seat).css('order', i) for i in [2..seats.length]
  setTimeout (-> carousel.addClass('is-set')), 50