Skip to content

feat: add sass support #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

feat: add sass support #97

wants to merge 2 commits into from

Conversation

wearska
Copy link

@wearska wearska commented Dec 9, 2015

Considering that all the styles end up inside the head tag of our html, I think it's safe to also generate sass files with new components, import them manually in the main "app.scss" file (located inside the "app" folder), which gets compiled to "app.css" and is linked in our index.html.

Also keep the generated .css files if anyone wants to use them

@wearska wearska changed the title add sass support feat: add sass support Dec 9, 2015
// Note: Order counts, so import your variables and mixins first
// --------------------------------

// e.g. @import 'app/components/example/example.scss'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listing every single scss file here is too error prone and besides, angular compiler will fetch all css files and prefix all selectors by default to provide css isolation. so we definitely don't want to list individual files here.

@IgorMinar
Copy link
Contributor

We should support sass out of the box, but not like this.

  • transpile all scss files via the sass plugin as you have it
  • do not concat all scss files via app.scss
  • modify blueprints to generate scss file instead of css file for each component
  • keep component blueprint requesting the css file (
    styleUrls: ['app/components/<%= dasherizedModuleName %>/<%= dasherizedModuleName %>.css'],
    )
  • ensure that paths in the dist align so that Angular fetches the css file one compiling the component in the browser

a lot of this stuff will change once we move the template compilation to the build step, but for now the above should do

@wearska
Copy link
Author

wearska commented Dec 10, 2015

Yeah but, If you compile all .scss files in place you would need to point each file to the variables and mixins, if that file uses any of them.

@IgorMinar
Copy link
Contributor

That sounds like a good thing to me. That's exactly what imports in the
typescript code do.
On Thu, Dec 10, 2015 at 2:14 AM wearska [email protected] wrote:

Yeah but, If you compile all .scss files in place you would need to point
each file to the variables and mixins, if that file uses any of them.


Reply to this email directly or view it on GitHub
#97 (comment).

@wearska wearska closed this Dec 17, 2015
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants