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

              
                <div class="bear"></div>
              
            
!

CSS

              
                html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  font-size: 1vmin;
  background: linear-gradient(to bottom right, white 50%, #eee 50%);
}

.bear {
  position: relative;
  box-sizing: border-box;
  margin: auto;
  height: 40em;
  width: 40em;
  border-radius: 50%;
  filter:
    // Bear Outline
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%))
    drop-shadow(0 0 1px darken(SaddleBrown, 30%));
  background-color: #222; // Nose
  box-shadow:
    // Shadow
    inset -6em 0 rgba(black, 0.1),
    // Head
    inset 0 11em 0 8em darken(SaddleBrown, 10%),
    // Mouth
    inset 0 0 0 15em SaddleBrown, 
    // Right Inner Ear
    -11.5em -16.5em 0 -16.5em mix(white, lighten(SaddleBrown, 15%), 40%),
    // Right Inner Ear Shadow
    -12em -16em 0 -16em mix(white, lighten(SaddleBrown, 15%), 20%),
    // Right Inner Ear
    12.5em -15.5em 0 -16.5em mix(white, lighten(SaddleBrown, 15%), 40%),
    // Right Inner Ear Shadow
    12em -16em 0 -16em mix(white, lighten(SaddleBrown, 15%), 20%),
    // Right Outer Ear
    -12em -16em 0 -14em darken(SaddleBrown, 15%),
    // Left Outer Ear
    12em -16em 0 -14em darken(SaddleBrown, 15%),
    // Nose Shadow
    inset -5em -29em 0 -10em black;
}

.bear::before,
.bear::after {
  content: '';
  display: block;
  border-radius: 50%;
  background-color: transparent;
  position: absolute;
  z-index: 5;
}

.bear::before {
  height: 10em;
  width: 5em;
  top: 7em;
  left: calc(50% - 2.5em);
  box-shadow:
    // Right Eye Reflection
    -6em 0 0 -2em #333,
    // Right Eye Pupil
    -5.5em 0 0 -1em black,
    // Right Eye
    -5.5em 0 0 0 white,
    // Left Eye Refelction
    5em 0 0 -2em #333,
    // Left Eye Pupil
    5.5em 0 0 -1em black,
    // Left Eye
    5.5em 0 0 0 white, 
    // Mouth-Nose Split
    0 15em 0 -2.5em black
  ;
}

.bear::after {
  height: 10em;
  width: 10em;
  top: 29.5em;
  left: calc(50% - 5em);
  box-shadow:
    // Mouth
    0 -1em 0 -0.75em black,
    // Whisker Left Top
    6em -10em 0 -4.75em darken(SaddleBrown, 5%),
    // Whisker Left Middle
    8em -8em 0 -4.75em darken(SaddleBrown, 5%),
    // Whisker Left Bottom
    6em -6em 0 -4.75em darken(SaddleBrown, 5%),
    // Whisker Right Top
    -6em -10em 0 -4.75em darken(SaddleBrown, 5%),
    // Whisker Right Middle
    -8em -8em 0 -4.75em darken(SaddleBrown, 5%),
    // Whisker Right Bottom
    -6em -6em 0 -4.75em darken(SaddleBrown, 5%);
}
              
            
!

JS

              
                
              
            
!
999px

Console