Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

possible to import SASS file in SCSS?

styles.scss

@import 'packages/bulma.sass';

bulma.sass

@charset "utf-8"
/*! bulma.io v0.6.1 | MIT License | github.com/jgthms/bulma */
@import "sass/utilities/_all"
@import "sass/base/_all"
@import "sass/elements/_all"
@import "sass/components/_all"
@import "sass/grid/_all"
@import "sass/layout/_all"

terminal

'Error: client/packages/bulma.sass.scss doesn\'t exist!

Is it possible to import SASS into a SCSS file? What is the best way to install bulma into a scss env.

I also tried @import 'packages/bulma' and get client/packages/bulma.scss doesn\'t exist!.

like image 382
Omar Avatar asked Jul 10 '18 19:07

Omar


People also ask

Can I use Sass in SCSS?

When you write Sass code in a . scss file, it is compiled into a regular CSS file that the browser will use to display it on the web page.

Can we import CSS file in SCSS?

The process for importing the regular CSS file into the SCSS file: You can create any number of CSS and SCSS files and you can use them using the keyword 'import'. For example, create one CSS file and import that file into the SCSS file then you can able to use that property in your project.

Is Sass the same as SCSS?

SASS is Syntactically Awesome Style Sheets and is an extension of CSS, which provides the features of nested rules, inheritance, Mixins, whereas SCSS is Sassy Cascaded Style Sheets which is similar to that of CSS and fills the gaps and incompatibilities between CSS and SASS.

Can I mix CSS and SCSS?

yes, that's perfectly fine, no problem.


1 Answers

tl;dr can you try removing the .sass extension?

@import 'packages/bulma';

More detailed answer from this post:

The Sass @import directive extends the CSS @import rule so that it works with .scss and .sass files. It imports the file referenced and any variables or mixins that are defined in the imported file so they can be used in the main file.

@import "typography.scss";

Assuming there’s a file typography.scss in the current directory, the contents of typography.scss will replace the @import statement.

Sass makes it even simpler. If you forget to include the extension, it will look for a file with the same name and either a .scss or .sass extension.

@import "typography";

The statement above would find either typography.scss or typography.sass in the same directory as the file importing the typography styles.

like image 116
hcs Avatar answered Oct 15 '22 08:10

hcs