Look it is difficult to explain why the mistake without knowing what you did there. But the documentation helps a little to clarify things... You’ve probably changed some Mandatory Key
For example, we use the Primary, Success and Danger keys of the $Theme-Colors map, for links, buttons and form states. Replacing the values of these keys should not present problems, but removing them can cause problems in the Sass build.
Behold: https://getbootstrap.com.br/docs/4.1/getting-started/theming/#keys-bond%C3%B3rias
About reversing the order of your variables the indicated would really be they come before as the documentation says, but if you changed the variables directly in variable.scss
your problem may be related to what you said earlier about the Keys.
Anyway, in case you have touched this file see that the documentation itself does the @import
of variables
after the functions
//Partes obrigatórias
@import "../node_modules/bootstrap/scss/functions";
@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/mixins";
// Partes opcionais
@import "../node_modules/bootstrap/scss/reboot";
@import "../node_modules/bootstrap/scss/type";
@import "../node_modules/bootstrap/scss/images";
Behold: https://getbootstrap.com.br/docs/4.1/getting-started/theming/#importing
Then changing the order may not present unwanted effects. Although I recommend running some tests with some components etc to confirm that the CSS will load as expected...
OBS: Also, all Bootstrap variables have the flag !default
, this means that you can safely override the value of this variable. Your . scss would look like this: (but in your case may not solve if the value you changed was directly in the Bootstrap default variable)
// Suas sobrescrições de variáveis
$body-bg: #000;
$body-color: #111;
//Partes obrigatórias
@import "../node_modules/bootstrap/scss/functions";
@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/mixins";
See more here: https://getbootstrap.com.br/docs/4.1/getting-started/theming/#Vari%C3%A1veis-padr%C3%A3o
First thank you for the full and detailed reply! Now I haven’t changed anything, I just created a new variable file by copying the original variables, where I can edit and thus not change the pattern. After the installation via npm of Sass, bootstrap, jquery and Popper all works well, but it was necessary to comment on @import _root for now, but I know that is not the option I should use. I use Visual Studio Code and its terminal, so I have a unique and clean interface to work on Mac or Windows.
– Eduardo Correia
@Eduardocorreia guy I tested here and I got it. In fact you can do in several ways tried here and everything worked out, the only problem even was when I tried to change a color directly inside the _variable.scss ai it the same dick. But if you take some variable that’s in there and put it into a novacor.scss and import before the
/node_modules/bootstrap/scss/variables
or the full /bootstrap will work. Last This can help you a lot!! https://www.youtube.com/watch?v=6Ovw43Dkp44– hugocsl
Check it out, this is the video I used as a reference! I didn’t change any color. I just copied and saved it as a new file. I’ve seen other people with the same situation. I haven’t solved it yet, but I’ll try to redo everything to make sure nothing went wrong. If you know anything new about this, I’d appreciate your help.
– Eduardo Correia
@Eduardocorreia guy I tested on my own and tested tb as the video guy and had no problems. Since you are starting from 0, install Bootstrap and do not touch ANYTHING on it, then you create a . CSS that will be the only one. CSS that you will index on your page, and on . SCSS of this . CSS vc does so http://prntscr.com/mxrh2x or if you prefer you can do so: http://prntscr.com/mxrhq6 where this is
minhacor
is a scss where you will have your color variables changed that you copied from_variables
original Bootstrap. That’s basically it, here it worked both ways– hugocsl