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

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.

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

              
                - var movieList = [{title: "Ocean's Eleven", cast: ["Julia Roberts", "George Clooney", "Brad Pitt", "Andy Garcia"], genres: ["Comedy", "Thriller"], posterImage: "https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/oceans11.jpg", imdbURL: "http://www.imdb.com/title/tt0240772/", rating: 9.2}, {title: "Pirates of the Caribbean", cast: ["Johnny Depp", "Keira Knightley", "Orlando Bloom"], genres: ["Adventure", "Comedy"], posterImage: "https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/piratesmovie.jpg", imdbURL: "http://www.imdb.com/title/tt0325980/", rating: 9.7}];

mixin movie-card(movie)
  div.movie-card
    a(href=movie.imdbURL)
      h2.movie-title= movie.title
    img.movie-poster(src=movie.posterImage)
    h3 Cast
    ul.cast
    each actor in movie.cast
      li= actor
    div.rating
      if movie.rating > 5
        img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/thumbsup.png")
      else
        img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/thumbsdown.png")
    ul.genre
      each genre in movie.genres
        li= genre

for movie in movieList
  +movie-card(movie)
              
            
!

CSS

              
                body {
  padding: 0 20px;
}
              
            
!

JS

              
                
              
            
!
999px

Console