Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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>Basic Styles</h1>
<h2>shadow</h2>
<h2>long shadow</h2>
<h2>border</h2>
<h2>block</h2>


<h1>Fancy Styles</h1>
<h2>bordered shadow</h2>
<h2>Letterpress</h2>
<h2>Sophisticated</h2>
<h2>3D text</h2>
<h2>Borders on block text</h2>
<h2>Lifesavers</h2>
<h2>Whisper
  <a href="http://www.themeraid.com/freebies/layer-text-effect-psd/">
    <figure><img src="http://www.themeraid.com/wp-content/uploads/2015/03/07.jpg" width="320" alt="Whisper text effect" /></figure>
  </a>
</h2>
<h2>Bad!
  <a href="http://trentwalton.com/2010/09/24/fun-with-css-text-shadow/">
    <figure><img src="https://designmodo.com/wp-content/uploads/2011/05/CSS3-Text-Effect-2.jpg" alt="BAD! text effect" /></figure>
  </a>
</h2>
<h2>Milkman
  <a href="http://graphicriver.net/item/retro-vintage-text-effects/8095568">
    <figure><img src="https://d13yacurqjgara.cloudfront.net/users/145843/screenshots/1616831/dribbble_retrotexteffect_vol1_03.jpg" alt="Milkman text effect" /></figure>
  </a>
</h2>
<h2>R-Text Effect
  <a href="https://dribbble.com/shots/1455813-R-Text-Effect-Illustrator">
    <figure><img src="https://d13yacurqjgara.cloudfront.net/users/175646/screenshots/1455813/r-text-effect-illustrator_1x.png" alt="R-text effect" /></figure>
  </a>
</h2>
              
            
!

CSS

              
                // functions
@function direction($direction,$value) {
  @if $direction == n {
    $direction:(0) (-$value)
  }
  @if $direction == ne {
    $direction:($value) (-$value)
  }
  @if $direction == e {
    $direction:($value) (0)
  }
  @if $direction == se {
    $direction:($value) ($value)
  }
  @if $direction == s {
    $direction:(0) ($value)
  }
  @if $direction == sw {
    $direction:(-$value) ($value)
  }
  @if $direction == w {
    $direction:(-$value) (0)
  }
  @if $direction == nw {
    $direction:(-$value) (-$value)
  }
  @return $direction;
}
@function text-shadow($distance:5px,$color:#222,$direction:sw,$offset:0,$blur:0) {
  $text-shadow:0;
  $position:$distance+$offset;
  $text-shadow:direction($value:$position,$direction:$direction) ($blur/10)*$distance $color;
  @return $text-shadow;
}
@function text-border($size:1px,$color:#222) {
  $text-shadow:
    text-shadow($size,$color,$direction:sw),
    text-shadow($size,$color,$direction:se),
    text-shadow($size,$color,$direction:ne),
    text-shadow($size,$color,$direction:nw),
    ;
  @return $text-shadow;
}
@function block($height:10,$block-color:gray,$direction:se,$offset:0,$shadow-color:black) {
  $text-shadow:
    0 0 $block-color,
    ;
  @for $i from 1 through $height {
      @if $direction == se {
        $text-shadow:
          text-shadow($distance:$i+0px,$direction:$direction,$color:$block-color),
          #{$text-shadow},
          ($offset + $height + -$i * 2)+px ($offset + $height + ($i))+px $shadow-color,
        ;
      }
      @if $direction == sw {
        $text-shadow:
          text-shadow($distance:$i+0px,$direction:$direction,$color:$block-color),
          #{$text-shadow},
          -($offset + $height + -$i * 2)+px ($offset + $height + ($i))+px $shadow-color,
        ;
      }
      @if $direction == ne {
        $text-shadow:
          text-shadow($distance:$i+0px,$direction:$direction,$color:$block-color),
          #{$text-shadow},
          ($offset + $height + -$i * 2)+px ($offset + -$height + (-$i))+px $shadow-color,
        ;
      }
      @if $direction == nw {
        $text-shadow:
          text-shadow($distance:$i+0px,$direction:$direction,$color:$block-color),
          #{$text-shadow},
          ($offset + -$height + $i * 2)+px ($offset + -$height + (-$i))+px $shadow-color,
        ;
      }
  }
  @return $text-shadow;
}
@function long-shadow($height:15,$color:#222,$direction:sw,$offset:0,$blur:0) {
  $long-shadow:
    0 0 $color;
  @for $i from 1 through $height {
    $distance:($offset + $i)+px;
    $long-shadow:
      #{$long-shadow},
      text-shadow($color:$color,$direction:direction($value:$distance,$direction:$direction),$offset:$offset),
      ;
  }
  @return $long-shadow;
}

// mixins
@mixin text-shadow($distance:5px,$color:#222,$direction:sw,$offset:0,$blur:0) {
  text-shadow:text-shadow($distance,$color,to-lower-case($direction),$offset,$blur);
}
@mixin long-shadow($height:15,$color:#222,$direction:sw,$offset:0,$blur:0) {
  text-shadow: long-shadow($height:$height,$color:$color,$direction:to-lower-case($direction),$offset:$offset,$blur:$blur);
}
@mixin text-border($size:1px,$color:#222) {
  text-shadow:
    text-border($size,$color),
    ;
}
@mixin block($height:10,$block-color:#aaa,$shadow-color:#777,$direction:se) {  
  text-shadow:
    block($height:$height,$block-color:$block-color,$shadow-color:$shadow-color,$direction:to-lower-case($direction)),
    ;
}


// basic effects, no special class required
h2:nth-of-type(1) {
  @include text-shadow();
}
h2:nth-of-type(2) {
  @include long-shadow();
}
h2:nth-of-type(3) {
  @include text-border();
}
h2:nth-of-type(4) {
  @include block();
}


// build your own styles easily using functions
h2:nth-of-type(5) {
  text-shadow:
    text-border($color:#bada55),
    text-shadow($color:currentColor),
    ;
}
h2:nth-of-type(6) {
  background:#666;
  color:#444;
  text-shadow:
    text-shadow($color:#888,$distance:1px,$direction:s,$blur:5),
    text-shadow($color:#333,$distance:1px,$direction:n),
    ;
}
h2:nth-of-type(7) {
  background:#ddd;
  color:#444;
  text-shadow:
    text-border($color:#ddd),
    text-shadow($color:#aaa),
    ;
}
h2:nth-of-type(8) {
  color:rgba(0,0,255,.6);
  text-shadow:
    text-shadow($color:rgba(255,0,0,.5)),
    text-shadow($color:rgba(0,255,0,.5),$direction:ne),
    ;
}
h2:nth-of-type(9) {
  color:#d54938;
  text-shadow:
    text-border($color:darken(#d54938,25deg)),
    block($block-color:darken(#d54938,25deg),$shadow-color:darken(#bada55,20deg)),
    ;
}
h2:nth-of-type(10) {
  text-shadow:
    long-shadow($color:violet,$height:2),
    long-shadow($color:indigo,$height:4),
    long-shadow($color:blue,$height:6),
    long-shadow($color:green,$height:8),
    long-shadow($color:yellow,$height:10),
    long-shadow($color:orange,$height:12),
    long-shadow($color:red,$height:14),
    ;
}
h2:nth-of-type(11) {
  background:#a57bb3;
  font-family:"Pacifico",cursive;
  font-size:5rem;
  text-shadow:
    long-shadow($direction:s,$color:#519e33,$height:10),
    text-shadow($color:rgba(#000,.2),$direction:s,$distance:15px),
    ;
  text-transform:none;
}
h2:nth-of-type(12) {
  background:#fff;
  color:#69b7e2;
  text-shadow:
    text-shadow($color:#db576e,$distance:30px,$direction:nw),
    long-shadow($direction:nw,$height:30,$color:#c73c56),
    ;
}
h2:nth-of-type(13) {
  background:#f8e3d0;
  color:rgba(255,0,0,.7);
  text-shadow:
    text-shadow($direction:nw,$distance:2px,$color:lighten(#f8e3d0,8deg)),
    block($height:5,$block-color:#3d2b65,$shadow-color:darken(#f8e3d0,8deg)),
    ;
}
h2:nth-of-type(14) {
  background:#3ca891;
  color:#efd163;
  text-shadow:
    long-shadow($direction:se,$color:#a7382d,$height:10),
    long-shadow($height:15,$color:#2d4551,$direction:se),
    long-shadow($height:20,$color:#308674,$direction:se),
    ;
}



// presentational, not needed for functions/mixins to work
html {
  font-size:1.4vmax;
}
body {
  background:#bada55;
  font-size:100%;
}
p {
  color:darken(#bada55,40deg);
  padding:1rem;
}
h1 {
  color:darken(#bada55,30deg);
  font:bold 3rem/2 "Open Sans",sans-serif;
  text-align:center;
  text-transform:uppercase;
}
h2 {
  color:#fff;
  font:bold 4rem/2 "Open Sans",sans-serif;
  text-align:center;
  text-transform:uppercase;
}
figure {
  margin:auto;
  text-align:center;
}
              
            
!

JS

              
                
              
            
!
999px

Console