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 id="critter"></div>
              
            
!

CSS

              
                // #divtober 22: Critter
// a.singlediv.com/divtober2021

black(alpha)
  rgba(0,0,0,alpha)

white(alpha)
  rgba(255,255,255,alpha)

body
  min-height: 250px
  height: 100vh
  position: relative
  background-color: white

div
  position: absolute
  left: 50%
  top: 50%

  &:before,
  &:after
    display: block
    content: ''
    position: absolute
    
  @media (max-width: 400px)
    transform: scale(.8)

#critter
  box-sizing: border-box
  font-size: 10px
  width: 20em
  height: 20em
  margin-left: -(@width/2 + 2.2em)
  margin-top: -(@height/2)
  background-repeat: no-repeat
  background-image: radial-gradient(ellipse, black 40%, black(0) 41%),
                    linear-gradient( 80deg, white(0) 70%, #aaa 71%),
                    linear-gradient(-80deg, white(0) 70%, #aaa 71%),
                    linear-gradient( 150deg, white(0) 50%, #aaa 51%),
                    linear-gradient(-150deg, white(0) 50%, #aaa 51%),
                    radial-gradient(circle, black 40%,
                                            white(.3) 41%,
                                            white(.3) 50%,
                                            white(0) 51%),
                    radial-gradient(circle, black 40%,
                                            white(.3) 41%,
                                            white(.3) 50%,
                                            white(0) 51%),
                    radial-gradient(ellipse, #444 50%, black(0) 51%),
                    radial-gradient(ellipse, white 50%, white(0) 51%),
                    radial-gradient(circle at 50% 0, mediumturquoise 60%,
                                                     alpha(mediumturquoise,0) 61%),
                    radial-gradient(circle, alpha(gold,.6) 50%, alpha(gold,0) 51%),
                    radial-gradient(circle, gold 50%, alpha(gold,0) 51%),
                    radial-gradient(circle, alpha(gold,.5) 50%, alpha(gold,0) 51%),
                    radial-gradient(circle, gold 50%, alpha(gold,0) 51%),
                    radial-gradient(circle, gold 50%, alpha(gold,0) 51%),
                    radial-gradient(circle, alpha(gold,.7) 50%, alpha(gold,0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%),
                    radial-gradient(circle, white 50%, white(0) 51%),
                    linear-gradient( 100deg, white(0) 20%, #aaa 21%),
                    linear-gradient(-100deg, white(0) 20%, #aaa 21%),
                    radial-gradient(ellipse, black(.3) 50%, black(0) 51%),
                    radial-gradient(ellipse, #aaa 50%, white(0) 51%),
                    radial-gradient(ellipse, black(.3) 50%, black(0) 51%),
                    radial-gradient(ellipse, #aaa 50%, white(0) 51%)
  background-size: 3em 2em,
                   3em 4em,
                   3em 4em,
                   3em 3em,
                   3em 3em,
                   2em 2em,
                   2em 2em,
                   12em 6em,
                   14em 7em,
                   10em 5em,
                   1em 1em,
                   1em 1em,
                   2em 2em,
                   .6em .6em,
                   1em 1em,
                   1.3em 1.3em,
                   2em 2em,
                   4em 4em,
                   1.5em 1.5em,
                   3em 3em,
                   4em 4em,
                   10em 15em, 10em 15em,
                   2em 3em, 4em 5em,
                   2em 3em, 4em 5em
  background-position: 50% 10em,
                       left  7em top 6em,
                       right 7em top 6em,
                       left  7em top 9em,
                       right 7em top 9em,
                       left  7.4em top 8em,
                       right 7.4em top 8em,
                       50% 6em,
                       50% 5.1em,
                       left 50% bottom -1em,
                       left  5.8em bottom 4.2em,
                       left  7.5em bottom 5.3em,
                       left  8.0em bottom 3.6em,
                       left 10.0em bottom 4.9em,
                       left 11.0em bottom 5.2em,
                       left 11.8em bottom 4.3em,
                       left  5.5em bottom 3.6em,
                       left  6.5em bottom 3.3em,
                       left  9.0em bottom 5.2em,
                       left  9.0em bottom 3.3em,
                       left 10.5em bottom 2.9em,
                       left  2em bottom 0,
                       right 2em bottom 0,
                       left  5em top 2.5em,
                       left  4em top 1em,
                       right 5em top 2.5em,
                       right 4em top 1em

  &:before
    width: 6em
    height: 19em
    right: -4em
    bottom: 0
    background-color: #aaa
    background-repeat: no-repeat
    background-image: repeating-linear-gradient(to bottom, #444,
                                                           #444 2.2em,
                                                           #aaa 2.2em,
                                                           #aaa 4.4em)
    border-radius: 5em 0

  &:after
    width: 10em
    height: .6em
    left: 5em
    bottom: 4em
    background-color: turquoise
    border-radius: (@height/2)
              
            
!

JS

              
                // @lynnandtonic
// a.singlediv.com

              
            
!
999px

Console