cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              input(type='radio', name='choice', id='spaces', checked)
input(type='radio', name='choice', id='tabs')
mixin card(content, answer, id)
  .card(class=`${answer ? 'card--answer' : ''} ${id ? `card--${id}` : ''}`)
    .card__content= content
    footer.card__footer
      -if(answer)
        img(src="http://blog.codepen.io/wp-content/uploads/2012/06/Button-Black-Small.png")
      -else
        img(src="http://blog.codepen.io/wp-content/uploads/2012/06/Button-White-Small.png")
      span Cards Against Developers

label(for='tabs')
label(for='spaces')
+card('_______ are better than _______.')
+card('Tabs.', true, 'tabs')
+card('Spaces.', true, 'spaces')
            
          
!
            
              *
  box-sizing border-box

input
  visibility hidden

body
html
  align-items center
  background #db0a5b
  display flex
  font-size 10px
  justify-content center
  margin 0
  min-height 100vh
  padding 0

  @media(min-width 768px)
    font-size 14px

  @media(min-width 992px)
    font-size 16px

$cardWidth = 20rem
.card
  background #000
  border-radius 1.25rem
  color #fff
  filter drop-shadow(5px 5px 5px black)
  flex-shrink 0
  font-family 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif
  font-size 1.5rem
  font-weight bolder
  height ($cardWidth * 1.4)
  padding 2.5rem
  position absolute
  transition transform .25s ease-out
  width $cardWidth


  &:nth-of-type(1)
    transform translate(-40%, 0) rotate(-15deg)

  &__footer
    align-items center
    bottom 30px
    display flex
    font-size .75rem
    left 2.5rem
    position absolute
    right 2.5rem

    img
      height 2rem
      margin-right 6px
      width 2rem

  &--answer
    color #000
    background #fff


#spaces:checked
  ~ .card--spaces
    transform translate(40%, 0) rotate(15deg) translate(0, 10%)
    z-index 2
  ~ .card--tabs
    transform translate(40%, 0) rotate(15deg) translate(0, -10%)
    z-index 1
  ~ label[for='tabs']
    z-index 3

#tabs:checked
  ~ .card--tabs
    transform translate(40%, 0) rotate(15deg) translate(0, 10%)
    z-index 2
  ~ .card--spaces
    transform translate(40%, 0) rotate(15deg) translate(0, -10%)
    z-index 1
  ~ label[for='spaces']
    z-index 3

label
  cursor pointer
  height ($cardWidth * 1.4) * 1.2
  position absolute
  transform translate(40%, 0) rotate(15deg)
  width $cardWidth
            
          
!
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