Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I import a LESS file into SASS?

I am trying to work with some grid widths using the bootstrap variables.less file, but I'd like to use SASS instead of LESS.

I've got the following code:

jqGrid.scss

@import url('../../Content/bootstrap/bootstrap-ui/less/variables.less');

@mixin colWidthPercent($columnNum, $widthPercent) {
    width: @screen-sm-min;
}

It doesn't like the @screen-sm-min, I'd assume because it's a LESS format.

Is there any way to mix a .less file and a .sass file?

like image 284
Scottie Avatar asked Aug 09 '14 18:08

Scottie


People also ask

Is Sass import deprecated?

As of October 2021 @import will be deprecated, along with global built-in functions, and one year after that (no later than October 2022) @import support will be dropped. Make sure you go check out the newly refreshed Sass documentation for the latest updates.

How do I import a SCSS file into Sass?

It is now possible to import css files directly into your sass file. The following PR in github solves the issue. The syntax is the same as now - @import "your/path/to/the/file" , without an extension after the file name. This will import your file directly.

How do I import CSS into less?

With (css) , the @import directive will remain as-is, and as a result the CSS file will be loaded by the browser at runtime ; with (inline) , the CSS file's contents are actually imported into the compiled stylesheet, which is what you want if that file is out of your web root for example.


1 Answers

No, that's not possible, because SASS and LESS aren't compatible with each other.

Just use the official SASS port of Bootstrap instead: https://github.com/twbs/bootstrap-sass

like image 52
cvrebert Avatar answered Oct 17 '22 23:10

cvrebert