Skip to content

Instantly share code, notes, and snippets.

@micheltlutz
Created August 20, 2015 20:05
Show Gist options
  • Save micheltlutz/c827f2511710307e12cc to your computer and use it in GitHub Desktop.
Save micheltlutz/c827f2511710307e12cc to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<!DOCTYPE HTML>
<html lang="pt-BR">
<head>
<title>BootStrap - Bagual</title>
<link href="assets/stylesheets/structure/grid.css" rel="stylesheet">
</head>
<body>
<!--
Simulação de grid 1
-->
<h1>Teste 1</h1>
<div class="container outline">
<div class="row">
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
</div>
<div class="row">
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
</div>
<div class="row">
<div class="col-3-12"><p>col-3</p></div>
<div class="col-3-12"><p>col-3</p></div>
<div class="col-3-12"><p>col-3</p></div>
<div class="col-3-12"><p>col-3</p></div>
</div>
<div class="row">
<div class="col-4-12"><p>col-4</p></div>
<div class="col-4-12"><p>col-4</p></div>
<div class="col-4-12"><p>col-4</p></div>
</div>
<div class="row">
<div class="col-5-12"><p>col-5</p></div>
<div class="col-5-12"><p>col-5</p></div>
<div class="col-2-12"><p>col-2</p></div>
</div>
<div class="row">
<div class="col-6-12"><p>col-6</p></div>
<div class="col-6-12"><p>col-6</p></div>
</div>
<div class="row">
<div class="col-7-12"><p>col-7</p></div>
<div class="col-5-12"><p>col-5</p></div>
</div>
<div class="row">
<div class="col-8-12"><p>col-8</p></div>
<div class="col-4-12"><p>col-4</p></div>
</div>
<div class="row">
<div class="col-9-12"><p>col-9</p></div>
<div class="col-3-12"><p>col-3</p></div>
</div>
<div class="row">
<div class="col-10-12"><p>col-10</p></div>
<div class="col-2-12"><p>col-2</p></div>
</div>
<div class="row">
<div class="col-11-12"><p>col-11</p></div>
<div class="col-1-12"><p>col-1</p></div>
</div>
<div class="row">
<div class="col-12-12"><p>col-6</p></div>
</div>
<div class="col-12-12">
<div class="col-6-12"><p>container 12 > col-6</p></div>
<div class="col-6-12"><p>container 12 > col-6</p></div>
</div>
</div>
</body>
</html>
// ----
// libsass (v3.2.5)
// ----
*{
box-sizing:border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
//Variáveis do grid
//Colunas
$grid-columns: 12;
$grid-max-width: 65em;
//Telas
$screen-xs: 320px;
$screen-sm: 640px;
$screen-md: 992px;
$screen-lg: 1200px;
//Estilo de teste
$color: #454545;
$grid-gutter-width:10px;
$bgcolor: #fff200;
$outline: #ffcc00;
//Tamanhos de tela
@mixin mobile {
@media (min-width: #{$screen-xs}) and (max-width: #{$screen-sm - 1px}) {
@content;
}
}
@mixin tablet {
@media (min-width: #{$screen-sm}) and (max-width: #{$screen-md - 1px}) {
@content;
}
}
@mixin desktop {
@media (min-width: #{$screen-md}) and (max-width: #{$screen-lg - 1px}) {
@content;
}
}
@mixin desktophd {
@media (min-width: #{$screen-lg}) {
@content;
}
}
@mixin grid($n, $screen, $grid-columns:$grid-columns){
$w: "";
@if($n < 4 and $screen < $screen-xs) or ($n < 4 and $screen < $screen-sm) or ($n < 4 and $screen < $screen-md){
$w: 100%
} @else{
$w: $n / $grid-columns * 100%;
}
//
@if($n < 3 and $screen < $screen-sm){
$w: 50%
} @else{
$w: $n / $grid-columns * 100%;
}
@if($n < 2 and $screen <= $screen-sm){
$w: 100%
} @else{
$w: $n / $grid-columns * 100%;
}
width: $w;
}
.container{
width: 100%;
}
/*-- our cleafix hack -- */
.row:before,
.row:after {
content:"";
display: table ;
clear:both;
}
[class*='col-'] {
float: left;
min-height: 1px;
width: 16.66%;
/*-- our gutter -- */
padding: $grid-gutter-width;
background-color: $bgcolor;
}
[class*='col-'] > p {
background-color: #99cc00;
padding: 0;
margin: 0;
text-align: center;
color: $color;
}
.outline, .outline *{
outline: 1px solid $outline;
}
@mixin forScreen($color, $screen:$screen-lg){
$a : "";
@for $i from 1 through $grid-columns {
.col-#{$i}-#{$grid-columns} {
@include grid($i, $screen);
background: $color;
}
}
}
@for $i from 1 through $grid-columns {
.col-#{$i}-#{$grid-columns} {
@include grid($i, $screen-lg);
}
}
//width: ($i / $grid-columns) * 100%;
@include mobile {
@include forScreen(green, $screen-xs);
}
@include tablet {
@include forScreen(gray, $screen-sm);
}
@include desktop {
@include forScreen(blue, $screen-md);
}
@include desktophd {
@include forScreen(red);
}
* {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.container {
width: 100%;
}
/*-- our cleafix hack -- */
.row:before,
.row:after {
content: "";
display: table;
clear: both;
}
[class*='col-'] {
float: left;
min-height: 1px;
width: 16.66%;
/*-- our gutter -- */
padding: 10px;
background-color: #fff200;
}
[class*='col-'] > p {
background-color: #99cc00;
padding: 0;
margin: 0;
text-align: center;
color: #454545;
}
.outline, .outline * {
outline: 1px solid #ffcc00;
}
.col-1-12 {
width: 8.33333%;
}
.col-2-12 {
width: 16.66667%;
}
.col-3-12 {
width: 25%;
}
.col-4-12 {
width: 33.33333%;
}
.col-5-12 {
width: 41.66667%;
}
.col-6-12 {
width: 50%;
}
.col-7-12 {
width: 58.33333%;
}
.col-8-12 {
width: 66.66667%;
}
.col-9-12 {
width: 75%;
}
.col-10-12 {
width: 83.33333%;
}
.col-11-12 {
width: 91.66667%;
}
.col-12-12 {
width: 100%;
}
@media (min-width: 320px) and (max-width: 639px) {
.col-1-12 {
width: 100%;
background: green;
}
.col-2-12 {
width: 16.66667%;
background: green;
}
.col-3-12 {
width: 25%;
background: green;
}
.col-4-12 {
width: 33.33333%;
background: green;
}
.col-5-12 {
width: 41.66667%;
background: green;
}
.col-6-12 {
width: 50%;
background: green;
}
.col-7-12 {
width: 58.33333%;
background: green;
}
.col-8-12 {
width: 66.66667%;
background: green;
}
.col-9-12 {
width: 75%;
background: green;
}
.col-10-12 {
width: 83.33333%;
background: green;
}
.col-11-12 {
width: 91.66667%;
background: green;
}
.col-12-12 {
width: 100%;
background: green;
}
}
@media (min-width: 640px) and (max-width: 991px) {
.col-1-12 {
width: 100%;
background: gray;
}
.col-2-12 {
width: 16.66667%;
background: gray;
}
.col-3-12 {
width: 25%;
background: gray;
}
.col-4-12 {
width: 33.33333%;
background: gray;
}
.col-5-12 {
width: 41.66667%;
background: gray;
}
.col-6-12 {
width: 50%;
background: gray;
}
.col-7-12 {
width: 58.33333%;
background: gray;
}
.col-8-12 {
width: 66.66667%;
background: gray;
}
.col-9-12 {
width: 75%;
background: gray;
}
.col-10-12 {
width: 83.33333%;
background: gray;
}
.col-11-12 {
width: 91.66667%;
background: gray;
}
.col-12-12 {
width: 100%;
background: gray;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.col-1-12 {
width: 8.33333%;
background: blue;
}
.col-2-12 {
width: 16.66667%;
background: blue;
}
.col-3-12 {
width: 25%;
background: blue;
}
.col-4-12 {
width: 33.33333%;
background: blue;
}
.col-5-12 {
width: 41.66667%;
background: blue;
}
.col-6-12 {
width: 50%;
background: blue;
}
.col-7-12 {
width: 58.33333%;
background: blue;
}
.col-8-12 {
width: 66.66667%;
background: blue;
}
.col-9-12 {
width: 75%;
background: blue;
}
.col-10-12 {
width: 83.33333%;
background: blue;
}
.col-11-12 {
width: 91.66667%;
background: blue;
}
.col-12-12 {
width: 100%;
background: blue;
}
}
@media (min-width: 1200px) {
.col-1-12 {
width: 8.33333%;
background: red;
}
.col-2-12 {
width: 16.66667%;
background: red;
}
.col-3-12 {
width: 25%;
background: red;
}
.col-4-12 {
width: 33.33333%;
background: red;
}
.col-5-12 {
width: 41.66667%;
background: red;
}
.col-6-12 {
width: 50%;
background: red;
}
.col-7-12 {
width: 58.33333%;
background: red;
}
.col-8-12 {
width: 66.66667%;
background: red;
}
.col-9-12 {
width: 75%;
background: red;
}
.col-10-12 {
width: 83.33333%;
background: red;
}
.col-11-12 {
width: 91.66667%;
background: red;
}
.col-12-12 {
width: 100%;
background: red;
}
}
<!DOCTYPE HTML>
<html lang="pt-BR">
<head>
<title>BootStrap - Bagual</title>
<link href="assets/stylesheets/structure/grid.css" rel="stylesheet">
</head>
<body>
<!--
Simulação de grid 1
-->
<h1>Teste 1</h1>
<div class="container outline">
<div class="row">
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
<div class="col-1-12"><p>col-1</p></div>
</div>
<div class="row">
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
<div class="col-2-12"><p>col-2</p></div>
</div>
<div class="row">
<div class="col-3-12"><p>col-3</p></div>
<div class="col-3-12"><p>col-3</p></div>
<div class="col-3-12"><p>col-3</p></div>
<div class="col-3-12"><p>col-3</p></div>
</div>
<div class="row">
<div class="col-4-12"><p>col-4</p></div>
<div class="col-4-12"><p>col-4</p></div>
<div class="col-4-12"><p>col-4</p></div>
</div>
<div class="row">
<div class="col-5-12"><p>col-5</p></div>
<div class="col-5-12"><p>col-5</p></div>
<div class="col-2-12"><p>col-2</p></div>
</div>
<div class="row">
<div class="col-6-12"><p>col-6</p></div>
<div class="col-6-12"><p>col-6</p></div>
</div>
<div class="row">
<div class="col-7-12"><p>col-7</p></div>
<div class="col-5-12"><p>col-5</p></div>
</div>
<div class="row">
<div class="col-8-12"><p>col-8</p></div>
<div class="col-4-12"><p>col-4</p></div>
</div>
<div class="row">
<div class="col-9-12"><p>col-9</p></div>
<div class="col-3-12"><p>col-3</p></div>
</div>
<div class="row">
<div class="col-10-12"><p>col-10</p></div>
<div class="col-2-12"><p>col-2</p></div>
</div>
<div class="row">
<div class="col-11-12"><p>col-11</p></div>
<div class="col-1-12"><p>col-1</p></div>
</div>
<div class="row">
<div class="col-12-12"><p>col-6</p></div>
</div>
<div class="col-12-12">
<div class="col-6-12"><p>container 12 > col-6</p></div>
<div class="col-6-12"><p>container 12 > col-6</p></div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment