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 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

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

              
                <header class="Header">
  <div class="Header-name">
  	css-bliss Module Modifier demo
  </div>
  <br />
  
  <div class="Header-desc">
  	<code>FunkyDialog--funkier</code> modifies the <code>FunkyDialog</code> Module.
  </div>
</header> 

<div class="content">
  
  <div class="FunkyDialog">
    <h3 class="FunkyDialog-header">
      Lorem ipsum dolor 
    </h3>
    <div>
    	<div class="FunkyDialog-content">
        Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.	
      </div>
      <div class="FunkyDialog-content FunkyDialog-content--big">
        Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.	
      </div>
    </div>
    
  </div>
  
  <div class="FunkyDialog FunkyDialog--funkier">
    <h3 class="FunkyDialog-header">
      Lorem ipsum dolor 
    </h3>
    <div>
    	<div class="FunkyDialog-content">
        Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 
      </div>
      <div class="FunkyDialog-content FunkyDialog-content--big">
        Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 
      </div>
    </div>
    
  </div>
  
</div>
              
            
!

CSS

              
                .FunkyDialog {
  border: 1px solid #aaa;
  padding: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 0, .8),  rgba(0, 255, 255, 1));
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  
  &-header {
    color: darkblue;
    background: #efef00;
    padding: 10px;
    margin: 15px 0;
  }
  
  &-content {
  	color: green;
    font-size: 14px;
    line-height: 15px;
    padding: 10px;
    
    &:not(:first-child) {
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid rgba(255,255,255,0.5);
    }
  }
  
  &-content--big {
    font-size: 16px;
  }
}

.FunkyDialog--funkier {
  background: linear-gradient(to bottom, rgba(255, 0, 0, .8),  rgba(0, 0, 255, 1));
  
  .FunkyDialog-content {
    color: white;
  }
  
  .FunkyDialog-header {
    color: white;
    background: black;
  }
}

.Header {
  background: #101010;
  font-family: Arial;
  margin-bottom: 20px;
  font-family: "Lucida Grande", sans-serif;
  
  &-desc {
  	color: white;
  	padding: 10px;
  }
  
  &-name {
    color: #999;
    display: inline-block;
    background: #333;
    padding: 10px;
  }
}

.ElmInfo {
  position: relative;
  
  &-contentWrap {
    position: absolute;
  }
  
  &-content {
    background: black;
    color: white;
    font-family: Arial;
    font-size: 10px;
    padding: 4px;
    white-space: nowrap;
  }
}

* { box-sizing: border-box; }
body { padding: 0; margin: 0; }
.content { 
  padding: 0 20px; 
  
  .FunkyDialog {
    // This rule is here to simplify the example, but the correct approach
    // is to use subclassing instead of overriding .FunkyDialog
    margin-bottom: 10px;
  }
}
.highlightElm { outline: 1px solid red; }
              
            
!

JS

              
                lastElm = null
infoElm = null
$('[class]').on 'mouseover', (e) ->
  e.stopPropagation()
  elm = $(this)
  infoElm.remove() if infoElm
  lastElm.removeClass('highlightElm') if lastElm
  infoElm = lastElm = null
  c = elm[0].className.split(/\s+/).join('<br>')
  if c
    infoElm = $('<div class="ElmInfo"><div class="ElmInfo-contentWrap"><div class="ElmInfo-content">' + c +  '</div></div></div>')
    elm.addClass('highlightElm')
    elm.prepend(infoElm)
    lastElm = elm

              
            
!
999px

Console