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="drawing" role="img" aria-label="Cartoon of Santa Claus tired">
  <div class="leg"></div>
  <div class="leg"></div>
  <div class="shorts"></div>
  <div class="shaver"></div>
  <div class="hand-new"></div>
  <div class="hand"></div>
  <div class="arms"></div>
  <div class="body"></div>
  <div class="face">
    <div class="ear"></div>
    <div class="ear"></div>
    <div class="cheek"></div>
    <div class="cheek"></div>
    <div class="eye"></div>
    <div class="eye"></div>
    <div class="eyebrow"></div>
    <div class="eyebrow"></div>
    <div class="beard"></div>
    <div class="lip"></div>
    <div class="mustache"></div>
    <div class="mustache"></div>
    <div class="nose"></div>
    <div class="hair"></div>
  </div>
</div>
              
            
!

CSS

              
                body {
  background: #9ac;
}

.drawing {
  --skin: #fca;
  --skindark: #fa9;
  --suit: #c00;
  --wool: #f0f0f0;
  width: 80vmin;
  height: 80vmin;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.drawing div,
.drawing div::before,
.drawing div::after {
  position: absolute;
  display: block;
  box-sizing: border-box;
}

.face {
    width: 35%;
    height: 25%;
    background: 
      linear-gradient(#fff 0 0) 12% 86%,
      linear-gradient(#fff 0 0) 23% 94%,
      linear-gradient(#fff 0 0) 17% 91%,
      linear-gradient(#fff 0 0) 24% 88%,
      linear-gradient(#fff 0 0) 29% 92%,
      linear-gradient(#fff 0 0) 37% 93%,
      linear-gradient(#fff 0 0) 46% 96%,
      linear-gradient(#fff 0 0) 41% 96%,
      linear-gradient(#fff 0 0) 34% 89%,
      linear-gradient(#fff 0 0) 39% 90%,
      linear-gradient(#fff 0 0) 45% 89%,var(--skin);
    background-repeat: no-repeat;
    background-size: 0.5vmin 0.6vmin;
    border-radius: 50% 50% 38% 38%;
    left: 50%;
    top: 17%;
    transform: translateX(-50%);
    box-shadow: 0 -2vmin 0vmin var(--skin);
}
.face:before {
    content: "";
    position: absolute;
    width: 4vmin;
    left: 53%;
    transform: translate(-50%);
    top: -22%;
    aspect-ratio: 1;
    /* background: red; */
    border-radius: 100% 0 0 0;
    border-left: 2vmin solid #fff;
}
.eye {
  width: 20%;
  height: 17%;
  border-radius: 100%;
  top: 35%;
  left: 17%;
  background: radial-gradient(90% 55% at top,var(--skindark) 90%,#0000 ),radial-gradient(farthest-side,#000 90%,#0000 ) 50% 50%/30% 48% #fff;
    background-repeat: no-repeat;
}
.eye + .eye {
  left: 63%;
}

.eyebrow {
  width: 35%;
  height: 30%;
  border-radius: 100%;
  box-shadow: -0.125vmin -2.2vmin 0 -0.5vmin #fff;
  top: 25%;
  left: 8%;
}

.eyebrow + .eyebrow {
  right: 7.5%;
  left: auto;
}

.nose {
  width: 20%;
  height: 30%;
  border-radius: 100% / 120% 120% 80% 80%;
  background: var(--skin);
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  box-shadow: 
    inset -0.5vmin -0.5vmin 0.5vmin -0.25vmin var(--skindark),
    inset 0vmin -0.75vmin 0.5vmin -0.25vmin var(--skindark),
    inset 0.5vmin -1vmin 1vmin -0.75vmin var(--skindark);
}

.mustache {
  width: 30%;
  height: 30%;
  background: white;
  border-radius: 100% 0;
  top: 59%;
  left: 50%;
  transform: translate(-100%, 0) rotate(15deg);
  box-shadow: inset -0.25vmin -0.25vmin 0.75vmin #0002
}

.mustache + .mustache {
  transform: scaleX(-1) translate(0, 0) rotate(15deg);
}

.lip {
  width: 14%;
  height: 10%;
  background: var(--skindark);
  box-shadow: inset 0 -0.25vmin 0.75vmin #f003;
  border-radius: 50%;
  top: 73%;
  left: 50%;
  transform: translateX(-50%);
}

.beard {
  width: 100%;
  height: 100%;
  background: #fff;
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 100% / 20% 20% 120% 120%;
  abox-shadow: 0 0.5vmin #ddd;
  filter: drop-shadow(0 0.5vmin 0.5vmin #0002);
  clip-path:inset(0 -100% -100% 49%)
}

.beard::before {
  content: "";
  width: 22%;
  height: 30%;
  border-radius: 50%;
  background: #fff;
  left: -7%;
  top: 8%;
  color: #fff;
  box-shadow:
    2vmin 7vmin 0 2.5vmin,
    6vmin 12vmin 0 1vmin,
    16vmin 12vmin 0 2vmin,
    22vmin 10vmin 0 1vmin,
    24vmin 6vmin 0 1.6vmin,
    26vmin 0
    ;
}

.ear {
  width: 25%;
  height: 35%;
  border-radius: 50%;
  top: 40%;
  left: -15%;
  background:
    radial-gradient(circle at 100% 50%, var(--skindark) 50%, #0000 0) no-repeat 30% 60% / 50% 80%
    ;
  background-color: var(--skin);
}

.ear + .ear {
  right: -15%;
  left: auto;
  top: 42%;
  background:
    radial-gradient(circle at 0% 50%, var(--skindark) 50%, #0000 0) no-repeat 70% 60% / 50% 80%
    ;
  background-color: var(--skin);
}

.cheek {
  width: 30%;
  height: 25%;
  border-radius: 50%;
  top: 50%;
  left: 5%;
  background: radial-gradient(farthest-side, var(--skindark), #0000);
  opacity: 0.7;
}

.cheek + .cheek {
  left: auto;
  right: 4%;
}

.body {
  width: 70%;
  height: 80%;
  border-radius: 100% / 120% 120% 14% 20%;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  overflow: hidden;
  box-shadow: 
    inset 2.75vmin -2vmin 1vmin -1.5vmin #0002,
    inset -3vmin -1.5vmin 1vmin -1.5vmin #0002,
    inset 0 -7vmin var(--wool);
  background:
    linear-gradient(to right, #0000 30%, #0002 42%, #e8e8e8 0, var(--wool), #e8e8e8 58%, #0000 0),
    linear-gradient(#0000 90%, #ddd)
    ;
  background-color: var(--suit);
}

.body::before {
    content: "";
    width: 150%;
    height: 50%;
    border-bottom: 8vmin solid #181818;
    border-radius: 50%;
    transform: translate(-50%,0) rotate(-5deg);
    top: 25%;
    left: 50%;
    transform-origin: right;
}

.body::after {
    content: "";
    width: 22%;
    height: 15%;
    border: 1.5vmin solid orange;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    border-radius: 1vmin;
}

.arms {
  width: 89%;
  height: 60%;
  border-radius: 100% / 160% 170% 10% 14%;
  background: var(--suit);
  left: 50%;
  top: 40%;
  transform: translateX(-50%) rotate(2deg);
  box-shadow: 
    inset 4vmin -2vmin 1vmin -1vmin #0002,
    inset -3vmin -1.5vmin 1vmin -1vmin #0002,
    inset 0 -7vmin 0 -1vmin var(--wool);
  clip-path:inset(0 0 0 17%)
}

.hand {
  width: 15%;
  height: 18%;
  background: #181818;
  box-shadow: inset 0.5vmin -0.5vmin 1vmin #0004;
  border-radius: 50%;
  top: 92%;
  left: 3%;
}

.hand {
  left: auto;
  right: 6%;
  top: 94%;
  box-shadow: inset -0.75vmin -0.5vmin 1vmin #0004;
}
.hand-new {
    width: 40%;
    aspect-ratio: 1;
    top: 47%;
    left: 14%;
    z-index: 4;
    border: 9vmin solid var(--suit);
    border-top: 0;
    border-radius: 50%;
    border-color: #0000 #0000 var(--suit) var(--suit);
    transform: rotate(3deg);
    transform-origin: top;
    box-shadow: inset 1vmin -1vmin 2vmin -1vmin #0002, -1vmin 2vmin 1vmin -2vmin #0002;
}
.hand-new:before {
    content: "";
    width: 74%;
    aspect-ratio: 0.9;
    background: #181818;
    box-shadow: inset -0.75vmin -0.5vmin 1vmin #0004;
    border-radius: 50%;
    bottom: -14%;
    right: -75%;
    transform: rotate(45deg);
}
.hand-new:after {
    content: "";
    background: #fff;
    width: 66%;
    aspect-ratio: 2/1;
    bottom: -15%;
    right: -43%;
    transform: rotate(49deg);
}
.hat {
  width: 36%;
  height: 20%;
  background: var(--suit);
  left: 50%;
  top: -5%;
  transform: translateX(-50%);
  border-radius: 100% 20% 0 0;
}

.hat::before {
  content:"";
  background: var(--wool);
  width: 30%;
  height: 50%;
  border-radius: 50%;
  right: 0;
  top: 0;
  transform: translate(70%, -50%);
  box-shadow: inset -0.5vmin -0.5vmin 1vmin #0003;
}

.shaver {
    width: 9%;
    aspect-ratio: 0.8;
    background: 
      linear-gradient(#5bc6e5 0 0) top/100% 20%,
      linear-gradient(#5bc6e5 0 0) top/21% 100%;
    background-repeat: no-repeat;
    position: absolute;
    top: 58%;
    left: 45%;
    z-index: 3;
    transform: translate(-50%) rotate(-20deg);
}

.shorts {
  width: 50%;
  height: 30%;
  background:
    radial-gradient(circle at 20% 20%, red 1vmin, #0000 0) 5% 0 / 20% 40%,
    radial-gradient(circle at calc(20% + 2vmin) 20%, red 1vmin, #0000 0) 5% 0 / 20% 40%,
    conic-gradient(at calc(20% + 1vmin) 25%, red 41deg, #0000 0 319deg, red 0) 5% 15% / 20% 40%,
    radial-gradient(circle at 20% 20%, red 1vmin, #0000 0) 17% 30% / 20% 40%,
    radial-gradient(circle at calc(20% + 2vmin) 20%, red 1vmin, #0000 0) 17% 30% / 20% 40%,
    conic-gradient(at calc(20% + 1vmin) 25%, red 41deg, #0000 0 319deg, red 0) 42% 45% / 20% 40%
    ;
  background-color: white;
  border-radius: 100% / 0 0 10% 10%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 60% 100%, 60% 85%, 40% 85%, 40% 100%,0% 100%);
  top: 102%;
  left: 50%;
  transform: translate(-50%, 0);
  box-shadow: inset 0 14vmin 4vmin #0008, inset 0 0 3vmin #0003
}

.leg {
  width: 8%;
  height: 30%;
  background:
    linear-gradient(#f003, #0000 30%)
    ;
  background-color: var(--skin);
  top: 130%;
  left: 30%;
}

.leg + .leg {
  transform: scaleX(-1);
  right: 30%;
  left: auto;
}

.leg::before {
  content: "";
  border-radius: 50%;
  width: 110%;
  height: 30%;
  background: var(--skin);
  position: absolute;
  top: 35%;
  left: 0;
  transform: translate(-30%, -50%);
  box-shadow: inset 1vmin -0.5vmin  1vmin #f002;
  clip-path: polygon(0 0, 40% 0%, 60% 100%, 0% 100%)
}

.leg::after {
  content: "";
  width: 350%;
  height: 35%;
  background:
/*     linear-gradient(#0000 80%, darkgreen 0), */
    radial-gradient(70% 200% at 0 100%, darkgreen 100%, #0000 0),
    radial-gradient(farthest-side at 100% 100%, var(--skin) 130%, #0000 0)
    ;
  right: 0;
  top: 95%;
  border-radius: 80% 0 10% 10%;
  border-bottom: 2vmin solid darkgreen;
}
              
            
!

JS

              
                
              
            
!
999px

Console