Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging two Sass files

Tags:

merge

sass

I'm wanting to on the fly merge two sass files together, so for instance:

If I have

.some-class
  color: white

and

.some-class
  background-color: red

then the end result would be

.some-class
  color: white
  background-color: red

Does anyone know of a tool / library that can do this kind of thing?

like image 722
Louis Sayers Avatar asked Oct 20 '25 04:10

Louis Sayers


1 Answers

Let's say you have 2 files:

a.scss

div{
    font-size: 42px;
}

and

b.scss

@import "a.scss";
div{
    color: red;
}

First you should run sass b.scss e.css it will output:

e.css

div {
  font-size: 42px; }

div {
  color: red; }

Then sass-convert e.css e.sass and you will get:

e.sass

div
  font-size: 42px
  color: red
like image 150
JAre Avatar answered Oct 23 '25 04:10

JAre