Skip to content

Instantly share code, notes, and snippets.

@castastrophe
Created May 23, 2017 15:15
Show Gist options
  • Save castastrophe/7d687f164ca5ade4488e080cec33dbd4 to your computer and use it in GitHub Desktop.
Save castastrophe/7d687f164ca5ade4488e080cec33dbd4 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
> 1%
last 2 versions
<div class="region-content">
<h2>Hello World!
</h2>
<div id="block-block-1" class="block">
Lorem Ipsum Uno <a href="http://www.redhat.com">Click me</a>
</div>
<div id="block-block-5" class="block">
Lorem Ipsum Dos <a href="http://www.redhat.com">Click me</a>
</div>
<div id="block-block-7" class="block">
Lorem Ipsum Tres <a>Click me</a>
</div>
</div>
<footer class="footer" id="footer">Copyright 2015</footer>
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Solve each objective; use Google if you like!
// Objective #1 Resolve syntax issues so that this code compiles to CSS.
// Objective #2 Fix any potential problems this CSS could cause on redhat.com.
// Objective #3 Make the code DRY!
// Bonus, fix the HTML error
$gray: #eee;
$dark-gray: #ccc;
$red: #c00;
* {
box-sizing: border-box;
}
body {
font-family: helvetica;
height: 95vh;
display: flex;
flex-flow: column wrap;
justify-content: space-between;
}
a {
text-decoration: none;
color: $red;
}
.region-content {
flex-grow: 1;
}
.block {
float: left;
width: 32%;
background: $gray;
padding: 5px;
margin: 0 1.5% 0 0;
&:last-child {
margin-right: 0;
}
}
h2 {
@extend small-title !optional;
font-size: 5em;
font-weight: bold;
color: $gray;
}
.footer {
color: $dark-gray;
text-align: center;
}
@media screen and (max-width: 700px) {
h2 {
font-size: 3em;
}
.block {
float: none;
width: 100%;
margin: 0 0 3%;
}
}
* {
box-sizing: border-box;
}
body {
font-family: helvetica;
height: 95vh;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-flow: column wrap;
-ms-flex-flow: column wrap;
flex-flow: column wrap;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
}
a {
text-decoration: none;
color: #c00;
}
.region-content {
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
.block {
float: left;
width: 32%;
background: #eee;
padding: 5px;
margin: 0 1.5% 0 0;
}
.block:last-child {
margin-right: 0;
}
h2 {
font-size: 5em;
font-weight: bold;
color: #eee;
}
.footer {
color: #ccc;
text-align: center;
}
@media screen and (max-width: 700px) {
h2 {
font-size: 3em;
}
.block {
float: none;
width: 100%;
margin: 0 0 3%;
}
}
<div class="region-content">
<h2>Hello World!
</h2>
<div id="block-block-1" class="block">
Lorem Ipsum Uno <a href="http://www.redhat.com">Click me</a>
</div>
<div id="block-block-5" class="block">
Lorem Ipsum Dos <a href="http://www.redhat.com">Click me</a>
</div>
<div id="block-block-7" class="block">
Lorem Ipsum Tres <a>Click me</a>
</div>
</div>
<footer class="footer" id="footer">Copyright 2015</footer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment