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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <link rel="stylesheet" href="https://rawgit.com/alsacreations/KNACSS/master/css/knacss.css">

<h1 class="main-title">KNACSS v6 Styleguide</h1>

<ol class="toc">
	<li><a href="#alignements">alignements</a>
	<li><a href="#flottants">flottants</a></li>
	<li><a href="#inline-block">inline-block</a></li>
	<li><a href="#flexbox">flexbox</a></li>
	<li><a href="#grilles">grilles</a></li>
	<li><a href="#largeurs">largeurs</a></li>
	<li><a href="#margin">marges externes</a></li>
	<li><a href="#variables">variables (Sass)</a></li>
</ol>



<h1 id="alignements">alignements</h1>

<section class="global-container txtleft">
  <span class="left">text</span>
	<span class="right">img</span>
</section>

<section class="global-container txtright">
  <span class="left">text</span>
	<span class="right">img</span>
</section>

<section class="global-container txtcenter">
  <span class="left">text</span>
	<span class="right">img</span>
</section>

<section class="global-container left">
</section>

<section class="global-container right">
</section>

<section class="global-container center">
</section>

<h1 id="flottants">flottants</h1>

<section class="global-container">
  <span class="fl">.fl</span>
	<div class="outline">Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Hopla. Yoo ch'ai lu dans les DNA que le Racing a encore perdu contre Oberschaeffolsheim et moi ch'avais donc parié deux knacks et une flammekueche.</div>
</section>

<section class="global-container">
  <span class="fr">.fr</span>
	<div class="outline">Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Hopla. Yoo ch'ai lu dans les DNA que le Racing a encore perdu contre Oberschaeffolsheim et moi ch'avais donc parié deux knacks et une flammekueche.</div>
</section>

<section class="global-container">
  <span class="fl">.fl</span>
	<div class="clear outline"><b>.clear</b><br>Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Hopla. Yoo ch'ai lu dans les DNA que le Racing a encore perdu contre Oberschaeffolsheim et moi ch'avais donc parié deux knacks et une flammekueche.</section>
</div>

<section class="global-container">
  <span class="fl">.fl</span>
	<div class="bfc outline"><b>.bfc</b><br>Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Hopla. Yoo ch'ai lu dans les DNA que le Racing a encore perdu contre Oberschaeffolsheim et moi ch'avais donc parié deux knacks et une flammekueche.</section>
</div>

<h1 id="inline-block">inline-block</h1>

<section class="global-container">
  <span class="inbl">.inbl</span>
	<span class="inbl">.inbl</span>
	<span class="inbl">.inbl</span>
</section>

<section class="global-container">
  <span class="inbl w25">.inbl .w25</span>
	<span class="inbl w33">.inbl w33</span>
	<span class="inbl">.inbl</span>
</section>


<h1 id="flexbox">flexbox</h1>

<section class="global-container flex-container">
  <span>div</span>
	<span>span</span>
	<span>&hellip;</span>
</section>

<section class="global-container flex-container flex-container-v">
  <span>div</span>
	<span>span</span>
	<span>&hellip;</span>
</section>

<section class="global-container flex-container">
  <span class="w33">.w33</span>
	<span class="w33">.w33</span>
	<span class="w33">.w33</span>
</section>

<section class="global-container flex-container">
  <span class="w200p">.w200p</span>
	<span class="w33">.w33</span>
	<span>stuff</span>
</section>

<section class="global-container flex-container">
  <span>div</span>
	<span>span</span>
	<span class="flex-item-fluid">.flex-item-fluid</span>
</section>

<section class="global-container flex-container">
  <span class="flex-item-fluid">.flex-item-fluid</span>
	<span class="flex-item-fluid">.flex-item-fluid</span>
	<span class="flex-item-fluid">.flex-item-fluid</span>
</section>

<section class="global-container flex-container">
  <span>div</span>
	<span>span</span>
	<span class="item-last">.item-last</span>
</section>

<section class="global-container flex-container">
  <span>div</span>
	<span>span</span>
	<span class="item-first">.item-first</span>
</section>

<section class="global-container flex-container" style="height: 8em">
  <span class="flex-item-center">.flex-item-center</span>
</section>

<h1 id="grilles">grilles</h1>
<h2>grille monoligne</h2>

<section class="global-container grid">
	<div class="grid">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container grid has-gutter">
	<div class="grid has-gutter">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
	</div>
</section>

<h2>grille multilignes</h2>

<section class="global-container grid2">
	<div class="grid-2">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container grid2 has-gutter">
	<div class="grid-2 has-gutter">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container grid3">
	<div class="grid-3">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container grid4">
	<div class="grid-4">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container grid5">
	<div class="grid-5">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container griddouze">
	<div class="grid-12">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
	</div>
</section>

<h2>ordonnancement</h2>

<section class="global-container grid3">
	<div class="grid-3">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span class="grid-item-first">.grid-item-first</span>
	</div>
</section>

<section class="global-container grid3">
	<div class="grid-3">
  	<span class="grid-item-last">.grid-item-last</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
	</div>
</section>

<h2>grilles responsive</h2>

<section class="global-container grid53">
	<div class="grid-5-small-3">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span>p</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container grid64">
	<div class="grid-6-small-4">
  	<span>div</span>
		<span>span</span>
		<span>img</span>
		<span class="push">.push</span>
		<span>&hellip;</span>
	</div>
</section>

<h2>tailles individuelles</h2>

<section class="global-container grid">
	<div class="grid">
  	<span class="one-half">.one-half</span>
		<span>&hellip;</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container grid3">
	<div class="grid-3">
  	<span class="one-sixth">.one-sixth</span>
		<span class="one-sixth">.one-sixth</span>
		<span class="two-thirds">.two-thirds</span>
		<span class="one-third">.one-third</span>
		<span class="two-thirds">.two-thirds</span>
		<span class="one-quarter">.one-quarter</span>
		<span class="three-quarters">.three-quarters</span>
		<span class="full">.full</span>
		<span>&hellip;</span>
	</div>
</section>

<section class="global-container grid3 has-gutter">
	<div class="grid-3 has-gutter">
  	<span class="one-sixth">.one-sixth</span>
		<span class="one-sixth">.one-sixth</span>
		<span class="two-thirds">.two-thirds</span>
		<span class="one-third">.one-third</span>
		<span class="two-thirds">.two-thirds</span>
		<span class="one-quarter">.one-quarter</span>
		<span class="three-quarters">.two-quarters</span>
		<span class="full">.full</span>
		<span>&hellip;</span>
	</div>
</section>

<h1 id="largeurs">largeurs</h1>
<h2>largeurs en %</h2>
<div class="global">
  <div class="w10">.w10</div>
	<div class="w20">.w20</div>
	<div class="w25">.w25</div>
	<div class="w33">.w33</div>
	<div class="w40">.w40</div>
	<div class="w50">.w50</div>
	<div class="w60">.w60</div>
	<div class="w66">.w66</div>
	<div class="w70">.w70</div>
	<div class="w80">.w80</div>
	<div class="w90">.w90</div>
	<div class="w100">.w100</div>
	<div class="wauto">.wauto</div>
</div>

<h2>largeurs en px</h2>
<div class="global">
  <div class="w50p">.w50p</div>
	<div class="w100p">.w100p</div>
	<div class="w150p">.w150p</div>
	<div class="w200p">.w200p</div>
	<div class="w300p">.w300p</div>
	<div class="w400p">.w400p</div>
	<div class="w500p">.w500p</div>
	<div class="w600p">.w600p</div>
	<div class="w700p">.w700p</div>
	<div class="w800p">.w800p</div>
	<div class="w960p">.w960p</div>
	<div class="mw960p">.mw960p</div>
</div>

<h1 id="margin">marges externes (margin)</h1>
<div class="global">
  <div class="mls">.mls</div>
	<div class="mlm">.mlm</div>
	<div class="mll">.mll</div>
	<div class="mrs">.mrs</div>
	<div class="mrm">.mrm</div>
	<div class="mrl">.mrl</div>
	<div class="mts">.mts</div>
	<div class="mtm">.mtm</div>
	<div class="mtl">.mtl</div>
	<div class="mbs">.mbs</div>
	<div class="mbm">.mbm</div>
	<div class="mbl">.mbl</div>
	<div class="mas">.mas</div>
	<div class="mam">.mam</div>
	<div class="mal">.mal</div>
	<div class="man">.man</div>
</div>

<h1 id="variables">variables (Sass)</h1>
<h2>espacements</h2>
<div class="global">
  <pre><code>$tiny-value             : .5rem;
$tiny-plus-value        : .7rem;
$small-value            : 1rem;
$small-plus-value       : 1.5rem;
$medium-value           : 2rem;
$medium-plus-value      : 3rem;
$large-value            : 4rem;
$large-plus-value       : 6rem;
$extra-large-value      : 8rem;
$extra-large-plus-value : 12rem;
$ultra-large-value      : 16rem;
$ultra-large-plus-value : 20rem</code></pre>
</div>

<h2>breakpoints</h2>
<div class="global">
  <pre><code>$tiny: 480px;
$small: 576px;
$medium: 768px;
$large: 992px;
$extra-large: 1200px;</code></pre>
</div>


<h2>font sizes</h2>
<div class="global">
  <pre><code>$base-font-size : 1.6rem; // "16px" equivalent
$line-height  : 1.5;
$h1-size      : 3.2rem;
$h2-size      : 2.8rem;
$h3-size      : 2.4rem;
$h4-size      : 2.0rem;
$h5-size      : 1.8rem;
$h6-size      : 1.6rem;</code></pre>
</div>

              
            
!

CSS

              
                section::before {
	position: absolute;
	top: -1.8em;
	left: 1em;
}
section:first-of-type::before {
	content: ".txtleft";
}
section:nth-of-type(2)::before {
	content: ".txtright";
}
section:nth-of-type(3)::before {
	content: ".txtcenter";
}
section:nth-of-type(4)::before {
	content: ".left";
}
section:nth-of-type(5)::before {
	content: ".right";
}
section:nth-of-type(6)::before {
	content: ".center";
}
.row-stuff {
	margin-left: 2rem;
	color: #555;
  font-size: 1.2em;
}

section.flex-container::before {
	content: ".flex-container";
}
section.flex-container-v::before {
	content: ".flex-container .flex-container-v";
}
section.grid2::before {
	content: "grid-2";
}
section.grid3::before {
	content: "grid-3";
}
section.grid4::before {
	content: "grid-4";
}
section.grid5::before {
	content: "grid-5";
}
section.griddouze::before {
	content: "grid-12";
}
section.grid53::before {
	content: "grid-5-small-3";
}
section.grid64::before {
	content: "grid-6-small-4";
}
section.grid::before {
	content: "grid";
}
section.grid2.has-gutter::before {
	content: "grid-2 has-gutter";
}
section.grid3.has-gutter::before {
	content: "grid-3 has-gutter";
}
section.grid.has-gutter::before {
	content: "grid has-gutter";
}
section.gridhalf::before {
	content: ".one-half";
}


/* deco */

body {
  padding: 5rem 3rem;  
}
.global-container,
.global { 
	position: relative;
	width: 80% !important;
	padding: .8em;
	margin-bottom: 3em;
	border: .25em dotted goldenrod;
  color: #555; 
  background-color: #fff;
	font-size: 1.2em;
}
.outline {
	padding: 4px;
	border: 1px dotted olivedrab;
}
span,
.global > div {
	padding: .8em;
	background: hotpink;
	color: #fff;
}
span {
	display: inline-block;
} 
span + span {
	opacity: .8
}
span + span + span {
	opacity: .6
}
h1, h2 {
	margin: 0 0 1em;
	color: #345;
	text-align: center;
  font-family: georgia, "trebuchet ms", arial, serif !important;
}
h2 {
	font-weight: normal;
}

.toc {counter-reset: toc; padding-left: 0;} 
.toc li {
  list-style-type: none;
  counter-increment: toc; /* on incrémente le compteur à chaque nouveau li */
  margin-bottom: 1px;	
}
.toc li:before {
    content: counter(toc); /* on affiche le compteur */
	float: left;
	width: 2rem;
	height: 2rem;
	line-height: 2rem;
	text-align: center;
  margin-right: 2rem;
  color: #fff;	
	background: rgba(0,0,0,.3);
	border-radius: 0 0 6px 0;
}
.toc a {
	display: block;
	padding: .6rem 1rem;
	color: #555;
	background: #eee;
	text-decoration: none;
}
.toc a:hover, .toc a:focus {
	color: #555;
	background: #ddd;
}
@media (min-width: 900px) {
	body {
		padding: 0 1rem 0 28%;  
	}
	.main-title,
	.toc {
		position: fixed;
		left: 1.5rem;
		width: 25%;
	}
	.main-title {
		top: 1rem;
		font-size: 3rem;
	}
	.toc {
		top: 14rem;
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console