123

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.

            
              <h1>BEM House Example</h1>
<p>The Block, Element, Modifier methodology (commonly referred to as BEM) is a popular naming convention for classes in HTML and CSS. Developed by the team at Yandex, the goal is to help developers better understand the relationship between the HTML and CSS in a given project.</p>
<h2>house (closed)</h2>
<div class="house">
  <div class="house__window">house__window</div>
  <div class="house__door">house__door</div>
  <div class="house__window">house__window</div>
  <div class="house__window">house__window</div>
  <div class="house__garage-door">house__garage-door</div>
</div>
<h2>house (open)</h2>
<div class="house">
  <div class="house__window house__window--is-open">house__window<br>
    <br>
    house__window--is-open</div>
  <div class="house__door house__door--is-open">house__door <br>
    <br>
    house__door--is-open</div>
  <div class="house__window house__window--is-open">house__window<br>
    <br>
    house__window--is-open</div>
  <div class="house__window house__window--is-open">house__window<br>
    <br>
    house__window--is-open</div>
  <div class="house__garage-door house__garage-door--is-open">house__garage-door<br>
    <br>
    house__garage-door--is-open</div>
</div>
<h2>Learn More</h2>
<ul>
  <li><a href="http://blog.decaf.de/2015/06/24/why-bem-in-a-nutshell/" target="_blank">‘Why BEM?’ in a nutshell</a></li>
  <li><a href="https://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/" target="_blank">MindBEMding</a> — getting your head ’round BEM syntax</li>
  <li><a href="http://cssguidelin.es/#bem-like-naming" target="_blank">CSS guidelines</a></li>
  <li><a href="http://www.smashingmagazine.com/2014/07/17/bem-methodology-for-small-projects/" target="_blank">BEM methodology for small projects</a></li>
  <li><a href="http://www.slideshare.net/MaxShirshin/bem-it-for-brandwatch" target="_blank">BEM It! for Brandwatch</a></li>
  <li><a href="http://www.phase2technology.com/blog/used-and-abused-css-inheritance-and-our-misuse-of-the-cascade/" target="_blank">Used and Abused</a> — CSS Inheritance and Our Misuse of the Cascade.</li>
  <li><a href="https://medium.com/objects-in-space/objects-in-space-f6f404727" target="_blank">Objects in Space</a> — A style-guide for modular SASS development using SMACSS and BEM</li>
  <li><a href="https://webuild.envato.com/blog/how-to-scale-and-maintain-legacy-css-with-sass-and-smacss/" target="_blank">How to Scale and Maintain Legacy CSS with Sass and SMACSS</a></li>
  <li><a href="https://www.bluegg.co.uk/building-my-health-skills-part-3/" target="_blank">Building a modular My Health Skills with BEM and Sass</a></li>
</ul>

<footer>
	<p>BEM Example by <a href="http://www.egnacheski.com" target="_blank">Robert Egnacheski</a></p>
</footer>

            
          
!
            
              // START COLORS -------------------------
@color-darkest: #000;
@color-brightest: #FFF;

// START TYPOGRAPHY
@font-base:12px;

// START MIXINS ---------------------------
.border-radius (@radius: 20px) {
	-webkit-border-radius: @radius;
	-moz-border-radius: @radius;
	border-radius: @radius;
}

.clearfix() {
	zoom: 1;

	&:before, &:after {
		content: "";
		display: table;
	}

	&:after {
		clear: both;
	}
}

// ASSIGNMENTS ----------------------------------------------


body{
	padding: 20px;
}

.house {
	.clearfix();
	
	width: 95%;
	margin: 20px 2.5%;
	padding: 40px 0 0;
	background:#DEDEDE;
	border: solid 1px #999;	
	
	display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-flex-wrap: nowrap;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-align-content: stretch;
    -ms-flex-line-pack: stretch;
    align-content: stretch;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
	
	div {
		margin: 0 1%;
		padding: 10px;
		color: #FFF;
		font-size: 10px;
		-webkit-order: 0;
		-ms-flex-order: 0;
		order: 0;
		-webkit-flex: 1 1 auto;
		-ms-flex: 1 1 auto;
		flex: 1 1 auto;
		-webkit-align-self: flex-end;
		-ms-flex-item-align: end;
		align-self: flex-end;
	}
	
	.house__door {
		bottom: 0;
		height: 300px;
		background: #900;
		width:10%;
	}
	
	.house__door--is-open{
		background: #333;
	}
	
	.house__window {
		background: #7ABAFF;
		width: 10%;
		height: 100px;
		margin-top: -120px;
		-webkit-align-self: center;
    	-ms-flex-item-align: center;
    	align-self: center;
		
	}
	
	.house__window--is-open {
		background:#13517C;
	}
	
	.house__garage-door{
		height: 300px;
		width:25%;
		background: #999;
	}
	
	.house__garage-door--is-open {
		background: #000;
	}
	
}

footer {
	padding: 20px;
	text-align: center;
	background: #DEDEDE;
	font-size: 12px;
}

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

Console