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

              
                
<section class='container example-01'>

	<ul class='block-list'>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
	</ul> 
	
</section>



<section class='container example-02'>
<div class='inner-w'>
  
	<ul class='block-list'>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
	</ul>
	
</div>
</section>



<section class='container example-03'>

	<ul class='block-list'>
		<li></li>
		<li>
			<a href='https://codepen.io/sheriffderek/pen/aOLqGX' target='_blank'>
				What if the heights are all unique? Working that out over HERE
			</a>
		</li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
	</ul> 
	
</section>

              
            
!

CSS

              
                /* includes "basic-style" */
/* this approach takes advantage of a specific set of $break-points... */
/* it's pretty much the only time I use max-width - so, you'll have to look into it to see how it works. It's a little more *setup* - but I use these break-points in every project anyways - so for me, it's the lightest - and least hacky solution I've found so far. */


// define breakpoints and store in variables for later use
// these are what I use site wide - and are adjusted for each project specifically when things get 'ugly' - (not "standard" device size)
$bp-1 = 400px
$bp-2 = 700px
$bp-3 = 1000px
$bp-4 = 1300px
$bp-5 = 1700px

// get variables for quick use
$break-point-1 = 'screen and (min-width: $bp-1)'
$break-point-2 = 'screen and (min-width: $bp-2)'
$break-point-3 = 'screen and (min-width: $bp-3)'
$break-point-4 = 'screen and (min-width: $bp-4)'
$break-point-5 = 'screen and (min-width: $bp-5)'

// define the edge of the break-point
$bp-1-2 = $bp-2 - 1px
$bp-2-3 = $bp-3 - 1px
$bp-3-4 = $bp-4 - 1px
$bp-4-5 = $bp-5 - 1px

// define min and max for the grid break-points
// this is so that it isn't nessesary to overwrite/ride the styles at each subsequent break-point
$break-point-1-2 = 'screen and (min-width: $bp-1) and (max-width: $bp-1-2)'
$break-point-1-3 = 'screen and (min-width: $bp-1) and (max-width: $bp-2-3)'
$break-point-1-4 = 'screen and (min-width: $bp-1) and (max-width: $bp-3-4)'
$break-point-1-5 = 'screen and (min-width: $bp-1) and (max-width: $bp-4-5)'

$break-point-2-3 = 'screen and (min-width: $bp-2) and (max-width: $bp-2-3)'
$break-point-2-4 = 'screen and (min-width: $bp-2) and (max-width: $bp-3-4)'
$break-point-2-5 = 'screen and (min-width: $bp-2) and (max-width: $bp-4-5)'

$break-point-3-4 = 'screen and (min-width: $bp-3) and (max-width: $bp-3-4)'
$break-point-3-5 = 'screen and (min-width: $bp-3) and (max-width: $bp-4-5)'

$break-point-4-5 = 'screen and (min-width: $bp-4) and (max-width: $bp-4-5)'


// The actual grid rule / mixin - is short and sweet, but depends on the break-point system outlined above.
grid-in($parts = 1, $gutter = 2%)
	li  //
		width: 100%
		float: left
		width: (  (100%/$parts) -  (  ( ($parts - 1) * $gutter )  / ($parts)   ) ) // could be flex-basis these days
		margin-right: $gutter
		&:nth-of-type( {$parts}n + {$parts} )
			margin-right: 0
			background: $highlight // just to show

// list to split // the actual implementaion happens on the 'list'
.example-01
	//
	.block-list
		//
		@media $break-point-1-2
			grid-in(2, 2%)
		@media $break-point-2-3
			grid-in(3, 1.5%)
		@media $break-point-3-4
			grid-in(4, 1%)
		@media $break-point-4-5
			grid-in(5, .8%)
		@media $break-point-5
			grid-in(6, .6%)


.example-02
	//
	.block-list
		//
		@media $break-point-2-3
			grid-in(2, 1.5%)
		@media $break-point-3-4
			grid-in(3, 1%)
		@media $break-point-4-5
			grid-in(4, .8%)
		@media $break-point-5
			grid-in(5, .6%)


.example-03
	//
	.block-list
		//
		@media $break-point-1-2
			grid-in(3, 2%)
		@media $break-point-2-3
			grid-in(4, 1.5%)
		@media $break-point-3-4
			grid-in(5, 1%)
		@media $break-point-4-5
			grid-in(6, .8%)
		@media $break-point-5
			grid-in(7, .6%)

































// (base styles)
body
	border: 10px solid $alternate

// list to split 
.block-list
	width: 100%
	float: left
	margin: 0
	padding: $pad
	background: $gray-light
	border: 10px solid $color
	li //
		display: block
		width: 100%
		float: left
		margin-bottom: $pad
		background: $white
		padding: $pad*6 $pad
	

	
	
	
              
            
!

JS

              
                
              
            
!
999px

Console