Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Im importing regular CSS file in SCSS file, but?

Tags:

css

sass

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.

like image 207
aloky Avatar asked Jul 25 '18 12:07

aloky


2 Answers

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)

like image 111
Sparker73 Avatar answered Oct 09 '22 21:10

Sparker73


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 :)

like image 23
Matty J Avatar answered Oct 09 '22 20:10

Matty J