Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Add fluid grid implementation and container tweaks [fixes #113]
Browse files Browse the repository at this point in the history
  • Loading branch information
ebollens committed Oct 16, 2012
1 parent 87bc102 commit 5bf6181
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 25 deletions.
83 changes: 83 additions & 0 deletions demo/base/grid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>

<head>
<title>Grid</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../build/css/blocks.css">
</head>

<body>

<h1>Grid</h1>

<div class="container">

<div class="row">
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
<div class="panel-1">
.panel-1
</div>
</div>

<div class="row">
<div class="panel-6">
.panel-6
</div>
<div class="panel-2">
.panel-2
</div>
<div class="panel-4">
.panel-4
</div>
</div>
<div class="row">
<div class="panel-6">
.panel-6
</div>
<div class="panel-6">
.panel-6
</div>
</div>
<div class="row">
<div class="panel-12 important">
.panel-12
</div>
</div>
</div>

</body>

</html>
12 changes: 0 additions & 12 deletions src/adapter/bootstrap/_util.scss

This file was deleted.

5 changes: 4 additions & 1 deletion src/adapter/bootstrap/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ $btnDangerBackground: $color-mood-danger-background !default;
$btnDangerBackgroundHighlight: $color-mood-danger-background-shadow !default;

$btnInverseBackground: $color-mood-inverse-background !default;
$btnInverseBackgroundHighlight: $color-mood-inverse-background-shadow !default;
$btnInverseBackgroundHighlight: $color-mood-inverse-background-shadow !default;

$fluidGridColumnWidth: $structure-panels-width;
$fluidGridGutterWidth: $structure-panels-gutter;
27 changes: 27 additions & 0 deletions src/adapter/bootstrap/base/structure/_panel.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@mixin -base-structure-grid-panel {

@media screen and (min-width: $breakpoint-small) {

[class*="panel-"] {
float: left;
&:not(:first-child){
margin-left: $structure-panels-gutter;
}
}

$i: $structure-panels;
@while $i > 0 {
.panel-#{$i} {
@include grid-fluid-span($i, $structure-panels-width, $structure-panels-gutter);
}
$i: ($i - 1);
}

}

@media screen and (max-width: $breakpoint-small - 1) {
[class*="panel-"] {
width: 100%;
}
}
}
6 changes: 6 additions & 0 deletions src/adapter/bootstrap/base/structure/_row.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@mixin -base-structure-grid-row {
&:not(.bootstrap){
@extend .row-fluid;
margin-left: 0;
}
}
17 changes: 13 additions & 4 deletions src/core/adapter/base/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
/****************************************************************************
* Dimensions and Breakpoints
* Breakpoints
*/

$base-breakpoint-small: 768px !default; /* width-based */
$base-breakpoint-medium: 978px !default; /* width-based */
$breakpoint-small: 768px !default; /* width-based */
$breakpoint-medium: 978px !default; /* width-based */

$max-container-width: 960px !default;
/****************************************************************************
* Structure
*/

$structure-container-gutter: 2%; /* minimum spacing on either side of container */
$structure-container-width-max: 1024px !default; /* pixel-based to limit max size (or false) */
$structure-panels: 12 !default;
$structure-panels-gutter: 2.5641% !default;
$structure-panels-width: (100% - ($structure-panels - 1) * $structure-panels-gutter)
/ $structure_panels;

/****************************************************************************
* Branding Colors
Expand Down
18 changes: 17 additions & 1 deletion src/core/adapter/base/structure/_container.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@mixin -base-structure-container {
max-width: 960px;
&:not(.bootstrap) {
width: 100%;
margin: auto;
@if $structure-container-width-max {
@media screen
and (max-width: $structure-container-width-max
+ $structure-container-width-max
* (($structure-container-gutter*2)/100%) )
and (min-width: 768px) /* body applies its own padding in bootstrap */
{
width: 100% - ($structure-container-gutter*2);
padding-left: $structure-container-gutter;
padding-right: $structure-container-gutter;
}
max-width: $structure-container-width-max;
}
}
}
3 changes: 3 additions & 0 deletions src/core/adapter/base/structure/_panel.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@mixin -base-structure-grid-panel {

}
3 changes: 3 additions & 0 deletions src/core/adapter/base/structure/_row.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@mixin -base-structure-grid-row {

}
6 changes: 3 additions & 3 deletions src/core/adapter/base/visibility/responsive/_hide.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
@mixin -base-visibility-hide-small {

@media screen and (max-width: $base-breakpoint-small - 1) {
@media screen and (max-width: $breakpoint-small - 1) {
display: none;
}

}

@mixin -base-visibility-hide-medium {

@media screen and (min-width: $base-breakpoint-small) and (max-width: $base-breakpoint-medium - 1) {
@media screen and (min-width: $breakpoint-small) and (max-width: $breakpoint-medium - 1) {
display: none;
}

}

@mixin -base-visibility-hide-large {

@media screen and (min-width: $base-breakpoint-medium) {
@media screen and (min-width: $breakpoint-medium) {
display: none;
}

Expand Down
8 changes: 4 additions & 4 deletions src/core/adapter/base/visibility/responsive/_show.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
@mixin -base-visibility-show-small {

@media screen and (min-width: $base-breakpoint-small) {
@media screen and (min-width: $breakpoint-small) {
display: none;
}

}

@mixin -base-visibility-show-medium {

@media screen and (max-width: $base-breakpoint-small - 1) {
@media screen and (max-width: $breakpoint-small - 1) {
display: none;
}

@media screen and (min-width: $base-breakpoint-medium) {
@media screen and (min-width: $breakpoint-medium) {
display: none;
}

}

@mixin -base-visibility-show-large {

@media screen and (max-width: $base-breakpoint-medium - 1) {
@media screen and (max-width: $breakpoint-medium - 1) {
display: none;
}

Expand Down
5 changes: 5 additions & 0 deletions src/core/definitions/base/structure/_grid.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.row {
@include -base-structure-grid-row;
}

@include -base-structure-grid-panel;

0 comments on commit 5bf6181

Please sign in to comment.