Skip to content

Instantly share code, notes, and snippets.

@cvializ
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save cvializ/c06ba3b170f7c10c2fdc to your computer and use it in GitHub Desktop.

Select an option

Save cvializ/c06ba3b170f7c10c2fdc to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<main>
<section class="containerComponent">
<div class="leaf containerComponent-leaf">
<label>Hello</label>
<input value="world" />
</div>
<div class="leaf containerComponent-leaf">
<label>Hello</label>
<input value="world" />
</div>
<div class="leaf containerComponent-leaf">
<label>Hello</label>
<input value="world" />
</div>
<div class="leaf containerComponent-leaf">
<label>Hello</label>
<input value="world" />
</div>
</section>
</main>
<aside>
<p>Without the breakpoint, the input elements are arranged in a single column.</p>
<p>Inside the breakpoint, after the screen is large enough, the input elements form a single row.</p>
</aside>
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// Breakpoint (v2.5.0)
// Susy (v2.1.3)
// ----
/* === Begin configuration === */
@import "susy";
@import "breakpoint";
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
@include border-box-sizing;
html { background: white; }
/* === End configuration === */
/* ui-responsive/sass/_layout.scss */
$grid-layout-large: (
container: auto,
columns: 24,
math: static,
column-width: 30px,
gutters: 10px/30px,
debug: (image: show, output: overlay)
);
$grid-layout-small: (
container: 390px,
columns: 12,
math: fluid,
column-width: auto,
gutters: 1/3,
debug: (image: show, output: overlay)
);
$susy: $grid-layout-small;
/* ui-responsive/scss/_breakpoints.scss */
$breakpoint-desktop: 960px;
/* your-app/css/_layout.scss */
main {
@include container;
}
/* leaf/css/_layout.scss */
.leaf {
label,
input {
@include full;
}
}
/* container/css/_layout.scss */
.containerComponent {
@include clearfix;
}
@include susy-breakpoint($breakpoint-desktop, $grid-layout-large) {
main {
@include container;
// undo the max-width set by static math
max-width: none;
}
.containerComponent {
@include span(16);
@include pre(4);
}
.containerComponent-leaf {
&.leaf {
@include span(4);
// Undo the break applied by @include full;
@include nobreak;
&:last-child {
@include last;
}
}
}
}
/* === Begin configuration === */
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html {
background: white;
}
/* === End configuration === */
/* ui-responsive/sass/_layout.scss */
/* ui-responsive/scss/_breakpoints.scss */
/* your-app/css/_layout.scss */
main {
max-width: 390px;
margin-left: auto;
margin-right: auto;
}
main:after {
content: " ";
display: block;
clear: both;
}
head {
display: block;
position: fixed;
right: 10px;
top: 10px;
z-index: 999;
color: #333;
background: rgba(255, 255, 255, 0.25);
}
head:before {
content: "|||";
display: block;
padding: 5px 10px;
font-family: sans-serif;
font-size: 16px;
font-weight: bold;
}
head:hover {
background: rgba(255, 255, 255, 0.5);
color: red;
}
head:hover ~ main, head:hover ~ body main {
position: relative;
}
head:hover ~ main:before, head:hover ~ body main:before {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: " ";
z-index: 998;
background-image: linear-gradient(to right, rgba(102, 102, 255, 0.25), rgba(179, 179, 255, 0.25) 75%, transparent 75%);
background-size: 8.51064%;
background-origin: content-box;
background-clip: content-box;
background-position: left top;
}
/* leaf/css/_layout.scss */
.leaf label,
.leaf input {
clear: both;
width: 100%;
float: left;
margin-left: 0;
margin-right: 0;
}
/* container/css/_layout.scss */
.containerComponent:after {
content: "";
display: table;
clear: both;
}
@media (min-width: 960px) {
main {
width: 950.0px;
margin-left: auto;
margin-right: auto;
max-width: none;
}
main:after {
content: " ";
display: block;
clear: both;
}
head:hover ~ main, head:hover ~ body main {
position: relative;
}
head:hover ~ main:before, head:hover ~ body main:before {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: " ";
z-index: 998;
background-image: linear-gradient(to right, rgba(102, 102, 255, 0.25), rgba(179, 179, 255, 0.25) 75%, transparent 75%);
background-size: 40px;
background-origin: content-box;
background-clip: content-box;
background-position: left top;
}
.containerComponent {
width: 630px;
float: left;
margin-right: 10px;
margin-left: 160px;
}
.containerComponent-leaf.leaf {
width: 150px;
float: left;
margin-right: 10px;
clear: none;
}
.containerComponent-leaf.leaf:last-child {
float: right;
margin-right: 0;
}
}
<main>
<section class="containerComponent">
<div class="leaf containerComponent-leaf">
<label>Hello</label>
<input value="world" />
</div>
<div class="leaf containerComponent-leaf">
<label>Hello</label>
<input value="world" />
</div>
<div class="leaf containerComponent-leaf">
<label>Hello</label>
<input value="world" />
</div>
<div class="leaf containerComponent-leaf">
<label>Hello</label>
<input value="world" />
</div>
</section>
</main>
<aside>
<p>Without the breakpoint, the input elements are arranged in a single column.</p>
<p>Inside the breakpoint, after the screen is large enough, the input elements form a single row.</p>
</aside>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment