angular-cli: SASS / CSS support, what am I missing?

Hi there again,

sorry for the multiple issues, I do understand that this is a pre-alpha version still though is awesome to use.

Now, as I read in the README there is already support for CSS preprocessors. So I installed node-sass as said and rename the files (one file it is for one component) to .sass. That was all. No .css file is produced. I kept the .css file in the styleUrls option but also tried the .sass that of course cannot be imported.

Now if I go back to .css the file is created and included but I see (in the Network tab) that is included as XHR and therefore browser is not recognise it as a Stylesheet and therefore again it’s not rendering the UI correctly.

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

No problem at all. Glad you got it working. FYI you can add class to a host component as host: { 'class': 'left-bar' } for example.

@jkuri can you have a look?

styles will be applied only to child elements . If you want to apply a style to the body tag , for example, you must load your style directly from index.html : <link rel="stylesheet" href="style.css"> and your style.sass : $font-stack: Helvetica, sans-serif; $primary-color: #f00; body {font: 100% $font-stack;color: $primary-color;} get in your /dist folder a’ style.css’ with this: body { font: 100% Helvetica, sans-serif; color: #f00; }

…and your text will be very red