diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index ac305ab..0000000 --- a/.bowerrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "directory": "dependencies", - "scripts": { - "postinstall": "node bin/install/install-check.js" - } -} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ba6e189 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 +indent_style = tab +tab_width = 4 + +[*.{yml}] +indent_style = space +indent_size = 2 diff --git a/README.md b/README.md index fbc7dc5..c268e10 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,55 @@ -Skeleton Sass 2 -======================= +Skeleton Sass 3 +=============== -Skeleton Sass is a "Sassification" of Dave Gamache's [Skeleton CSS](http://getskeleton.com) responsive Sass starting point. +Skeleton Sass is a highly modular version of [Skeleton CSS](http://getskeleton.com). +### Key Features * Ability to seamlessly adjust grids by changing the value of variables -* Install Skeleton Sass with bower via `bower install skeleton-sass` +* Themes +* Easy-to-use mixins and functions +* Install Skeleton Sass with bower or npm! * [Live demo!](http://atomicpages.github.io/skeleton-sass/demo/index.html) -* [Extensive documentation](https://github.com/atomicpages/skeleton-sass/wiki) +* [Heavily documented](https://github.com/atomicpages/skeleton-sass/wiki) -### Life after 2.5 -* At some point after 2.5 I would like to create a Ruby Gem of Skeleton Sass with Rails/Sinatra support. This will likely be the next major release (i.e. 3.0). +### Dependencies +* Sass 3.3+ -### Upgrading From 1.x -Skeleton Sass 2.x is **not** backwards compatible with Skeleton Sass 1.x due to a major change in the file structure. However, we have a [wiki article](https://github.com/atomicpages/skeleton-sass/wiki/Upgrade-from-1-to-2) that explains how to upgrade from Skeleton Sass 1 to Skeleton Sass 2. +#### Does this work with other Sass compilers? +Yes! Skeleton Sass has been tested with the following compilers and libsass wrappers -### Looking for Skeleton Sass 1? -We still have the latest stable release available to download if you wish! Head over to the [1.x-master branch](https://github.com/atomicpages/skeleton-sass/tree/1.x-master) and continue using Skeleton Sass 1. Version 1 docs can be found [here](https://github.com/atomicpages/skeleton-sass/wiki/Version-1-Docs). +* [Sass](http://sass-lang.com/) 3.3+ +* [libsass](https://github.com/sass/libsass) 3.2+ +* [Wellington](http://getwt.io/) 0.9.3+ +* [node-sass](https://www.npmjs.com/package/node-sass) 3.5+ -## TL;DR -Skeleton Sass is a Sass port of Skeleton CSS. Skeleton Sass 2 has been trimmed down and a **ton** of new features have been added. +#### Upgrading From 2.x +Skeleton Sass 3 is decently compatible to the 2.x series, but requires some manual labor (i.e. copy and pasting multiple files to the 2.x series). + +#### Upgrading From 1.x +Skeleton Sass 2 is **not** backwards compatible with Skeleton Sass 1.x due to a major change in the file structure. However, we have a [wiki article](https://github.com/atomicpages/skeleton-sass/wiki/Upgrade-from-1-to-2) that explains how to upgrade from Skeleton Sass 1 to Skeleton Sass 2. -Note: If you are new to Sass altogether then please read our [wiki](https://github.com/atomicpages/skeleton-sass/wiki) for a more in-depth look at Skeleton Sass, information regarding installing ruby and Sass, and many other valuable resources! +#### Looking for older versions of Skeleton Sass? +* Skeleton Sass 2 + * [Verion 2 branch](https://github.com/atomicpages/skeleton-sass/tree/master/2.0) + * [Version 2 docs](https://github.com/atomicpages/skeleton-sass/wiki/Version-2-Docs) +* Skeleton Sass + * [Version 1 branch](https://github.com/atomicpages/skeleton-sass/tree/master/1.0) + * [Version 1 docs](https://github.com/atomicpages/skeleton-sass/wiki/Version-1-Docs) -If you are not new to Sass and you've tried other Skeleton CSS Sass ports and had a feeling is dissatisfaction, then look no more. Skeleton Sass is your last stop. +#### New to Sass? +Check out our [wiki](https://github.com/atomicpages/skeleton-sass/wiki) for a more in-depth look at Skeleton Sass, information regarding installing ruby and Sass, and other valuable resources! + +## TL;DR +Skeleton Sass is a Sass port of Skeleton CSS. Skeleton Sass 3 decouples itself from your project so you can consume it without worrying if your package manager will clobber all of your hard work. ### Features 1. DRY 2. Customizable 3. Themeable -4. Bower ready -5. Upgradeable - -### Dependencies -The only dependency for Skeleton Sass to run is Sass 3.3+. Any other libraries (e.g. Bourbon) are up to you to include if you wish. **Warning:** The current stable release of Compass does *not* support Sass 3.3.x. Skeleton Sass uses functions that are a part of that version. There are currently alpha builds of Compass 1.x that do support Sass 3.3.x ### File Overview -* `bin` a directory that contains ruby executables - * `setup.rb` a ruby script that aids in setting up Skeleton Sass for first time use - * `theme_setup.rb` a ruby script that aids in setting up a custom theme for Skeleton Sass - * `upgrade` a bash script that aids in upgrading Skeleton Sass (ruby version in the making) - * `update.rb` a ruby script that handles updating Skeleton Sass (in progress) * `skeleton` where all of the magic happens * `core` * `_config.scss` the default global configuration variables @@ -114,6 +122,13 @@ Skeleton Sass is community driven. We will gladly review any issues that you fin Changelog --------- +### 3.0.0 +* Adding `package.json` for npm support +* Converting all core files to partials for better support for installing via bower and npm + +###### Removals +* `bin/` + ### 2.5.4 * Adding `normalize.scss` as a dependency * Merged master in development for version bump diff --git a/bin/assets/helper.rb b/bin/assets/helper.rb deleted file mode 100644 index 53a6485..0000000 --- a/bin/assets/helper.rb +++ /dev/null @@ -1,62 +0,0 @@ -module Helper - - def isValidName(name) - if name !~ /[-a-zA-Z0-9_]+/i - return false - end - - return true - end - - def yesno(question) - puts question - answer = gets.chomp - while answer !~ /y(es)?|n(o)?/i do - puts "Invalid input. #{question} [y/n]" - answer = gets.chomp - yesno(question) - end - - if answer =~ /y(es)/i - return true - end - - return false - end - - def nfqr(question, regex, errorMsg = "Invalid input. #{question}", isValid = nil) - puts isValid != 0 ? question : errorMsg - reply = gets.chomp - - if reply =~ regex - return nfqr(question, regex, errorMsg, 0) - end - - return reply - end - - def cp(file, destination) - if !File.exist?(file) # fail quickly if not found - raise SystemCallError, "#{file} was not found or does not exist" - end - - dest = File.open(destination, "w") - - File.open(file, "r") do |f| - f.each_line do |line| - dest.puts(line) - end - end - - dest.close - end - - def gem_available?(name) - Gem::Specification.find_by_name(name) - rescue Gem::LoadError - return false - rescue - return Gem.available?(name) - end - -end diff --git a/bin/install/install-check.js b/bin/install/install-check.js deleted file mode 100644 index dc3901e..0000000 --- a/bin/install/install-check.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * A simple script to determine where normalize.scss lives. We look for two cases: - * 1. my_bower/skeleton-sass/dependencies/normalize.scss - * 2. my_bower/normalize.scss - * Why is this needed? Sass provides no means for us to reluctantly import - * files meaning we can't use `!optional` - * There are ways to circumvent this by creating a new ruby module for Sass, - * but that doesn't port over to other compilers like libsass or phpsass. - * - * What this script does: - * This script validates the existence of normalize.scss either in skeleton sass - * or in a parent bower folder. This script will find a replace the instances where - * normalize.scss is imported in skeleton sass so you're ready to use skeleton - * out of the box. - * - * Note: normalize.scss is assumed to be in a parent bower directory. This script only - * fixes the import reference if `bower install` is run within skeleton sass. - */ - -const fs = require('fs'); -const path = require('path'); - -const MODULE_NAME = "skeleton-sass"; -const SEARCH_MODULE = "normalize.scss"; -const SKELETON_DEPS_DIRNAME = "dependencies"; - -(function () { - 'use strict'; - - let segments = __dirname.split(path.sep); - - let basePath = segments.slice(0, segments.indexOf(MODULE_NAME)).join(path.sep); - let bowerPath = basePath + path.join(path.sep, SEARCH_MODULE, path.sep); - let internalPath = basePath + path.join(path.sep, MODULE_NAME, SKELETON_DEPS_DIRNAME, SEARCH_MODULE, path.sep); - let normalizeImportFile = basePath + path.join(path.sep, MODULE_NAME, 'skeleton', 'themes', 'fresh', '_vars.scss'); - - fs.access(bowerPath, fs.F_OK, (bowerError) => { - if(bowerError) { - console.log(bowerPath + ' not found, checking ' + MODULE_NAME + ' dependencies'); - fs.access(internalPath, fs.R_OK, (internalDepsError) => { - if(internalDepsError) { - console.error('Missing core dependency for Skeleton Sass: ' + SEARCH_MODULE); - } else { - fs.readFile(normalizeImportFile, 'utf-8', (err, data) => { - if(err) { - throw err; - } - - let result = data.replace(/@import.+normalize\.scss.+;/, '@import' + - ' "../../../dependencies/normalize.scss/sass/normalize";'); - - fs.writeFile(normalizeImportFile, result, 'utf-8', (fwErr) => { - if(fwErr) { - throw fwErr; - } - }); - }); - } - }); - } - }); - -}()); diff --git a/bin/setup.rb b/bin/setup.rb deleted file mode 100755 index 1d48b78..0000000 --- a/bin/setup.rb +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env ruby -w - -require_relative("assets/helper") - -BEGIN { - if Dir.pwd =~ /bin$/i - Dir.chdir("../") - end - puts "Setup utility working..." -} - -include Helper - -STDOUT.flush -name = Helper.nfqr("Please enter in the name of your project with no spaces or special characters other than - or _ and press [ENTER]", /[^\w\-]/, "Project name invalid, please try again and press [ENTER]") - -puts "Project name is #{name}" -puts "Renaming _MYconfig.scss to _#{name}.config.scss" -File.rename("_MYconfig.scss", "_#{name}.config.scss") - -puts "Renaming skeleton_template to skeleton" -if File.exist?("skeleton_template.scss") - File.rename("skeleton_template.scss", "skeleton.scss") -else - puts "skeleton_template.scss does not exist. Skipping..." -end - -puts "Adding user override to core/_config.scss" -file = File.open("skeleton/core/_config.scss", "a") -file.puts "@import \"../../_#{name}.config.scss\"" -file.close - -END { - puts "Setup utility is complete!" -} diff --git a/bin/theme_setup.rb b/bin/theme_setup.rb deleted file mode 100755 index 8da46ae..0000000 --- a/bin/theme_setup.rb +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env ruby -w - -require_relative("assets/helper") - -BEGIN { - if Dir.pwd =~ /bin$/i - Dir.chdir("../") - end - puts "Theme setup utility working..." -} - -include Helper - -STDOUT.flush -name = Helper.nfqr("Please enter in the name of your theme with no spaces or special characters other than - or _ and press [ENTER]", /[^\w\-]/, "Theme name invalid, please try again and press [ENTER]") -puts "Theme name is #{name}" - -if !Dir.exist?("skeleton/themes/#{name}") - Dir.mkdir("skeleton/themes/#{name}") -end - -# create files and folders -puts "Creating required files and folders..." -file = File.open("skeleton/themes/_loader.scss", "w") -file.puts("// #{name} theme created with love using Skeleton Sass theme setup script!") -file.puts("\n@import \"#{name}/vars\";") -file.puts("@import \"#{name}/base\";") -file.puts("@import \"sphenoid/skeleton\"; // Override manually if you wish to create your own grid") -puts "skeleton/themes/_loader.scss has been updated... moving on" - -if !Dir.exist?("skeleton/themes/#{name}/marrow") - Dir.mkdir("skeleton/themes/#{name}/marrow") -end - -Helper.cp("skeleton/themes/demo/_base.scss", "skeleton/themes/#{name}/_base.scss") -Helper.cp("skeleton/themes/demo/_vars.scss", "skeleton/themes/#{name}/_vars.scss") -Helper.cp("skeleton/themes/demo/marrow/_mixins.scss", "skeleton/themes/#{name}/marrow/_mixins.scss") - -END { - puts "Theme setup complete!" -} diff --git a/bin/update.rb b/bin/update.rb deleted file mode 100755 index 070c257..0000000 --- a/bin/update.rb +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env ruby -w - -require_relative("assets/helper") -require 'rubygems' # if rubygems is not installed then we'll fail fast - -BEGIN { - if Dir.pwd =~ /bin$/i - Dir.chdir("../") - end - puts "Update utility working..." -} - -include Helper -STDOUT.flush - -if File.directory?("#{Dir.pwd}/.git") - if Helper.gem_available?('git') # assets the gem exists before we try to use it - require 'git' - g = Git.open(Dir.pwd) - if g.repo - if g.index.readable? - g.pull(g.repo, g.branch) - end - end - else - resp = Helper.yesno("Ruby git gem not found, install now? [y/n]") - if resp =~ /y(es)?/ - puts "Installing git gem..." - if RUBY_PLATFORM.downcase =~ /w(in)?32/i - `gem install git` - else - `sudo gem install git` - end - else - puts "Skipping git install..." - end - end -end - -if File.exist?(".bower.json") - resp = Helper.yesno("Bowers files found. Update with bower now? [y/n]") - if resp =~ /y(es)?/i - puts "Updating skeleton-sass" - `bower update skeleton-sass` - end -else - abort("No git repository or bower files were detected. Update manually...") -end - -END { - puts "Update complete!" -} diff --git a/bin/upgrade b/bin/upgrade deleted file mode 100755 index b24393b..0000000 --- a/bin/upgrade +++ /dev/null @@ -1,56 +0,0 @@ -#!/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]" -echo "Note: If you ran the setup utility, your global configuration name might differ" -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.rb - echo "Upgrade and Setup is complete!" - exit 0 -fi - -echo "Upgrade is complete! Rename _MYconfig.scss to a different name if you haven't done so already and import that file into core/_config.scss. You may also run bin/setup.sh from command line to automate this task." -exit 0 diff --git a/bin/upgrade.rb b/bin/upgrade.rb deleted file mode 100755 index 1056833..0000000 --- a/bin/upgrade.rb +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env ruby -w - -# Add module directly so the script works when copied -module Helper - - def isValidName(name) - if name !~ /[-a-zA-Z0-9_]+/i - return false - end - - return true - end - - def yesno(question) - puts question - answer = gets.chomp - while answer !~ /y(es)?|n(o)?/i do - puts "Invalid input. #{question} [y/n]" - answer = gets.chomp - yesno(question) - end - - if answer =~ /y(es)/i - return true - end - - return false - end - - def nfqr(question, regex, errorMsg = "Invalid input. #{question}", isValid = nil) - puts isValid != 0 ? question : errorMsg - reply = gets.chomp - - if reply =~ regex - return nfqr(question, regex, errorMsg, 0) - end - - return reply - end - - def cp(file, destination) - if !File.exist?(file) # fail quickly if not found - raise SystemCallError, "#{file} was not found or does not exist" - end - - dest = File.open(destination, "w") - - File.open(file, "r") do |f| - f.each_line do |line| - dest.puts(line) - end - end - - dest.close - end - - def gem_available?(name) - Gem::Specification.find_by_name(name) - rescue Gem::LoadError - return false - rescue - return Gem.available?(name) - end - -end - - -BEGIN { - if Dir.pwd =~ /bin$/i - Dir.chdir("../") - end - puts "Upgrade utility..." -} - -include Helper - -STDOUT.flush - -puts "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" - -resp = Helper.yesno("Did you add the contents from _vars.scss in Skeleton Sass 1.x to _MYconfig.scss in Skeleton Sass 2.x? [y/n]\nNote: If you ran the setup utility, your global configuration name might differ") - -if resp =~ /y(es)?/i - abort("Please copy the variables from _vars.scss and run the script again") -end - -puts "Converting variable names..." - -filename = "" -if RUBY_PLATFORM.downcase =~ /w(in)?32/i - filename = %x(dir /b *config.scss) -else - filename = %x(ls | grep config) -end - -if filename !~ /_+[\w-]*\.?conf(ig)?(uration)?\.scss/i - abort("Global config file in root not found. Please execute bin/upgrade within the skeleton-sass directory. Current working directory is #{Dir.pwd}") -end - -puts "Using #{filename}..." - -variables = { - "backgroundColor" => "background-color", - "fontSize" => "font-size", - "fontFamily" => "font-family", - "fontColor" => "font-color", - "formFont" => "form-font", - "linkColor" => "link-color", - "linkHoverColor" => "link-hover-color", - "linkDecoration" => "link-decoration", - "headingFamily" => "heading-family", - "headingColor" => "heading-color", - "baseWidth" => "base-width", - "baseWidthMQ" => "REMOVE_ME", - "baseColWidth" => "base-col-width", - "baseGutterWidth" => "base-gutter-width", - "isFluid" => "is-fluid", - "baseColCount" => "base-col-count", - "tabletWidth" => "tablet-width", - "mobilePortraitWidth" => "mobile-portrait-width", - "mobileLandscapeWidth" => "mobile-landscape-width" -} - -variables.each do |key, value| - %x(ruby -i.bak -pe "gsub /#{key}/i, '#{value}'" #{filename}) -end - -if File.exist?("#{filename}.bak") - File.delete("#{filename}.bak") -end - -puts "Variable conversion complete..." -if filename == "_MYconfig.scss" - resp = Helper.yesno("Launch setup utility now? [y/n]") - if(resp =~ /n(o)?/i) - abort("Upgrade is complete! Rename _MYconfig.scss to a different name if you haven't done so already and import that file into core/_config.scss. You may also run bin/setup.rb from command line to automate this task.") - else - puts "Upgrade process complete! Launching setup now..." - system("ruby -w bin/setup.rb") - end -end - -puts "Upgrade is complete!" diff --git a/bower.json b/bower.json index 6089cb2..9a719e3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "skeleton-sass", - "version": "2.5.4-dev2", + "version": "3.0.0-dev1", "author": "Dennis Thompson", "homepage": "http://atomicpages.github.io/skeleton-sass/", "repository": { diff --git a/package.json b/package.json new file mode 100644 index 0000000..0e024f6 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "skeleton-sass", + "version": "3.0.0-dev1", + "description": "Skeleton Sass is a highly modularized version of Skeleton CSS", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/atomicpages/skeleton-sass.git" + }, + "keywords": [ + "sass", + "skeleton", + "front-end", + "css", + "boilerplate" + ], + "author": "Dennis THompson", + "license": "MIT", + "bugs": { + "url": "https://github.com/atomicpages/skeleton-sass/issues" + }, + "homepage": "https://github.com/atomicpages/skeleton-sass#readme" +} diff --git a/skeleton_template.scss b/skeleton_template.scss index 4932631..4a3aa7c 100644 --- a/skeleton_template.scss +++ b/skeleton_template.scss @@ -3,7 +3,7 @@ * @author Dennis Thompson * @copyright Copyright (c) 2016 AtomicPages LLC * @license MIT - * @version 2.5.4 + * @version 3.0.0 */ @import "skeleton/themes/loader"; // sass --update -C skeleton.scss:skeleton.css