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

              
                %main.page
  
  %header.site-header
    %h1.site-header__title codepen kitchen
  
  %article.recipe
    %h2.recipe__title four-bean chili
    <img class="recipe__headshot" src="https://pbs.twimg.com/profile_images/434065497554841600/VwVa5cy__bigger.png" alt="Chris Coyier"><h4 class="recipe__author">chris coyier</h4>
    %p.recipe__cook-time Total time: 1 hr 30 min  &bull;  Prep time: 20 min  &bull;  Cook time: 1 hr 10 min
    
    %p.recipe__description--hero My grandpappy used to make this chili over the campfire under the Texas stars. The secret ingredient was a little squeeze of scorpion venom in the pot.
    
    %section.recipe-card
      %h3.recipe-card__title ingredients
      %ul.recipe-card__contents
        %li.recipe-card__contents--list-item 1lb ground bison
        %li.recipe-card__contents--list-item 1 cup diced onion
        %li.recipe-card__contents--list-item 4 diced jalepeños
        %li.recipe-card__contents--list-item 1 cup black beans
        %li.recipe-card__contents--list-item 1 cup great northern beans
        %li.recipe-card__contents--list-item 1 cup kidney beans
        %li.recipe-card__contents--list-item 1 cup pinto beans
        %li.recipe-card__contents--list-item 4 cloves garlic
        %li.recipe-card__contents--list-item 2 tbsp mexican chili powder
        %li.recipe-card__contents--list-item 2 tsp salt
        %li.recipe-card__contents--list-item 2 tsp ground pepper
        %li.recipe-card__contents--list-item 1 tsp cayenne
        %li.recipe-card__contents--list-item 28oz smushed tomatoes
        %li.recipe-card__contents--list-item 3 cups beef broth
        
    %section.recipe-card
      %h3.recipe-card__title directions
      %p.recipe-card__contents Get your filthiest campfire-scorched Dutch oven over the fire the best you can situate it. Brown the bison. Add the diced onion and spices, sautee until soft. Add tomatoes and broth and bring to a simmer for 40 minutes. Add beans and cook another 30 minutes.
      %p.recipe-card__contents Serve with Tabasco and a giant spoon.
              
            
!

CSS

              
                @import "bourbon";

/* |Variables
============================== */

//colors
$c1: #fadd99; //tan
$c2: #ff94c0; //pink
$c3: darken(#71a6f7,5%); //baby-ish blue
$c4: #333333; //dark gray (it's explosive)
$c5: #dedede; //silver
$c6: #fefefe; //white

//fonts
$f1: 'Montserrat', sans-serif;
$f2: 'PT Mono', monospace;

/* |Styles
============================== */

* { @include box-sizing(border-box); }

html {
  background: $c1 url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/chili.jpg) left top no-repeat fixed;
  background-size: 786px 1089px;
  color: $c4;
  font-family: $f1;
  font-size-adjust: auto;
  -webkit-font-smoothing: antialiased;
}

.page {
  background: $c1 url(https://i.imgur.com/PJt1bx5.png);
  float: right;
  width: 62%;
  @include clearfix;
}

.site-header {
  background-image:
    repeating-linear-gradient(
      90deg,
      $c2,
      $c2 36px,
      lighten($c2,5%) 36px,
      lighten($c2,5%) 72px);
  border-bottom: 3px solid darken($c2,5%);
  width: 100%;
  
  &__title {
    font: {
      size: 3.375rem;
      weight: 700;
    }
    line-height: 1;
    margin: 0;
    padding: 2rem 0 2.25rem;
    text: {
      align: center;
      shadow: //can't do a proper text-stroke, so we do this instead. sorry mom.
        1px 1px 0px $c6,
        -1px 1px 0px $c6,
        1px -1px 0px $c6,
        -1px -1px 0px $c6;
      transform: uppercase;
    }
  } //end .site-header__title
  
  .icon-codepen-logo { position: relative; top: 0.25rem; }
} //end .site-header

.recipe {
  margin: 0 auto;
  max-width: 768px;
  width: 90%;
  
  &__title {
    color: $c3;
    font: {
      size: 3.375rem;
      weight: 700;
    }
    line-height: 1;
    margin: 4.5rem 0 1rem;
    text: {
      shadow:
        1px 0px 1px darken($c3,20%),
        0px 1px 1px darken($c3,35%),
        2px 1px 1px darken($c3,20%);
      transform: uppercase;
    }
  } //end .recipe__title
  
  &__headshot {
    border-radius: 50%;
    display: inline-block;
    height: 54px;
    position: relative;
    width: 54px;
  } //end .recipe__headshot
  
  &__author {
    display: inline-block;
    font: {
      size: 1.5rem;
      weight: 700;
    }
    line-height: 1;
    margin: 0 0 0.25rem 0.75rem;
    text-transform: capitalize;
    @include position(relative, -1.1rem 0 0 0);
  } //end .recipe__author
  
  &__cook-time {
    font: {
      size: 1rem;
      weight: 400;
    }
    margin: 0.75rem 0 4.5rem;
  } //end .recipe__cook-time
  
  &__description--hero {
    border-left: 1rem solid $c2;
    font: {
      size: 1.5rem;
      weight: 400;
    }
    line-height: 1.5;
    margin: 0 0 5rem;
    padding-left: 1.25rem;
  } //end .recipe__description--hero
} //end .recipe

.recipe-card {
  background: $c6;
  box-shadow: 0px 2px 6px lighten($c4,25%);
  margin-bottom: 2.25rem;
  padding: 1.5rem;
  
  &__title {
    color: $c3;
    font: {
      size: 2.25rem;
      weight: 400;
    }
    line-height: 1;
    margin: 0 0 1rem;
    text-transform: capitalize;
  } //end .recipe-card__title
  
  &__contents {
    font: {
      family: $f2;
      size: 1.5rem;
      weight: 400;
    }
    line-height: 1.5;
    margin: 0.5rem 0 1.5rem;
    list-style-type: square;
  } //end .recipe-card__contents
} //end .recipe-card
              
            
!

JS

              
                /* </> w/ <3 :) */
              
            
!
999px

Console