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

              
                %h1 Subway

.line.line--orange B
.line.line--orange D
.line.line--orange F
.line.line--orange M

.line.line--blue A
.line.line--blue C
.line.line--blue E

.line.line--yellow N
.line.line--yellow Q
.line.line--yellow R

.line.line--red 1
.line.line--red 2
.line.line--red 3

.line.line--gray L

.line.line--light-green G

.line.line--purple 7
.line.line--purple.line--express
    %span 7

.line.line--green 4
.line.line--green 5
.line.line--green 6
.line.line--green.line--express
    %span 6

.line.line--brown J
.line.line--brown Z

.line.line--dark-gray S

%a{:href => '//codepen.io/ChrisNager', :target => '_blank' } Crafted by Chris Nager
              
            
!

CSS

              
                @import compass

$dimension: 50
$bg-color: #eee
$line-colors: orange blue yellow red gray light-green purple green brown dark-gray
$line-hexcodes: #ff6318 #2850ad #fccc33 #ee352e #a7a9ac #6cbe45 #b933ad #00933c #996633 #808183

=long-shadow($bg-color)
    $value: null
    $shadow-color: darken($bg-color, 15%)
    @for $i from 1 through $dimension / 1.25
        $value: #{$i}px #{$i}px 0 #{$shadow-color}, $value
    text-shadow: $value
    background-color: $bg-color

html
    background-color: #222
    font: 600 $dimension / 1.25 + px 'Helvetica Neue', Helvetica, sans-serif
    font-smoothing: antialiased
    color: white

h1
    border-top: 2px solid
    padding-right: #{$dimension / 5}px
    padding-left: #{$dimension / 5}px
    font-size: 1.25em
    line-height: 1.05
    letter-spacing: -1px

a
    margin-top: 8em
    margin-right: #{$dimension / 5}px
    margin-left: #{$dimension / 5}px
    float: left
    clear: left
    font-size: 0.5em
    line-height: 1
    text-decoration: none
    color: rgba(255, 255, 255, 0.065)
    transition: 500ms
    &:hover,
    &:focus
        color: white
 
.line
    width: #{$dimension}px
    height: #{$dimension}px
    margin: #{$dimension / 5}px
    border-radius: #{$dimension}px
    position: relative
    float: left
    overflow: hidden
    line-height: #{$dimension}px
    text-align: center
    +long-shadow(darken($bg-color, 15%))
    color: white

.line--express,
.line--express > span
    width: #{$dimension - 6}px
    height: #{$dimension - 6}px

.line--express
    margin: #{$dimension / 5 + 3}px
    border-radius: 0
    line-height: #{$dimension - 8}px
    transform: rotate(45deg)

.line--express > span
    display: block
    transform: rotate(-45deg)

@for $i from 0 to length($line-colors)
    .line--#{nth($line-colors, $i + 1)}
        +long-shadow(nth($line-hexcodes, $i + 1))

.line--yellow
    color: black
              
            
!

JS

              
                
              
            
!
999px

Console