aloky
aloky

Reputation: 61

Im importing regular CSS file in SCSS file, but?

im import in scss @import "./libs/bootstrap-select.css";

after build given @import url(./libs/bootstrap-select.css);

i need css code in file

if import in scss @import "./libs/bootstrap-select"; norm, but

DEPRECATION WARNING on line 1, column 8 of /libsass/test.scss: Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass. Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer.

Upvotes: 6

Views: 5904

Answers (5)

Callum311
Callum311

Reputation: 47

wrap it in an url()

e.g.

@import url("{file Path here}");

Upvotes: 1

iDoes
iDoes

Reputation: 509

I had the same problem, but only needed the .css file on one page. My solution was, instead of importing it in my .scss, to copy the .css file from my resources directory to the public directory with Gulp. Then, on the page which needed the .css code I imported it with:

<link href="path + file.css" rel="stylesheet" type="text/css">

Upvotes: 0

Matty J
Matty J

Reputation: 3156

I just figured out a handy workaround for this problem. Simply rename your .css file to a .scss file and import that instead, making sure to update your import statement to reference the file with the new .scss extension. The warning goes away :)

Upvotes: 3

Sparker73
Sparker73

Reputation: 313

The latest implementation of LibSass is warning us about an upcoming change in an effort to stick to the sass standards and they primarily say that you should direct the sass/scss code to "load" your standard css file instead of importing it inline to form part of a unique css file, it won't work that way anymore, of course it is just a warning for now but in a near future they will remove that functionality, called by them "non-standard behavior" :D so I invite you to read this thread:

Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass. (GitHub issue #2362)

Upvotes: 3

Torjescu Sergiu
Torjescu Sergiu

Reputation: 1533

Import works for *.scss the same way as for *.css files - just omit the extension:

@import "path/to/file";

This will import file.css

If this does not work, change your extention from the .css file to .scss and import it @import "yourfile";

Upvotes: -1

Related Questions