diff --git a/bin/theme_setup.sh b/bin/theme_setup.sh index d49fb77..18843fe 100755 --- a/bin/theme_setup.sh +++ b/bin/theme_setup.sh @@ -53,9 +53,15 @@ cp skeleton/demo/_vars.scss skeleton/${name} echo "Use Bourbon? [y/n]" read ans valid=0 +bourbon=0 -if [[ ("$ans" = "y" || "$ans" = "n" || "$ans" = "Y" || "$ans" = "N") ]]; then +if [[ ($ans =~ "y") || ($ans =~ "Y") || ($ans =~ "n") || ($ans =~ "N") ]]; then let valid=1 + if [[ ($ans =~ "n") || ($ans =~ "N") ]]; then + let bourbon=0 + else + let bourbon=1 + fi else let valid=0 fi @@ -63,14 +69,19 @@ fi while [ $valid -ne 1 ]; do echo "Invalid response, try again" read ans - if [[ ("$ans" = "y" || "$ans" = "n" || "$ans" = "Y" || "$ans" = "N") ]]; then + if [[ ($ans =~ "y") || ($ans =~ "Y") || ($ans =~ "n") || ($ans =~ "N") ]]; then let valid=1 + if [[ ($ans =~ "n") || ($ans =~ "N") ]]; then + let bourbon=0 + else + let bourbon=1 + fi else let valid=0 fi done -if [ $valid -eq 1 ]; then +if [ $bourbon -eq 1 ]; then # If gem doesn't exist then we don't need to bother command -v gem >/dev/null 2>&1 || { echo >&2 "Ruby Gems is not installed. Aborting." @@ -82,7 +93,8 @@ if [ $valid -eq 1 ]; then echo >&2 "Bourbon is not currently installed. Install bourbon now? [y/n]" echo "Note: you will be promoted to enter in your account password. This password is never saved. Ever." read ans - valid=0 + let valid=0 + let bourbon=0 if [[ ("$ans" = "y" || "$ans" = "n" || "$ans" = "Y" || "$ans" = "N") ]]; then let valid=1 echo "Installing bourbon..." @@ -112,9 +124,12 @@ if [ $valid -eq 1 ]; then bourbon install --path=skeleton/${name}/ cp skeleton/demo/_bourbon.scss skeleton/${name} sed -i "" -e $'8 a\\\n'"@import \"bourbon\";" skeleton/${name}/_vars.scss - echo "Theme setup complete!" - exit 0 fi +skeleton=$(ls | grep skeleton_*.scss) + +sed -i "" '/sphenoid/d' $skeleton +sed -i "" -e $'10 a\\\n'"@import \"core/bones/${name}\"; // compile with sass --update -C ${skeleton}.scss:${skeleton}.css" $skeleton + echo "Theme setup complete!" exit 0 diff --git a/core/_config.scss b/core/_config.scss index 9cdb675..af4799e 100644 --- a/core/_config.scss +++ b/core/_config.scss @@ -45,7 +45,7 @@ $mobile-portrait-width: 300px !global; // the mobile portrait media query $mobile-landscape-width: 420px !global; // the mobile landscape media query // ------ IMPORTS. DO NOT CHANGE -@import "dependencies" !global; -@import "functions" !global; -@import "mixins" !global; +@import "dependencies"; +@import "functions"; +@import "mixins"; // @import "_MYconfig.scss" !global; diff --git a/core/_dependencies.scss b/core/_dependencies.scss index 61f2d4b..3b51bf7 100644 --- a/core/_dependencies.scss +++ b/core/_dependencies.scss @@ -27,8 +27,13 @@ } } $top: percentage( 16 / $colCount ) - 2; - .columns.one-third { width: $top * (1 / 3) - 2; } - .columns.two-thirds { width: $top * (2 / 3) - 2; } + .one-third.columns { width: $top * (1 / 3) - 2; } + .two-thirds.columns { width: $top * (2 / 3) - 2; } + .full-width.columns { + width: 100%; + margin-left: 0; + margin-right: 0; + } // Offsets @include _offset(true, $colCount, false); } @@ -57,6 +62,11 @@ } .one-third.column { width: ( $width / 3 ) - 20} .two-thirds.column { width: ( ( $width * 2 ) / 3 ) - 20 } + .full-width.columns { + width: $width; + margin-left: 0; + margin-right: 0; + } @include _offset(false, $colCount, $colWidth); } } @@ -94,6 +104,11 @@ @include _group($colCount, ".columns", "after") { width: $width; } .one-third.column { width: $width; } .two-thirds.column { width: $width; } + .full-width.columns { + width: $width; + margin-left: 0; + margin-right: 0; + } @include _mobileOffset($colCount); } } diff --git a/core/_functions.scss b/core/_functions.scss index 7ce7bcf..cc14624 100644 --- a/core/_functions.scss +++ b/core/_functions.scss @@ -4,91 +4,77 @@ // addresses https://github.com/nex3/sass/issues/533 // number strip-units ( number $number ) -@if(not function-exists(strip-units)) { - @function strip-units($number) { - @return $number / ($number * 0 + 1); - } +@function strip-units($number) { + @return $number / ($number * 0 + 1); } // to determine the unit. If it's a percentage, then our equation changes. -@if(not function-exists(em)) { - @function em($px, $base: $base-font-size) { - @return _calcRU($px, $base, "em"); - } +@function em($px, $base: $base-font-size) { + @return _calcRU($px, $base, "em"); } -@if(not function-exists(rem)) { - @function rem($px, $base: $base-font-size) { - @return _calcRU($px, $base, "rem"); - } +@function rem($px, $base: $base-font-size) { + @return _calcRU($px, $base, "rem"); } -@if(not function-exists(precent)) { - @function percent($px, $base: $base-font-size) { - @return _calcRU($px, $base, "%"); - } +@function percent($px, $base: $base-font-size) { + @return _calcRU($px, $base, "%"); } -@if(function-exists(relative)) { - @function relative($size) { - @if($use-rem == true and $use-em == false and $use-percent == false) { - @return rem($size); - } @elseif($use-em == true and $use-rem == false and $use-percent == false) { - @return em($size); - } @elseif($use-percent == true and $use-rem == false and $use-em == false) { - @return percent($size); - } - - @return $size; // we're still using pixels +@function relative($size) { + @if($use-rem == true and $use-em == false and $use-percent == false) { + @return rem($size); + } @elseif($use-em == true and $use-rem == false and $use-percent == false) { + @return em($size); + } @elseif($use-percent == true and $use-rem == false and $use-em == false) { + @return percent($size); } + + @return $size; // we're still using pixels } // list triad ( color $color ) -@if(function-exists(triad)) { - @function triad($color) { - @if(type-of($color) != "color") { - @warn "Type must be color to continue. Aborting."; - @return null; - } +@function triad($color) { + @if(type-of($color) != "color") { + @warn "Type must be color to continue. Aborting."; + @return null; + } - $triad: (); - $hue: strip-units(hue($color)); + $triad: (); + $hue: strip-units(hue($color)); - @for $i from 1 through 3 { - @if($hue + 120 > 360) { - $hue: ($hue + 120) - 360; - } @else { - $hue: $hue + 120; - } - $color: hsl($hue, saturation($color), lightness($color)); - $triad: append($triad, $color); + @for $i from 1 through 3 { + @if($hue + 120 > 360) { + $hue: ($hue + 120) - 360; + } @else { + $hue: $hue + 120; } - - @return $triad; + $color: hsl($hue, saturation($color), lightness($color)); + $triad: append($triad, $color); } + + @return $triad; } // list square ( color $color ) -@if(not function-exists(square)) { - @function square($color) { - @if(type-of($color) != "color") { - @warn "Type must be color to continue. Aborting."; - @return null; - } +@function square($color) { + @if(type-of($color) != "color") { + @warn "Type must be color to continue. Aborting."; + @return null; + } - $square: (); - $hue: strip-units(hue($color)); + $square: (); + $hue: strip-units(hue($color)); - @for $i from 1 through 4 { - @if($hue + 90 > 360) { - $hue: ($hue + 90) - 360; - } @else { - $hue: $hue + 90; - } - $color: hsl($hue, saturation($color), lightness($color)); - $square: append($square, $color); + @for $i from 1 through 4 { + @if($hue + 90 > 360) { + $hue: ($hue + 90) - 360; + } @else { + $hue: $hue + 90; } - - @return $square; + $color: hsl($hue, saturation($color), lightness($color)); + $square: append($square, $color); } + + @return $square; } diff --git a/skeleton/demo/_vars.scss b/skeleton/demo/_vars.scss index d338a31..43fc708 100644 --- a/skeleton/demo/_vars.scss +++ b/skeleton/demo/_vars.scss @@ -3,7 +3,7 @@ // stored in the marrow folder, but to also create project-level // variables. -@import "core/config"; // default dependencies +@import "../../core/config"; // default dependencies // @import "marrow/_foo.scss"; // import dependencies in your marrow folder // @import "bourbon"; // install bourbon in this directory and uncomment this line to enable bourbon, for example diff --git a/skeleton/sphenoid/_vars.scss b/skeleton/sphenoid/_vars.scss index 45f5d12..073d940 100644 --- a/skeleton/sphenoid/_vars.scss +++ b/skeleton/sphenoid/_vars.scss @@ -6,7 +6,7 @@ @import "marrow/private"; @import "marrow/public"; -@import "core/config"; // default dependencies +@import "../../core/config"; // default dependencies // Yep, taken right from bourbon - https://github.com/thoughtbot/bourbon/blob/master/dist/settings/_prefixer.scss $prefix-for-webkit: true !default; diff --git a/skeleton_template.scss b/skeleton_template.scss index e022efd..8cf0bce 100644 --- a/skeleton_template.scss +++ b/skeleton_template.scss @@ -3,7 +3,7 @@ * @author Dennis Thompson * @copyright Copyright (c) 2014 AtomicPages LLC * @license MIT - * @version 2.0.0-b2 + * @version 2.0.0-b5 */ // Choose the your flavor of Skeleton Sass and compile