From 0287a0b13443da63d02c1a8f2d795935570a5309 Mon Sep 17 00:00:00 2001 From: Dave Kiss Date: Sat, 1 Apr 2017 19:08:11 -0700 Subject: [PATCH 1/6] Add Tachyons as a CSS framework option --- src/lib/Sage/PostCreateProject.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/Sage/PostCreateProject.php b/src/lib/Sage/PostCreateProject.php index d7583cbd9e..4a7af5c23b 100755 --- a/src/lib/Sage/PostCreateProject.php +++ b/src/lib/Sage/PostCreateProject.php @@ -52,6 +52,7 @@ public static function selectFramework(Event $event) $frameworks = [ 'Bootstrap', 'Foundation', + 'Tachyons', 'None' ]; $framework = $io->select('Select a CSS framework (Default: Bootstrap)', $frameworks, 0); @@ -68,6 +69,14 @@ public static function selectFramework(Event $event) } break; case 2: + file_put_contents('package.json', preg_replace("/{$default_framework_pattern}/", '"tachyons": "^4.6.2"', file_get_contents('package.json'))); + file_put_contents('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~tachyons/src/tachyons";' . "\n", file_get_contents('assets/styles/main.scss'))); + file_put_contents('assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('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('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '', file_get_contents('assets/styles/main.scss'))); file_put_contents('assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('assets/scripts/main.js'))); From b1ad725408fe40a404cbbc7ec4d9cb5d0a0c9fed Mon Sep 17 00:00:00 2001 From: Dave Kiss Date: Sat, 1 Apr 2017 19:11:26 -0700 Subject: [PATCH 2/6] Add Tachyons as CSS framework option --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e3e3c96edd..0b2d2ee299 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,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) @@ -45,7 +46,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) From aef74daa124fc748f0e0be1c3071c5b2fa12e1a4 Mon Sep 17 00:00:00 2001 From: Dave Kiss Date: Sat, 1 Apr 2017 19:12:35 -0700 Subject: [PATCH 3/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e67af4e08..7ee1e5d672 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### HEAD * 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 ### 9.0.0-beta.2: January 19th, 2016 * Fix Browersync ([#1815](https://github.com/roots/sage/pull/1815)) From b1859ccb27bc4506e9c7e2c101fecd678ebebf06 Mon Sep 17 00:00:00 2001 From: Dave Kiss Date: Sat, 1 Apr 2017 19:21:07 -0700 Subject: [PATCH 4/6] Add Tachyons PR link --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ee1e5d672..274e09f6b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ### HEAD * 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 +* Add Tachyons as a CSS framework option ([#1867](https://github.com/roots/sage/pull/1867)) ### 9.0.0-beta.2: January 19th, 2016 * Fix Browersync ([#1815](https://github.com/roots/sage/pull/1815)) From cd8f3069792dd01caeeb9317f57735736b6dfdd3 Mon Sep 17 00:00:00 2001 From: Dave Kiss Date: Sat, 1 Apr 2017 19:52:16 -0700 Subject: [PATCH 5/6] Use official SASS transpiled partials instead Sage works better without assuming PostCSS is part of the build process. Previously included version implements PostCSS. See: github.com/tachyons-css/tachyons-sass --- src/lib/Sage/PostCreateProject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Sage/PostCreateProject.php b/src/lib/Sage/PostCreateProject.php index 4a7af5c23b..70fcf2aa6c 100755 --- a/src/lib/Sage/PostCreateProject.php +++ b/src/lib/Sage/PostCreateProject.php @@ -69,8 +69,8 @@ public static function selectFramework(Event $event) } break; case 2: - file_put_contents('package.json', preg_replace("/{$default_framework_pattern}/", '"tachyons": "^4.6.2"', file_get_contents('package.json'))); - file_put_contents('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~tachyons/src/tachyons";' . "\n", file_get_contents('assets/styles/main.scss'))); + file_put_contents('package.json', preg_replace("/{$default_framework_pattern}/", '"tachyons-sass": "^4.7.1"', file_get_contents('package.json'))); + file_put_contents('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~tachyons-sass/tachyons";' . "\n", file_get_contents('assets/styles/main.scss'))); file_put_contents('assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('assets/scripts/main.js'))); foreach($files_to_clear as $file) { file_put_contents($file, ''); From 6b3d44857b80802dd82d5a657c14828135ebd015 Mon Sep 17 00:00:00 2001 From: Dave Kiss Date: Tue, 13 Jun 2017 08:47:10 -0400 Subject: [PATCH 6/6] assets -> resources/assets --- app/lib/Sage/PostCreateProject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/Sage/PostCreateProject.php b/app/lib/Sage/PostCreateProject.php index 359d592a4c..19d78f8e15 100755 --- a/app/lib/Sage/PostCreateProject.php +++ b/app/lib/Sage/PostCreateProject.php @@ -70,8 +70,8 @@ public static function selectFramework(Event $event) 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('assets/styles/main.scss', str_replace('@import "~bootstrap/scss/bootstrap";' . "\n", '@import "~tachyons-sass/tachyons";' . "\n", file_get_contents('assets/styles/main.scss'))); - file_put_contents('assets/scripts/main.js', str_replace("import 'bootstrap';\n", '', file_get_contents('assets/scripts/main.js'))); + 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, ''); }