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="dialog_info">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex inventore repellat omnis atque nisi nihil quos adipisci aliquam modi recusandae impedit reiciendis mollitia quia ipsam ab quae sunt maxime quidem?
  </p>
</div>

<div class="dialog_error">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex inventore repellat omnis atque nisi nihil quos adipisci aliquam modi recusandae impedit reiciendis mollitia quia ipsam ab quae sunt maxime quidem?
  </p>
</div>

<div class="dialog_warning">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex inventore repellat omnis atque nisi nihil quos adipisci aliquam modi recusandae impedit reiciendis mollitia quia ipsam ab quae sunt maxime quidem?
  </p>
</div>

<div class="dialog_success">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex inventore repellat omnis atque nisi nihil quos adipisci aliquam modi recusandae impedit reiciendis mollitia quia ipsam ab quae sunt maxime quidem?
  </p>
</div>
              
            
!

CSS

              
                @import "compass/css3";

html {
  background: #2c3e50; 
}


$dialog-messages: (
  info: (#00acee \f05a),
  error: (#cb2027 \f06a),
  warning: (#f39c12 \f071),
  success: (#aad450 \f058)
  );


.dialog {

  @each $message, $properties in $dialog-messages {
    $color: nth($properties, 1);
    $icon: nth($properties, 2); 

    &_#{$message} {
      background: lighten($color,20%);
      color:  darken($color,20%);

      &:before {
        color:  lighten($color,35%);
        content: '#{$icon}'; 
      }
    }
  }
}


[class^="dialog_"] {
  border-radius: 0.5em;
  margin: 1em auto;
  max-width: 40em;
  overflow: hidden;
  padding: 0.5em;
  position: relative;
  width: 95%; 

  &:before {
    bottom: 0;
    display: inline-block; 
    font-family: FontAwesome;
    font-style: normal;
    font-size: 4em;
    font-weight: normal;
    line-height: 1;
    margin-right: 0.2em;
    position: absolute;
    right: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;   
    z-index: 1;
  }

  p {
    padding: 0 3em;
    position: relative;
    z-index: 2; 
  }
}

@media (max-width: 25em) {

  [class^="dialog_"]:before {
    bottom: -0.05em;
    font-size: 8em;
    right: -0.25em;
  }
}
              
            
!

JS

              
                /* 
Expanded on Hugo Giraudel's work here:
http://www.sitepoint.com/sass-component-10-minutes 

by using the new Sass 3.3 reworked parent selector to include block name in the childrens class names

*/
              
            
!
999px

Console