Skip to content

Commit

Permalink
Merge pull request #1867 from davekiss/patch-1
Browse files Browse the repository at this point in the history
Add Tachyons as a CSS framework option
  • Loading branch information
retlehs authored Jun 13, 2017
2 parents 48c1d15 + 6b3d448 commit 6516998
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
9 changes: 9 additions & 0 deletions app/lib/Sage/PostCreateProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static function selectFramework(Event $event)
$frameworks = [
'Bootstrap',
'Foundation',
'Tachyons',
'None'
];
$framework = $io->select('<info>Select a CSS framework</info> <comment>(Default: Bootstrap)</comment>', $frameworks, 0);
Expand All @@ -68,6 +69,14 @@ 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('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')));
Expand Down

0 comments on commit 6516998

Please sign in to comment.