Add Tachyons as a CSS framework option

This commit is contained in:
Dave Kiss
2017-04-01 19:08:11 -07:00
committed by GitHub
parent 038de19e68
commit 0287a0b134

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": "^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')));