Refactored SASS, mobile first
This commit is contained in:
parent
d4644e59d1
commit
f656e942da
17 changed files with 378 additions and 442 deletions
|
@ -1,34 +0,0 @@
|
|||
input, select, textarea, button {
|
||||
display: inline-block;
|
||||
font-family: $baseFontStack;
|
||||
font-size: 1em;
|
||||
line-height: marginBottom + px;
|
||||
color: #222;
|
||||
padding: ($marginBottom / 2) - 1px;
|
||||
background-color: $inputBackgroundColour;
|
||||
border: solid 1px $inputBorderColour;
|
||||
@include border-radius(3px);
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.control-group {
|
||||
margin-bottom: $marginBottom + px;
|
||||
}
|
||||
|
||||
.control-label {
|
||||
float: left;
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
margin-left: 160px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-block;
|
||||
background-color: $btnBackgroundColour;
|
||||
border: solid 1px $btnBorderColour;
|
||||
padding: ($marginBottom / 2) - 1px;
|
||||
@include border-radius(3px);
|
||||
@include box-shadow(3px);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
@mixin border-radius ($radius: 5px) {
|
||||
-webkit-border-radius: $radius;
|
||||
-moz-border-radius: $radius;
|
||||
-o-border-radius: $radius;
|
||||
border-radius: $radius;
|
||||
|
||||
}
|
||||
|
||||
@mixin col-width ($span: 1) {
|
||||
width: ( $columnWidth * $span ) + ( ( $span - 1 ) * $columnGutter ) * 1px;
|
||||
}
|
||||
|
||||
@mixin box-sizing ($box-model: 'border-box') {
|
||||
-webkit-box-sizing: $box-model;
|
||||
-moz-box-sizing: $box-model;
|
||||
box-sizing: $box-model;
|
||||
}
|
||||
|
||||
@mixin box-shadow($x-axis: 0, $y-axis: 2px, $blur: 2px, $alpha: 0.1) {
|
||||
-webkit-box-shadow: $x-axis $y-axis $blur rgba(0, 0, 0, $alpha);
|
||||
-moz-box-shadow: $x-axis $y-axis $blur rgba(0, 0, 0, $alpha);
|
||||
box-shadow: $x-axis $y-axis $blur rgba(0, 0, 0, $alpha);
|
||||
}
|
||||
|
||||
@mixin transition($duration:0.2s, $ease:ease-out) {
|
||||
-webkit-transition: all $duration $ease;
|
||||
-moz-transition: all $duration $ease;
|
||||
transition: all $duration $ease;
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
html {
|
||||
background-color: $bodyBackgroundColour;
|
||||
color: $color;
|
||||
font-family: $baseFontStack;
|
||||
font-size: ($baseFontSize / 16) * 1em;
|
||||
line-height: $baseLineHeight;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, p, ul, ol, table, pre, fieldset {
|
||||
margin-bottom: $marginBottom * 1px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: ($h1FontSize / $baseFontSize) * 1em;
|
||||
line-height: ($marginBottom / $h1FontSize ) * 1em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: ($h2FontSize / $baseFontSize) * 1em;
|
||||
line-height: ($marginBottom / $h2FontSize ) * 1em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: ($h3FontSize / $baseFontSize) * 1em;
|
||||
line-height: ($marginBottom / $h3FontSize ) * 1em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: ($h4FontSize / $baseFontSize) * 1em;
|
||||
line-height: ($marginBottom / $h4FontSize ) * 1em;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: ($h5FontSize / $baseFontSize) * 1em;
|
||||
line-height: ($marginBottom / $h5FontSize ) * 1em;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: ($h6FontSize / $baseFontSize) * 1em;
|
||||
line-height: ($marginBottom / $h6FontSize ) * 1em;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
margin-left: $listMarginLeft * 1px;
|
||||
}
|
||||
|
||||
ul ul, ol ol {
|
||||
margin-bottom: 0;
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
.container {
|
||||
width: $containerWidth * 1px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 0 $containerPadding * 1px;
|
||||
@media (max-width: 767px) {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
@media (max-width: 767px) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-left: -$columnGutter * 1px;
|
||||
*zoom: 1;
|
||||
@media (max-width: 767px) {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.row:before,
|
||||
.row:after {
|
||||
display: table;
|
||||
line-height: 0;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.row:after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.row-fluid {
|
||||
@media (max-width: 767px) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.col {
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
float: left;
|
||||
margin-left: $columnGutter * 1px;
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
display: block;
|
||||
float: none;
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
@include box-sizing(border-box);
|
||||
}
|
||||
}
|
||||
|
||||
.col1 { @include col-width(); }
|
||||
.col2 { @include col-width(2); }
|
||||
.col3 { @include col-width(3); }
|
||||
.col4 { @include col-width(4); }
|
||||
.col5 { @include col-width(5); }
|
||||
.col6 { @include col-width(6); }
|
||||
.col7 { @include col-width(7); }
|
||||
.col8 { @include col-width(8); }
|
||||
.col9 { @include col-width(9); }
|
||||
.col10 { @include col-width(10); }
|
||||
.col11 { @include col-width(11); }
|
||||
.col12 { @include col-width(12); }
|
|
@ -1,21 +0,0 @@
|
|||
.alignleft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
img.alignleft {
|
||||
margin-right: $columnGutter * 1px;
|
||||
}
|
||||
|
||||
.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
img.alignright {
|
||||
margin-left : $columnGutter * 1px;
|
||||
}
|
||||
|
||||
.aligncenter {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
// Base
|
||||
|
||||
$color: #333;
|
||||
$bodyBackgroundColour: #fff;
|
||||
|
||||
$baseFontStack: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
$baseFontSize: 14;
|
||||
$baseLineHeight: 1.5;
|
||||
$marginBottom: ($baseFontSize * $baseLineHeight);
|
||||
|
||||
$h1FontSize: 28;
|
||||
$h2FontSize: 24;
|
||||
$h3FontSize: 21;
|
||||
$h4FontSize: 18;
|
||||
$h5FontSize: 16;
|
||||
$h6FontSize: 16;
|
||||
|
||||
// Lists
|
||||
|
||||
$listMarginLeft: 24;
|
||||
|
||||
// Scaffolding
|
||||
|
||||
$containerWidth: 940;
|
||||
$containerPadding: 40;
|
||||
$columnGutter: 20;
|
||||
$columnCount: 12;
|
||||
$columnWidth: ( ( $containerWidth + $columnGutter ) - ( $columnGutter * $columnCount ) ) / $columnCount;
|
||||
|
||||
// Tables
|
||||
|
||||
$tableBorderColour: #ddd;
|
||||
|
||||
// Forms
|
||||
$inputBorderColour: #ccc;
|
||||
$inputBackgroundColour: #fff;
|
||||
$btnBorderColour: #ccc;
|
||||
$btnBackgroundColour: #eee;
|
37
_/scss/_vars.scss
Executable file
37
_/scss/_vars.scss
Executable file
|
@ -0,0 +1,37 @@
|
|||
// Base
|
||||
|
||||
$base-colour: #333;
|
||||
$base-background-colour: #fff;
|
||||
|
||||
$base-font-stack: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
$base-font-size: 14;
|
||||
$base-line-height: 1.5;
|
||||
$base-margin-bottom: ($base-font-size * $base-line-height);
|
||||
|
||||
$h1-font-size: 28;
|
||||
$h2-font-size: 24;
|
||||
$h3-font-size: 21;
|
||||
$h4-font-size: 18;
|
||||
$h5-font-size: 16;
|
||||
$h6-font-size: 16;
|
||||
|
||||
// Lists
|
||||
|
||||
$list-margin-left: 24;
|
||||
|
||||
// Scaffolding
|
||||
|
||||
$column-gutter: 20;
|
||||
$column-count: 12;
|
||||
$container-max-width: 1200;
|
||||
|
||||
// Tables
|
||||
|
||||
$table-border-colour: #ddd;
|
||||
|
||||
// Forms
|
||||
$input-border: solid 1px #ccc;
|
||||
$input-background: #fff;
|
||||
$btn-border: solid 1px #ccc;
|
||||
$btn-background: #eee;
|
||||
$btn-color: #333;
|
49
_/scss/generic/_mixins.scss
Executable file
49
_/scss/generic/_mixins.scss
Executable file
|
@ -0,0 +1,49 @@
|
|||
@mixin breakpoint($point) {
|
||||
@if $point == desktop {
|
||||
@media (min-width: 1200px) { @content; }
|
||||
}
|
||||
@else if $point == tablet-landscape {
|
||||
@media (min-width: 1024px) { @content; }
|
||||
}
|
||||
@else if $point == tablet-portrait {
|
||||
@media (min-width: 768px) { @content; }
|
||||
}
|
||||
}
|
||||
|
||||
@mixin border-radius ($radius: 5px) {
|
||||
-webkit-border-radius: $radius;
|
||||
-moz-border-radius: $radius;
|
||||
-o-border-radius: $radius;
|
||||
border-radius: $radius;
|
||||
}
|
||||
|
||||
@mixin col-width ($span: 1) {
|
||||
//width: ((($container-width / $column-count) * $span) - $column-gutter) / $container-width * 100%;
|
||||
width: ((100 / $column-count) * $span) - ($column-gutter / $container-max-width) * 100%;
|
||||
}
|
||||
|
||||
@mixin box-sizing ($box-model: 'border-box') {
|
||||
-webkit-box-sizing: $box-model;
|
||||
-moz-box-sizing: $box-model;
|
||||
box-sizing: $box-model;
|
||||
}
|
||||
|
||||
@mixin box-shadow($x-axis: 0, $y-axis: 2px, $blur: 2px, $alpha: 0.1) {
|
||||
-webkit-box-shadow: $x-axis $y-axis $blur rgba(0, 0, 0, $alpha);
|
||||
-moz-box-shadow: $x-axis $y-axis $blur rgba(0, 0, 0, $alpha);
|
||||
box-shadow: $x-axis $y-axis $blur rgba(0, 0, 0, $alpha);
|
||||
}
|
||||
|
||||
@mixin transition($duration:0.2s, $ease:ease-out) {
|
||||
-webkit-transition: all $duration $ease;
|
||||
-moz-transition: all $duration $ease;
|
||||
transition: all $duration $ease;
|
||||
}
|
||||
|
||||
@mixin gradient($from, $to) {
|
||||
background-color: $from;
|
||||
background-image: -webkit-linear-gradient($from, $to);
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
|
||||
background-image: -moz-linear-gradient($from, $to);
|
||||
background-image: -o-linear-gradient($from, $to);
|
||||
}
|
53
_/scss/generic/_normalise.scss
Executable file
53
_/scss/generic/_normalise.scss
Executable file
|
@ -0,0 +1,53 @@
|
|||
html {
|
||||
background-color: $base-background-colour;
|
||||
color: $base-colour;
|
||||
font: #{(($base-font-size / 16) * 1em)}/#{$base-line-height} $base-font-stack;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, p, ul, ol, table, pre, fieldset {
|
||||
margin-bottom: $base-margin-bottom * 1px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: ($h1-font-size / $base-font-size) * 1em;
|
||||
line-height: ($base-margin-bottom / $h1-font-size ) * 1em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: ($h2-font-size / $base-font-size) * 1em;
|
||||
line-height: ($base-margin-bottom / $h2-font-size ) * 1em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: ($h3-font-size / $base-font-size) * 1em;
|
||||
line-height: ($base-margin-bottom / $h3-font-size ) * 1em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: ($h4-font-size / $base-font-size) * 1em;
|
||||
line-height: ($base-margin-bottom / $h4-font-size ) * 1em;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: ($h5-font-size / $base-font-size) * 1em;
|
||||
line-height: ($base-margin-bottom / $h5-font-size ) * 1em;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: ($h6-font-size / $base-font-size) * 1em;
|
||||
line-height: ($base-margin-bottom / $h6-font-size ) * 1em;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
margin-left: $list-margin-left * 1px;
|
||||
}
|
||||
|
||||
ul ul, ol ol {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
0
_/scss/_reset.scss → _/scss/generic/_reset.scss
Normal file → Executable file
0
_/scss/_reset.scss → _/scss/generic/_reset.scss
Normal file → Executable file
33
_/scss/generic/_utilities.scss
Executable file
33
_/scss/generic/_utilities.scss
Executable file
|
@ -0,0 +1,33 @@
|
|||
.alignleft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
img.alignleft {
|
||||
margin-right: $column-gutter * 1px;
|
||||
}
|
||||
|
||||
.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
img.alignright {
|
||||
margin-left : $column-gutter * 1px;
|
||||
}
|
||||
|
||||
.aligncenter {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.clearfix {
|
||||
*zoom:1;
|
||||
&:before,
|
||||
&:after{
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
&:after{
|
||||
clear: both;
|
||||
}
|
||||
}
|
42
_/scss/objects/_forms.scss
Executable file
42
_/scss/objects/_forms.scss
Executable file
|
@ -0,0 +1,42 @@
|
|||
input, select, textarea, button {
|
||||
display: inline-block;
|
||||
font-family: $base-font-stack;
|
||||
font-size: 1em;
|
||||
line-height: $base-margin-bottom + px;
|
||||
padding: 2.5px 5px;
|
||||
color: $base-colour;
|
||||
background: $input-background;
|
||||
border: $input-border;
|
||||
@include border-radius(3px);
|
||||
margin-right: 5px;
|
||||
margin-bottom: -1px;
|
||||
width: 208px;
|
||||
}
|
||||
|
||||
.control-group {
|
||||
margin-bottom: $base-margin-bottom + px;
|
||||
}
|
||||
|
||||
.control-label {
|
||||
float: left;
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
margin-left: 160px;
|
||||
@extend .clearfix;
|
||||
}
|
||||
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
background: $btn-background;
|
||||
color: $btn-color;
|
||||
line-height: $base-margin-bottom + px;
|
||||
border: $btn-border;
|
||||
@include border-radius(3px);
|
||||
@include gradient(#fff, #eee);
|
||||
&:hover {
|
||||
@include gradient(#eee, #fff);
|
||||
}
|
||||
}
|
0
_/scss/_nav.scss → _/scss/objects/_nav.scss
Normal file → Executable file
0
_/scss/_nav.scss → _/scss/objects/_nav.scss
Normal file → Executable file
29
_/scss/objects/_scaffolding.scss
Executable file
29
_/scss/objects/_scaffolding.scss
Executable file
|
@ -0,0 +1,29 @@
|
|||
.container {
|
||||
padding: 0 ($column-gutter * 2) * 1px;
|
||||
max-width: $container-max-width * 1px;
|
||||
margin: 0 auto;
|
||||
@extend .clearfix;
|
||||
}
|
||||
|
||||
.row {
|
||||
@include breakpoint(tablet-portrait) { margin-left: -($column-gutter / $container-max-width) * 100%; }
|
||||
@extend .clearfix;
|
||||
}
|
||||
|
||||
.col {
|
||||
display: block;
|
||||
float: none;
|
||||
width: auto;
|
||||
@include breakpoint(tablet-portrait) {
|
||||
float: left;
|
||||
margin-left: ($column-gutter / $container-max-width) * 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@for $i from 1 through $column-count {
|
||||
.col#{$i} {
|
||||
@include breakpoint(tablet-portrait) {
|
||||
@include col-width($i);
|
||||
}
|
||||
}
|
||||
}
|
4
_/scss/_tables.scss → _/scss/objects/_tables.scss
Normal file → Executable file
4
_/scss/_tables.scss → _/scss/objects/_tables.scss
Normal file → Executable file
|
@ -7,8 +7,8 @@
|
|||
.table td {
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
border-top: 1px solid $tableBorderColour;
|
||||
padding: ($marginBottom / 2) * 1px 10px;
|
||||
border-top: 1px solid $table-border-colour;
|
||||
padding: ($base-margin-bottom / 2) * 1px 10px;
|
||||
}
|
||||
|
||||
.table th {
|
25
_/scss/style.scss
Normal file → Executable file
25
_/scss/style.scss
Normal file → Executable file
|
@ -1,24 +1,23 @@
|
|||
/*
|
||||
Theme Name: Bare Bones
|
||||
Theme URI: http://github.com/mikefrancis/barebones
|
||||
Author: Mike Francis
|
||||
Author: Mike Francis
|
||||
*/
|
||||
|
||||
// Variables, Mixins
|
||||
|
||||
@import "variables";
|
||||
@import "mixins";
|
||||
@import 'vars';
|
||||
@import 'generic/mixins';
|
||||
|
||||
// Base
|
||||
// Generic
|
||||
|
||||
@import "reset";
|
||||
@import "normalise";
|
||||
@import "utilities";
|
||||
@import 'generic/reset';
|
||||
@import 'generic/normalise';
|
||||
@import 'generic/utilities';
|
||||
|
||||
// Main
|
||||
// Objects
|
||||
|
||||
@import "scaffolding";
|
||||
@import "nav";
|
||||
@import "tables";
|
||||
@import "forms";
|
||||
//@import "icons"; Still in development
|
||||
@import 'objects/scaffolding';
|
||||
@import 'objects/nav';
|
||||
@import 'objects/tables';
|
||||
@import 'objects/forms';
|
Loading…
Add table
Add a link
Reference in a new issue