Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SASS/SCSS syntax inside <style> tag

Tags:

html

css

sass

Is it possible/allowed to use SASS/SCSS syntax inside .html file in tag? I'd like to define a variable inside .html file and than use it inside .sass file.

like image 897
nd_macias Avatar asked Apr 15 '14 09:04

nd_macias


People also ask

Can I use SCSS in SASS?

SASS and SCSS can import each other. Sass actually makes CSS more powerful with math and variable support. Let's list down the main difference between SASS and SCSS. SASS is used when we need an original syntax, code syntax is not required for SCSS.

Can we write SASS in CSS?

With Sass (Syntactically Awesome StyleSheets) your CSS code will be also awesome. Sass is a CSS preprocessor with a lot of powerful features. The most notable features are variables, extends, and mixins. Variables store information that can be reused later, like colors or other commonly used values.


2 Answers

Not inside normal HTML ..

I use it inside Vue template, with installed sass as following:

<style lang="scss">
    /* SCSS here ._. */
</style>
like image 127
JsonKody Avatar answered Oct 04 '22 13:10

JsonKody


Simply put, No, SASS is a CSS preprocessor- if you're looking at implementing variables into your CSS, one way may be to simply apply the variable directly to a class in your document head- as long as it is included in your page after your SCSS output, it will overwrite any other setting for that CSS style.

like image 23
SW4 Avatar answered Oct 04 '22 13:10

SW4