From 95e66e35d5deb47fe613762d7ae4e9c56824f448 Mon Sep 17 00:00:00 2001 From: Joe Woodhouse <joewoodhouse30@gmail.com> Date: Wed, 22 Feb 2017 21:26:34 +0000 Subject: [PATCH 1/2] Add note about when to import bootstrap CSS. --- packages/react-scripts/template/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index f44cd23dd59..19eb9dd1530 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -566,6 +566,7 @@ Import Bootstrap CSS and optionally Bootstrap theme CSS in the ```src/index.js`` import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap/dist/css/bootstrap-theme.css'; ``` +Ensure the bootstrap css is imported before the rest of your app (i.e. before `import Routes from './routes';`) so that your styles are loaded afterwards. Import required React Bootstrap components within ```src/App.js``` file or your custom component files: From bd394f58a414b373d7b7b6d1626c449f9f7d4710 Mon Sep 17 00:00:00 2001 From: Dan Abramov <dan.abramov@gmail.com> Date: Fri, 24 Feb 2017 16:32:16 +0000 Subject: [PATCH 2/2] Tweak --- packages/react-scripts/template/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 19eb9dd1530..3560603690e 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -560,13 +560,14 @@ npm install react-bootstrap --save npm install bootstrap@3 --save ``` -Import Bootstrap CSS and optionally Bootstrap theme CSS in the ```src/index.js``` file: +Import Bootstrap CSS and optionally Bootstrap theme CSS in the beginning of your ```src/index.js``` file: ```js import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap/dist/css/bootstrap-theme.css'; +// Put any other imports below so that CSS from your +// components takes precedence over default styles. ``` -Ensure the bootstrap css is imported before the rest of your app (i.e. before `import Routes from './routes';`) so that your styles are loaded afterwards. Import required React Bootstrap components within ```src/App.js``` file or your custom component files: