Merge pull request #1867 from davekiss/patch-1

Add Tachyons as a CSS framework option
This commit is contained in:
Ben Word
2017-06-13 07:43:29 -06:00
committed by GitHub
3 changed files with 12 additions and 1 deletions

View File

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

View File

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

View File

@@ -52,6 +52,7 @@ class PostCreateProject
$frameworks = [
'Bootstrap',
'Foundation',
'Tachyons',
'None'
];
$framework = $io->select('<info>Select a CSS framework</info> <comment>(Default: Bootstrap)</comment>', $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')));