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

              
                .card
  
  %a.card-media(href='#')
    %img.card-media-img(src='http://placehold.it/370x208/9b7eac/9b7eac' alt='' width='370' height='208')
  
  .card-content
    
    %h2.card-title
      %a(href='#') My Pen Title
      
    .card-meta.split
    
      .split-cell
        %a.bucket(href='#')
          %img.bucket-media(src='http://placehold.it/20x20/b5bc67/b5bc67' alt='' width='20' height='20')
          %h3.bucket-content.card-meta-author Author Name
        
      .split-cell
        %ul.card-meta-statList
          %li.card-meta-statList-item
            %a(href='#') 204
          %li.card-meta-statList-item
            %a(href='#') 12
          %li.card-meta-statList-item
            %a(href='#') 22
              
            
!

CSS

              
                // -------------------------------------
//   Variables
// -------------------------------------

$breakpoint: 400px
$darkGray: #191919
$mediumGray: #2f2f31
$lightGray: #999
$radius: 2px
$space: 20px

// -------------------------------------
//   Helpers
// -------------------------------------

=respond-to($val, $query: min-width, $media: screen)
  @media #{$media} and ($query: $val)
    @content

// -------------------------------------
//   Base
// -------------------------------------

body
  background-color: $darkGray
  color: $lightGray
  font-family: 'Montserrat'
  padding: $space
  
// ----- Headings ----- //
  
h1, h2, h3,
h4, h5, h6
  margin-bottom: $space * 0.25
  margin-top: 0
  
// ----- Lists ----- //
  
ul
  list-style-type: none
  margin: 0
  padding: 0
  
// ----- Links ----- //
  
a
  color: $lightGray
  text-decoration: none
  transition: 0.2s ease-in-out
  
  &:active,
  &:focus,
  &:hover
    color: #fff
  
// ----- Images ----- //
  
img
  height: auto
  max-width: 100%

// -------------------------------------
//   Bucket
// -------------------------------------
  
.bucket
  
  +respond-to($breakpoint)
    align-items: center
    display: flex
  
// ----- Content ----- //
  
.bucket-content
  flex-grow: 1
  
// ----- Media ----- //
  
.bucket-media
  flex-shrink: 1
  margin-right: $space * 0.5
  
  > img
    display: block
    
// -------------------------------------
//   Card
// -------------------------------------
  
.card
  background-color: $mediumGray
  border-radius: $radius
  margin: 0 auto // For demo display purposes
  padding: $space * 0.25
  max-width: 370px // For demo display purposes
  text-align: center
  
  +respond-to($breakpoint)
    text-align: left
  
// ----- Content ----- //
  
.card-content
  padding: ($space * 0.75) ($space * 0.5) ($space * 0.25)
  
// ----- Shared ----- //
  
.card-media,
.card-media-img,
.card-title
  display: block
  
.card-meta-author,
.card-meta-statList
  font-size: 12px
  
.card-meta,
.card-meta-statList
  
  +respond-to($breakpoint)
    display: flex
  
// ----- Meta: Author ----- //
  
.card-meta-author
  font-weight: normal
  margin-bottom: $space * 0.5
  
  +respond-to($breakpoint)
    margin-bottom: 0
  
// ----- Meta: Stat List: Item ----- //
  
.card-meta-statList-item
  display: inline
  
.card-meta-statList-item:not(:last-child)
  margin-right: $space * 0.5
  
// ----- Title ----- //
  
.card-title
  font-size: 16px
  margin-bottom: $space * 0.75
  
// -------------------------------------
//   Split
// -------------------------------------
  
.split
  display: block
  
  +respond-to($breakpoint)
    align-items: center
    display: flex
  
// ----- Cell ----- //
  
.split-cell

  &:first-child
    flex-grow: 1

  &:last-child
    flex-shrink: 0
              
            
!

JS

              
                
              
            
!
999px

Console