-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to remove Bootstrap when creating project #1810
Conversation
|
||
if (!$remove_bootstrap) { | ||
return 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flip the default?
$io = $event->getIO();
if ($io->isInteractive()) {
if ($io->askConfirmation('<info>Remove Bootstrap?</info> [<comment>y,N</comment>]? ', false)) {
file_put_contents('package.json', str_replace(' "bootstrap": "^4.0.0-alpha.6",' . "\n", '', file_get_contents('package.json')));
file_put_contents('assets/styles/main.scss', str_replace('// Import npm dependencies' . "\n", '', file_get_contents('assets/styles/main.scss')));
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/dist/js/bootstrap\';' . "\n", '', file_get_contents('assets/scripts/main.js')));
file_put_contents('assets/styles/components/_comments.scss', '');
file_put_contents('assets/styles/components/_forms.scss', '');
file_put_contents('assets/styles/components/_wp-classes.scss', '');
file_put_contents('assets/styles/layouts/_header.scss', '');
}
}
file_put_contents('package.json', str_replace(' "bootstrap": "^4.0.0-alpha.6",' . "\n", '', file_get_contents('package.json'))); | ||
file_put_contents('assets/styles/main.scss', str_replace('// Import npm dependencies' . "\n", '', file_get_contents('assets/styles/main.scss'))); | ||
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/dist/js/bootstrap\';' . "\n", '', file_get_contents('assets/scripts/main.js'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"import 'bootstrap/dist/js/bootstrap';"
will phpcs complain about this? :(
One step further? Instead of removing bootstrap, maybe we could choose between bootstrap, foundation, etc..? |
Working on it 😊
…Sent from my iPhone
On Jan 17, 2017, at 1:15 PM, Brandon Tamm ***@***.***> wrote:
One step further? Instead of removing bootstrap, maybe we could choose between bootstrap, foundation, etc..?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@retlehs you're the man! On a side note - check out https://github.com/iamdb/bedrock-wordpress-docker. I build all my sites with this type of setup. I adapt it and script deployment processes, of course - may be of interest to you 😊 |
when creating a new sage project (
composer create-project roots/sage your-theme-name
) you will be prompted:if yes, bootstrap is removed from:
package.json
assets/styles/main.scss
assets/scripts/main.js
assets/styles/components/_comments.scss
assets/styles/components/_forms.scss
assets/styles/components/_wp-classes.scss
assets/styles/layouts/_header.scss