momo
momo

Reputation: 185

How to merge css files (not .scss files) by sass or compass

Although I know CSS file is a valid SCSS but there is some reason ,so I can't change some files subfix to SCSS

global_min.scss

@import url("global/reset.css")
@import url("global/frameset.css");
@import url("global/header.css");
....
....

Can sass or compass merge it (´・_・`)

Upvotes: 2

Views: 3259

Answers (4)

piouPiouM
piouPiouM

Reputation: 5037

You can try the Sass CSS importer plugin, by Chris Eppstein himself :)

Upvotes: 4

You can't do that with SASS without renaming the CSS files.

I suggest that you use some kind of CSS compressor to concatenate and minify your CSS code. Please have a look at Yeoman, currently the most solid approach to handling this kind of tasks.

Upvotes: 1

Alp
Alp

Reputation: 29739

If you want to merge all css files into a single compiled css file, you need to change their extension to sass or scss and make the changes to be compatible with that format.

Upvotes: 0

user247702
user247702

Reputation: 24212

http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import

@import takes a filename to import. By default, it looks for a Sass file to import directly, but there are a few circumstances under which it will compile to a CSS @import rule:

  • If the file’s extension is .css.
  • If the filename begins with http://.
  • If the filename is a url().
  • If the @import has any media queries.

If none of the above conditions are met and the extension is .scss or .sass, then the named Sass or SCSS file will be imported.

Upvotes: 2

Related Questions