Ads Top

How to start work with SASS in reactjs?

How to install sass in react?

You want to create a sass file then need  to install npm install node-sass

Also, can check screenshot for the folder structures:

Then go to any directory or the root file where available src folder and create a file as you wish: here is an example for the creating a sass file: my.scss

SASS file have extension .scss

It’s not required any compiler as the koala, preprocessor or any other.

Now you can write your sass code as below:
$fntSize : 50px;
$padd : 40px;
$mar :0 10px;

.sassTest {

@mixin bordRadi($radius) {
  .boxSS { 
      @include bordRadi(10px 30px 60px 100px);
     border:3px solid #ddd;

nav.SS {
        ul {
        li { displayinline-blockmargin$mar; }
        a {
            padding6px 12px;
&::before {
    border-right2px solid #0bf;
    border-top2px solid #0bf;
    transform: rotate(45deg);


Now you will see your result as below screenshot:

No comments:

Copyright Reserved to Anything Learn. Powered by Blogger.