Pen Settings



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


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


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.


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.


                <main class="scene">
  <div class="actor">
    <div class="actor__prefix">-</div>
    <div id="vader" class="actor__content"></div>

  <div class="actor">
    <div class="actor__prefix">-</div>
    <div id="luke" class="actor__content"></div>

  <p>This is a demo of <a href="" target="_blank">TheaterJS</a>.</p>
  <p>It's forkable/editable on <a href="" target="_blank">CodePen</a>.</p>
  <p>Everything you need to know is on its <a href="" target="_blank">GitHub</a> repository.</p>
  <p>And it'd be really nice to share the force on <a href="" target="_blank">Twitter</a> or <a href="" target="_blank">Facebook</a>.</p>


                @import '//';

$font-family-base: 'Cutive', serif;;
$font-size-root: 14px;
$font-size-base: 1rem;
$line-height-base: 1.4;

$color-black: #222;
$color-white: #ededed;
$color-red: #c92b2b;

$spacing: 2rem;
$spacing-large: $spacing * 3;

*:after {
  box-sizing: inherit;

body {
  padding: 0;
  margin: 0;

html {
  font-size: $font-size-root;
  height: 100%;
  box-sizing: border-box;

body {
  font-family: $font-family-base;
  font-size: $font-size-base;
  line-height: $line-height-base;
  color: $color-black;
  background-color: $color-white;
    background-color 150ms ease-out,
    color 150ms ease-out;

.dark {
  color: $color-white;
  background-color: $color-black;

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid;

  &:hover {
    box-shadow: inset 0 -8px 0 $color-red;

p {
  opacity: .6;
  margin: 0 0 .6rem 0;
  transition: opacity 300ms ease-out;

  &:hover {
    opacity: 1;

.scene {
  padding: $spacing-large $spacing;
  max-width: 800px;
  margin: 0 auto;

.actor {
  font-size: 2.8rem;
  display: flex;
  margin-bottom: $spacing;

  &:last-of-type {
    margin-bottom: $spacing-large;

.actor__content {
  flex-grow: 1;

@keyframes blink {
  from { opacity: 0; }
  to { opacity: 1; }

.actor__content--typing::after {
  content: '|';
  animation: blink 500ms infinite;


 * TheaterJS, a typing effect mimicking human behavior.
 * Github repository: 

var theater = theaterJS()

  .on('type:start, erase:start', function () {
  .on('type:end, erase:end', function () {
  .on('type:start, erase:start', function () {
    if (theater.getCurrentActor().name === 'vader') {
    } else {

  .addActor('vader', { speed: 0.8, accuracy: 0.6 })
  .addScene('vader:Luke.', 600)
  .addScene('luke:What?', 400)
  .addScene('vader:I am your father.', 400)
  .addScene('luke:Nooo...', -3, '!!! ', 600, 'No! ', 600)
  .addScene('luke:That\'s not true!', 600)
  .addScene('luke:That\'s impossible!', 400)
  .addScene('vader:Search your feelings.', 1600)
  .addScene('vader:You know it to be true.', 1000)
  .addScene('luke:Noooooooo! ', 600, 'No!', 400)
  .addScene('vader:Luke.', 600)
  .addScene('vader:You can destroy the Emperor.', 1600)
  .addScene('vader:He has foreseen this. ', 800)
  .addScene('vader:It is your destiny.', 1600)
  .addScene('vader:Join me.', 800)
  .addScene('vader:Together we can rule the galaxy.', 800)
  .addScene('vader:As father and son.', 1600)
  .addScene('vader:Come with me. ', 800)
  .addScene('vader:It is the only way.', 2000)