css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <section role="main">
	<header>
		<h1>Semantic Remapping - Framework Centipede example</h1>
	</header>
	<p>Here we have a fun example where we're using two CSS frameworks (Yahoo Pure and Twitter Bootstrap) and two modal libraries (Bootstrap's modal.js and Colorbox.js).</p>
	<p>NOTE: we're only using the modal and transition files from the javascript portion of Bootstrap's JS framework to minimize bloat.</p>
	<p>And speaking of bloat, how much space does all the CSS we're using from Bootstrap, Pure, and Colorbox take up?  --just <em>2.57kb</em> when compressed and minified</p>
	<p>Remember that Bootstrap's CSS  is 19.72kb compressed and minified all by itself!  It's not blood magic, just a cool trick you can do with your CSS Preprocessor.  Read more about it <a href="https://medium.com/@dehuszar/semantic-remapping-with-css-pre-processors-906ba1a9910c" target="_blank">here</a></p>
	<button class="modal-trigger" data-toggle="modal" data-target=".bootstrap-message-wrapper">Pure Button - Bootstrap Modal</button>
	<a href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/18728/angry-panda-office.gif"  class="modal-trigger" title="Panda doesn't like it when you abuse utility classes">Bootstrap Button - Colorbox Modal</a>
</section>
<div class="bootstrap-message-wrapper modal fade" role="dialog">
	<div class="modal-dialog dialog-wrapper">
		<div class="modal-content content-wrapper" role="document">
			<header>
				<button data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h2>Bootstrap Modal!</h2>
			</header>
			<article>
				<p>Unfortunately, Bootstrap's modal logic is set up in such a way that we have to keep a few of these silly modal-classes around for things to work; even if we're not even binding the Bootstrap modal styling to those classes any more.</p>
				<p>That said, I've had several projects where I needed to use a Bootstrap modal mixed with other UI libraries/frameworks.  This makes fairly quick work of that task, am I right?</p>
			</article>
		</div>
	</div>
</div>
            
          
!
            
              @import (reference) 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/18728/pure.less';
@import (reference) 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/18728/grids-responsive.less';
@import (reference) 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/18728/bootstrap.less';
@import 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/18728/colorbox.css';

[role="main"]:extend(.pure-g) {
	margin: 2em;
	
	header, p {
		&:extend(.pure-u-1-1);
	}
}

[role="main"] button.modal-trigger:extend(.pure-u-1-2, .pure-button all, .pure-button-primary all) {}

[role="main"] a.modal-trigger:extend(.pure-u-1-2, .btn all, .btn-primary all) {
	box-sizing: border-box;
}

// Bootstrap modal rules
.modal-open:extend(.modal-open) {}
.modal-backdrop:extend(.modal-backdrop,
						.modal-backdrop.fade,
						.modal-backdrop.in all) {}

.bootstrap-message-wrapper:extend(.modal all, .fade all) {
	&.in:extend(.fade.in all) {
		.dialog-wrapper:extend(.modal.in .modal-dialog all, .modal.fade .modal-dialog all) {}
	}
	
	.dialog-wrapper:extend(.modal-dialog all) {}
	.content-wrapper:extend(.modal-content all) {}
	header:extend(.modal-header) {}
	header h2:extend(.modal-title) {}
	header button:extend(.modal-header .close, .button.close, .close) {
		background-color: transparent;
    	border: 0;
	}
	article:extend(.modal-body) {}
}

#cboxContent img {
	height: auto!important;
	margin-top: 0!important;
	width: 100%!important;
}
            
          
!
            
              $('[role="main"] button + a').colorbox({innerWidth: "485px", innerHeight: "336px"});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console