1
I am doing a project and I am using bootstrap 4 with scss
I am creating a form
using the classes of the framework itself:
<form class="form-search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Digite o que está procurando" aria-label="Digite o que está procurando" aria-describedby="basic-addon2">
<div class="input-group-prepend">
<span class="input-group-text icon-location"><a href="#"><i class="fas fa-crosshairs"></i></a></span>
</div>
<input type="text" class="form-control" placeholder="Em: São Paulo" aria-label="Em: São Paulo" aria-describedby="basic-addon2">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button"><i class="fas fa-search"></i>Buscar</button>
</div>
</div>
</form>
and then to edit these elements I opened the file _variables.scss
bootstrap and copied input variables to another variable file that I created to not overwrite the ones from the framework itself:
$input-bg: lime !default;
$input-border-color: transparent !default;
$input-box-shadow: none !default;
however it does not work realize that I added the color Lime in the background of my input but it does not change remains white that is the standard bootstrap color anyone knows why? I thought it was the file order css
the more it is in first as shows the image below
my scss app.
Your new variables that you want to overwrite Bootstrap’s are in the app.css?
– hugocsl
@hugocsl are actually in a file called variables.scss I’m leaving apart for better organization
– Felipe Henrique
Dude you gotta see how you’re compiling this.... The important thing is that your new variables do not come first than Boostrap’s and yes After Bootstrap’s.
– hugocsl
I will post a print of my app.scss file and my variables.scss file
– Felipe Henrique
edited the question at the end insert the prints of my app and variable scss files and my css style is being imported after bootstrap.css
– Felipe Henrique
In the Chrome Devtools Source tab it looks like your CSS is being rendered I think it will be better for you to get the doubt out, but it’s probably the order he calls the classes when he compiles. You can try to put ! Mportant tb that can solve.
– hugocsl
Friend added the console print the question if you can take a look is what I wanted to see ?
– Felipe Henrique
Kirito what I meant was that its variables are being compiled within one of these CSS, so you said that within the css of Bootstrap itself. You have to open these rederized CSS in the Browser and identify the order of variables within the . css that is generated and read by the browser.
– hugocsl
@hugocsl friend I saw here and he is not generating these variables in css I updated the console screen for you to take a look at everything I put in my variable.scss file he changed in case the tags of media queries as you can see but the variables of bootstrap it does not implemented because it will be ?
– Felipe Henrique
Hard to say, either he overwrote the variables, or he simply didn’t consider his variables.scss when compiling and dropping the .css. This might even be a compiler configuration that elects styles of equal names in different files... you’ll know :/
– hugocsl
the problem is that the names are different one is _variables and mine is variables without the "underline"
– Felipe Henrique