Skip to content

Commit

Permalink
2.0.0-b5
Browse files Browse the repository at this point in the history
Fixed issues in upgrade executable and added some more goodies. Fixed selector issues with fluid grid, added full-width selector, and more goodies.
  • Loading branch information
atomicpages authored and atomicpages committed May 28, 2014
1 parent 0f2d3d7 commit 5f0f4f0
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 77 deletions.
27 changes: 21 additions & 6 deletions bin/theme_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,35 @@ 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

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."
Expand All @@ -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..."
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions core/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
19 changes: 17 additions & 2 deletions core/_dependencies.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down
112 changes: 49 additions & 63 deletions core/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion skeleton/demo/_vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion skeleton/sphenoid/_vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion skeleton_template.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author Dennis Thompson <http://www.atomicpages.net>
* @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
Expand Down

0 comments on commit 5f0f4f0

Please sign in to comment.