cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <no-face>
  <mask>
    <eye></eye>
    <mouth></mouth>
  </mask>
</no-face>
            
          
!
            
              
@mixin dim($width, $height) {
  display: block;
  width: $width + em;
  height: $height + em;
}

@mixin pos($left, $top) {
  position: absolute;
  left: $left + em;
  top: $top + em;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2vmin;
  background-color: gainsboro;
}

no-face {
  @include dim(16, 40);
  background-image: linear-gradient(to bottom, rgba(black, 1) 17em, rgba(black, 0));
  border-radius: 50% 50% 0 0 / 50% 50% 0 0;
  position: relative;
}

mask {
  @include dim(10, 15);
  @include pos(3, 0);
  animation: mask 5s ease-in-out infinite alternate;
  background-image: linear-gradient(to right, rebeccapurple 30%, white 30%, white 70%, rebeccapurple 70%);
  border-radius: 50% 50% 45% 45% / 30% 30% 70% 70%;
  box-shadow:
    0 0 0 0.5em black,
    0 0 0 1.4em white inset;
}

eye {
  @include dim(2, 1.5);
  @include pos(4, 5.2);
  border-radius: 50%;
  box-shadow:
    // left eye
    -2.8em 0 0 0 black,
    -2.8em 0 0 0.5em white,
    -2.75em 1.2em 0 -0.3em rebeccapurple,
    -2.8em 0.9em 0 0.5em white,
    // right eye
    2.8em 0 0 0 black,
    2.8em 0 0 0.5em white,
    2.75em 1.2em 0 -0.3em rebeccapurple,
    2.8em 0.9em 0 0.5em white;
}

mouth {
  @include dim(3, 1);
  @include pos(3.5, 12);
  background-color: black;
  border-radius: 50%;
  box-shadow: 0 0.9em 0 -0.4em rebeccapurple;
}

@keyframes mask {
  0% {
    transform: translate3d(-1em, 0, 0);
  }
  100% {
    transform: translate3d(1em, 0, 0);
  }
}
            
          
!
999px
Loading ..................

Console