Skip to content

Commit

Permalink
2.0.0-b4
Browse files Browse the repository at this point in the history
Added upgrade file to versioning, added sache support, added thefunctions partial in core
  • Loading branch information
atomicpages authored and atomicpages committed May 28, 2014
1 parent 3d22141 commit 0f2d3d7
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 4 deletions.
55 changes: 55 additions & 0 deletions bin/upgrade
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh

echo "Upgrade utility working...\n"
cwd=${PWD##*/}

if [[ $cwd = "bin" ]]; then
cd ../
fi

echo "Disclaimer: this utility it meant to aid in upgrading from Skeleton Sass 1.x to Skeleton Sass 2.x. If you have followed the wiki articles then please do not use this script without a clean installation of Skeleton Sass 2.x. We, AtomicPages LLC, are not responsible for any unforeseen events that arise by using this script. Please follow the prompts.\n"

echo "Did you add the contents from _vars.scss in Skeleton Sass 1.x to _MYconfig.scss in Skeleton Sass 2.x? [y/n]"
read ans

if [[ ($ans != "y") && ($ans != "Y") && ($ans != "YES") && ($ans != "yes") ]]; then
echo "Please copy the variables from _vars.scss and run the script again"
exit 0
fi

echo "Converting variable names..."

config=$(ls | grep config)
echo "Using ${config}"

if [[ ! $config =~ config\.(scss)$ ]]; then
echo "Global config file in root not found. Please execute bin/upgrade within the skeleton-sass directory. Current working directory is\n`pwd`" 1>&2
exit 1
fi

declare -a keys
declare -a values

# Keys need a value pair.
keys=("backgroundColor" "fontSize" "fontFamily" "fontColor" "formFont" "linkColor" "linkHoverColor" "linkDecoration" "headingFamily" "headingColor" "baseWidth" "baseColWidth" "baseGutterWidth" "isFluid" "baseColCount" "tabletWidth" "mobilePortraitWidth" "mobileLandscapeWidth")

values=("background-color" "font-size" "font-family" "font-color" "form-font" "link-color" "link-hover" "link-decoration" "heading-family" "heading-color" "base-width" "base-col-width" "base-gutter-width" "is-fluid" "base-col-count" "tablet-width" "mobile-portrait-width" "mobile-landscape-width")

# Both the keys and values should be the same length
length=${#keys[@]}

for (( i=0; i<${length}; i++ )); do
sed -i '' "s/${keys[i]}/${values[i]}/g" $config
done

echo "Launch Setup Utility now? [y/n]"
read ans

if [[ ($ans != "n") && ($ans != "N") && ($ans != "no") && ($ans != "No") && ($ans != "NO") ]]; then
bin/setup.sh
echo "Upgrade and Setup is complete!"
exit 0
fi

echo "Upgrade is complete! Rename _MYconfig.scss to a different name and import that file into core/_config.scss"
exit 0
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"ignore": [
"demo",
"flavors/sass/dev"
".gitignore",
"sache.json"
]
}
94 changes: 94 additions & 0 deletions core/_functions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Public functions that can be used globally. Have at it!

@import "dependencies"; // Don't remove me

// 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);
}
}

// 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");
}
}

@if(not function-exists(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, "%");
}
}

@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
}
}

// 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;
}

$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);
}

@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;
}

$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);
}

@return $square;
}
}
16 changes: 16 additions & 0 deletions sache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "skeleton-sass",
"description": "Description of project",
"tags": [
"starting-point",
"foundation",
"framework",
"responsive",
"bower",
"starter kit",
"grids",
"ui"
],
"website": "http://atomicpages.github.io/skeleton-sass/",
"docs": "https://github.com/atomicpages/skeleton-sass/wiki"
}
4 changes: 2 additions & 2 deletions skeleton/sphenoid/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ ol ol, ol ul {
}
font-size: 90%;
}
ul ul li, ul ol li,
ol ol li, ol ul li { margin-bottom: relative(6px); }
ul ul li, ul ol li,
ol ol li, ol ul li { margin-bottom: relative(6px); }
li {
line-height: relative(18px);
margin-bottom: relative(12px);
Expand Down

0 comments on commit 0f2d3d7

Please sign in to comment.