Page does not load SCSS file

Asked

Viewed 407 times

1

I’m learning web development and started messing with SCSS in a layout but the browser is not pulling the same. It is being called along with the CSS that is working normally on the page.

<link href="css/abert_painel.scss" rel="stylesheet">
<link href="../build/css/custom.css" rel="stylesheet">

Already the performance of SCSS is being null and I get the following error message on inspector:

inserir a descrição da imagem aqui

Why does this happen? How can I solve this problem?

  • 1

    SCSS shouldn’t be compiled into a . css file and then you reference this file? (. css)

  • We can guide you how to install tools to build . scss for . css, what is your Operating System? Do you have Node? Ruby installed? Or search how to compile . scss

  • @David can. I’m using a mac

1 answer

1


In order to compile the . scss file for . css you need to have Ruby installed (this is one of the ways).

1.Check if you have already installed:

ruby -v

if it returns something like:

ruby 2.0.0p247 (2013-06-27 Revision 41674) [x86_64-darwin12.4.0]

Otherwise see here how to install ruby.

2.Install the Sass:

sudo gem install sass

3.Compiling

3.1 Static Mode:
That way each time you have a change in . scss you will have to type the command line below to compile.

sass --update cssfilename.scss

or a directory:

sass --update /directory/

3.2 Dynamic:
This way any changes made to . scss are automatically converted to . css.

sass --watch sass cssfilename.scss

or a directory:

sass --watch /directory/
  • put Sass --update abert_panel.scss and returned an error: -bash: Sass: command not found

  • typo sass -v, would have to return the installed version of SASS.. otherwise have to install

Browser other questions tagged

You are not signed in. Login or sign up in order to post.