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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                - items = [1,2,3,4,5,6,7,8,9,10,11,12]

.gridDemo
	.container
		.g-row.vertical-gutter
			each i in items
				.g-xs-6.g-sm-4.g-md-3.g-lg-2.g-xg-1
					pre.d=i
              
            
!

CSS

              
                // -----------------------------------
// config
// -----------------------------------
maxWidth = 72.5rem
rows = 12
breakpoints = {
	xs: { width:      0, gutter: 1.0rem }
	sm: { width:  480px, gutter: 1.5rem }
	md: { width:  768px, gutter: 2.0rem }
	lg: { width:  992px, gutter: 2.5rem }
	xg: { width: 1270px, gutter: 2.5rem }
}


// -----------------------------------
// above util
// -----------------------------------

above(breakpoint)
	if breakpoints[breakpoint].width > 0
		@media only screen and (min-width: breakpoints[breakpoint].width)
			{block}
	else
		{block}


// -----------------------------------
// grid (optimized version)
// -----------------------------------

.g-row
	display flex
	flex-direction row
	flex-wrap wrap
	box-sizing border-box
	align-items flex-start
	&.vertical-gutter
		for breakpoint in breakpoints
			+above(breakpoint)
				margin-top: (breakpoints[breakpoint].gutter * -0.5)
				margin-bottom: (breakpoints[breakpoint].gutter * -0.5)
				& > *
					margin-top: (breakpoints[breakpoint].gutter * 0.5)
					margin-bottom: (breakpoints[breakpoint].gutter * 0.5)


for breakpoint in breakpoints
	+above(breakpoint)
		.g-row
			margin-left: (breakpoints[breakpoint].gutter * -0.5)
			margin-right: (breakpoints[breakpoint].gutter * -0.5)

		for num in (0..rows)
			.g-{breakpoint}-{num}
				if num == 0
					display none
				else
					width: ((100/rows*num))%

	for breakpoint2 in breakpoints
		for num in (1..rows)
			+above(breakpoint2)
				.g-{breakpoint}-{num}
					+cache(breakpoint2)
						+cache(num)
							display block
							padding-left: (breakpoints[breakpoint2].gutter/2)
							padding-right: (breakpoints[breakpoint2].gutter/2)
							box-sizing border-box
							flex-shrink 0
							
				
// -----------------------------------
// presentation
// -----------------------------------

.container
	margin-left: auto
	margin-right: auto
	display: block
	width: 100%
	max-width: maxWidth

.gridDemo
	font-family "system-ui", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"
	padding 1rem
	background dodgerblue
	text-rendering optimizeLegibility
	font-smooth antialised
	font-smoothing antialised
	-webkit-font-smoothing antialiased
	-moz-osx-font-smoothing grayscale
	-webkit-font-feature-settings 'kern' 1, 'liga' 1, 'calt' 1, 'pnum' 0, 'tnum' 1, 'onum' 0, 'lnum' 1, 'dlig' 1, 'zero' 1, 'case' 1
	pre, code
		margin 0
		font-family "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace
	.d
		background white
		color dodgerblue
		padding 0.75rem 0
		font-size 0.75rem
		font-weight 500
		text-align center
		border-radius 0.25rem
		user-select none

              
            
!

JS

              
                
              
            
!
999px

Console