diff --git a/CHANGELOG.md b/CHANGELOG.md index 3403ea5..95cde8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Move `templates/` to `resources/views/`, move `assets/` to `resources/assets/`, rename `base.blade.php` to `app.blade.php` ([#1864](https://github.com/roots/sage/pull/1864)) * Add option to configure build settings ([#1822](https://github.com/roots/sage/pull/1822)) * Add support for HTML injection ([#1817](https://github.com/roots/sage/pull/1817)) +* Add Tachyons as a CSS framework option ([#1867](https://github.com/roots/sage/pull/1867)) ### 9.0.0-beta.2: January 19th, 2017 * Fix Browersync ([#1815](https://github.com/roots/sage/pull/1815)) diff --git a/README.md b/README.md index c4fbf55..e9f235f 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Sage is a WordPress starter theme with a modern development workflow. * CSS framework options: * [Bootstrap 4](http://getbootstrap.com/) * [Foundation](http://foundation.zurb.com/) + * [Tachyons](http://tachyons.io/) * None (blank slate) * Font Awesome (optional) @@ -48,7 +49,7 @@ $ composer create-project roots/sage your-theme-name dev-master During theme installation you will have the options to: * Update theme headers (theme name, description, author, etc.) -* Select a CSS framework (Bootstrap, Foundation, none) +* Select a CSS framework (Bootstrap, Foundation, Tachyons, none) * Add Font Awesome * Configure Browsersync (path to theme, local development URL) diff --git a/app/lib/Sage/PostCreateProject.php b/app/lib/Sage/PostCreateProject.php index d153992..19d78f8 100755 --- a/app/lib/Sage/PostCreateProject.php +++ b/app/lib/Sage/PostCreateProject.php @@ -52,6 +52,7 @@ class PostCreateProject $frameworks = [ 'Bootstrap', 'Foundation', + 'Tachyons', 'None' ]; $framework = $io->select('Select a CSS framework (Default: Bootstrap)', $frameworks, 0); @@ -68,6 +69,14 @@ class PostCreateProject } break; case 2: + file_put_contents('package.json', preg_replace("/{$default_framework_pattern}/", '"tachyons-sass": "^4.7.1"', file_get_contents('package.json'))); + file_put_contents('resources/assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~tachyons-sass/tachyons";' . "\n", file_get_contents('resources/assets/styles/main.scss'))); + file_put_contents('resources/assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('resources/assets/scripts/main.js'))); + foreach($files_to_clear as $file) { + file_put_contents($file, ''); + } + break; + case 3: file_put_contents('package.json', preg_replace("/\s+{$default_framework_pattern},/", '', file_get_contents('package.json'))); file_put_contents('resources/assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '', file_get_contents('resources/assets/styles/main.scss'))); file_put_contents('resources/assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('resources/assets/scripts/main.js')));