Sass 1
//Sass variables can store strings/numbers/booleans/colors/lists
//Any variables will affect only the selectors below it
$primo: red;
.coral{
color: $primo;
}
.coral1{
$primo: green; //use !global to reset the global variable
color: $primo ;
}.parent{
color: white;
background-color: black;
padding: 3px;
p{
margin: 0;
background-color: yellowgreen;
}
h6{
background-color: $primo;
}
}
//In the app.js file we import the sass file
import './App.scss';
<div>
<div className='parent'>
<p>Nested element </p>
<h6>Styled with nested sass </h6>
</div>
<div>
SCSS mixin, include and extend

Export Sass to javascript and CSS color-mix()

Set bootstrap variables with Scss


PreviousBoostrap 3 Bootstrap grid, Scrollspy, Toast and responsive navbarNextJS 1: variables, functions, parameters, array methods, data types, Math operations and HTML implementation
Last updated