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

              
                .container
  .response-group
    header
      h2 
        strong Lesson Title
        i.fa.fa-angle-right
        span.header-dropdown-trigger Activity Title
    .header-dropdown
      .panel
        ul
          - 4.times do
            li 
              h2 Activity Title
              span 2/4
              .progress
                .progress__complete
              
    .response
      .response__number 1
      h1.response__title Coffee emporium avondale humid german rivertown vine street findlay market historic architecture?
      .post-group
        -3.times do
          .post
            .post__avatar
            h3.post__author Lester McTester
            h4.post__timestamp Oct 13 at 8:51pm 
            p.post__body Hamilton county river front museum center washington park breweries walnut hills findlay market christian moerlein flying pig ohio valley jazz festival union terminal fifty west coffee emporium chili.
            .post__actions
              .button.button--approve
                i.fa.fa-thumbs-o-up
                i.fa.fa-thumbs-up.solid
              .button.button--deny
                i.fa.fa-thumbs-o-down
                i.fa.fa-thumbs-down.solid
              .button.button--fill.comment-trigger
                span Comment...
              .button.button--flag
                i.fa.fa-comment-o
                i.fa.fa-comment.solid
                | 2
              .post__comments
                .comment-group
                  - 2.times do
                    .post
                      .post__avatar.comment__avatar
                      h3.post__author Lester McTester
                      h4.post__timestamp Oct 13 at 8:51pm 
                      p.post__body Hamilton county river front museum center washington park breweries walnut hills findlay market christian moerlein flying pig ohio valley jazz festival union terminal fifty west coffee emporium chili.
                .comment-form
                  .comment-form__avatar
                  textarea
                  .comment-form__actions
                    .button.button--light.cancel Cancel
                    .button.button--confirm Comment
                    
              
            
!

CSS

              
                $lightgray: #ebeff1
$gray: #cdd7dc
$darkgray: #89989c
$green: #5fbc71
$blue: #4ab2d9
$red: #f26f54

$padding: 15px
$border-radius: 2px
$box-shadow: 0 2px 1px rgba(0, 0, 0, 0.15)
  
*
  box-sizing: border-box

html
  color: #4d4d4d
  background-color: $lightgray
  font-family: "Signika"
  font-size: 16px
  font-weight: 300
  text-rendering: optimizeLegibility 
  -webkit-font-smoothing: antialiased
    
h1
  font-size: 26px
  font-weight: 700
  
h2
  font-size: 18px
  font-weight: 400
  
h3
  font-size: 18px
  font-weight: 700
  
h4
  font-size: 12px
  font-weight: 400
  color: $darkgray
  
ul
  list-style: none
  padding: 0
  margin: 0
  
%avatar
  position: absolute
  top: 15px
  left: 15px
  height: 50px
  width: 50px
  background-color: $darkgray
  border-radius: 50%
  
%button
  position: relative
  display: inline-block
  width: initial
  height: 35px
  padding: 0 10px
  margin-left: 15px
  background-color: white
  color: #4ab2d9
  line-height: 35px
  font-weight: 400
  text-align: center
  border-radius: $border-radius
  cursor: pointer
  border: 1px solid #4ab2d9
  -webkit-transition: all 0.1s
  -o-transition: all 0.1s
  transition: all 0.1s
  &:hover
    background-color: $blue
    color: #FFF
    
%panel
  position: relative
  padding: $padding
  background-color: #FFF
  border-radius: $border-radius
  box-shadow: $box-shadow
  
.panel
  @extend %panel
  
.container
  width: 90%
  max-width: 900px
  margin: 50px auto 100px
  
.response-group
  position: relative
  width: 100%
  padding: 100px $padding $padding
  background-color: #fff
  border-radius: $border-radius
  box-shadow: $box-shadow
  > header
    position: absolute
    top: 0
    left: 0
    right: 0
    padding: 5px $padding
    background-color: transparentize(#FFF,0.25)
    border-radius: $border-radius
    box-shadow: $box-shadow
    z-index: 100
    i
      margin: 0 10px 0 20px
    .header-dropdown-trigger
      border: 1px solid transparent
      padding: 10px
      border-radius: $border-radius
      cursor: pointer
      &:after
        content: "\f078"
        font-family: "FontAwesome"
        font-size: 0.5em
        line-height: 2.5
        vertical-align: top
        margin-left: 5px
      &:hover, &.active
        border: 1px solid $gray
  > .header-dropdown
    display: none
    position: relative
    top: -38px
    left: -16px
    width: calc(100% + 32px)
    padding: $padding 1px
    background: $lightgray
    &.expand
      display: block
    ul
      margin: -$padding
      //padding: 10px 0
    li
      padding: 1em $padding
      cursor: pointer
      border-bottom: 1px solid $lightgray
      h2
        display: inline-block
        margin: 0
      &:hover h2
        font-weight: 700
      span
        float: right
        margin-left: 15px
        line-height: 1.25
    .progress
      float: right
      width: 50%
      margin: 0.25em 0
      
.progress
  position: relative
  width: 100%
  height: 0.75em
  border-radius: 2px
  background-color: $lightgray
  box-shadow: 0 1px 1px rgba(0,0,0,0.1) inset
    
.progress__complete
  position: absolute
  top: 0
  width: 50%
  height: 0.75em
  background-color: $green
  border-radius: 2px
  box-shadow: $box-shadow

.response
  position: relative

.response__number
  position: absolute
  width: 2rem
  height: 2rem
  line-height: 1.8rem
  font-size: 1.2em
  font-weight: 700
  text-align: center
  color: $darkgray
  border: 2px solid $gray
  border-radius: 50%
  
.response__title
  margin-left: 3.25rem
  margin-bottom: 50px  
    
.post-group
  margin-left: 3.5rem
  
.post
  position: relative
  padding: $padding $padding 0 80px
  margin-bottom: 50px
  border: 1px solid $lightgray
  border-bottom: none
  box-shadow: $box-shadow
  
.post__avatar
  @extend %avatar
  
.post__author
  margin-top: 5px
  margin-bottom: 5px 
  
.post__timestamp
  margin-top: 0

.post__actions
  height: 40px
  width: calc(100% + 95px)
  margin-left: -80px
  background-color: $lightgray
  border-top: 1px solid $lightgray
  .button
    float: left
    height: 40px
    width: 40px
    line-height: 40px
    text-align: center
    vertical-align: top
    border-right: 1px solid $gray
    i.solid
      display: none
    &:not(.comment):active i
      transform: scale(1.2)
    &:not(.comment-trigger):hover, &:not(.comment-trigger).active
      background-color: #FFF
      cursor: pointer
      i.solid
        display: inline-block
      i:not(.solid)
        display: none
      &.button--approve
        color: $green
      &.button--deny
        color: $red
  .button--flag
    width: 60px
    border-right: none
    font-weight: 400
    i
      margin-right: 5px
  .button--fill
    width: calc(100% - 140px)
    padding: 0 10px
    text-align: left
    font-size: 16px
    font-weight: 400
    color: $darkgray
    
.post__comments
  display: none
  padding: 15px

.comment-group
  padding-bottom: $padding
  .post
    padding: $padding $padding 0 65px
    margin-bottom: 15px
    box-shadow: none
  .post__avatar
    height: 35px
    width: 35px

.comment-form
  @extend %panel
  height: 100%
  padding: $padding $padding $padding 65px 
  textarea
    width: 100%
    height: 4em
    margin-bottom: 10px
    font-size: 16px
    border: 1px solid $gray
    border-radius: $border-radius
    box-shadow: 0 1px 1px $lightgray inset
    &:focus
      outline: none

.comment-form__avatar
  @extend %avatar
  height: 35px
  width: 35px

.comment-form .comment-form__actions
  text-align: right
  .button
    @extend %button
    float: none
  .button--confirm
    border-color: $green
    color: $green
    &:hover
      background-color: $green
      color: #FFF
  .button--light
    border-color: transparent
    color: $darkgray
    &:hover
      background-color: $darkgray
      color: #FFF

.post--commenting
  .post__actions
    height: initial
  .button.comment-trigger span
    display: none
  .post__comments
    display: block
    margin-top: 40px
    border-top: 1px solid $gray

              
            
!

JS

              
                $( ".header-dropdown-trigger" ).click(function() {
  $( this ).toggleClass( "active" );
  $( ".header-dropdown" ).toggleClass( "expand" );
});

$( ".header-dropdown li" ).click(function() {
  $( ".header-dropdown-trigger" ).removeClass( "active" );
  $( ".header-dropdown" ).removeClass( "expand" );
});

$( ".button--approve" ).click(function() {
  $( this ).toggleClass( "active" );
  $( this ).siblings( '.button--deny' ).removeClass( "active" );
});

$( ".button--deny" ).click(function() {
  $( this ).toggleClass( "active" );
  $( this ).siblings( '.button--approve' ).removeClass( "active" );
});

$( ".comment-trigger" ).click(function() {
  $( this ).parent().parent().toggleClass( "post--commenting" );
});

$( ".button--flag" ).click(function() {
  $( this ).parent().parent().toggleClass( "post--commenting" );
});


$( ".button--confirm" ).click(function() {
  $( this ).parent().parent().parent().parent().parent().toggleClass( "post--commenting" );
});

$( ".button.cancel" ).click(function() {
  $( this ).parent().parent().parent().parent().parent().toggleClass( "post--commenting" );
});
              
            
!
999px

Console