Skip to content

Using ng2-material variables in scss file? #211

Closed
@geraldpereira

Description

I started from the angular2-webpack-starter and added ng2-material:

  • I changed my webpack configuration to handle sccs files,
  • I created an index.scss file in assets to import ng2-material:
    $md-font-url: 'node_modules/ng2-material/dist/';   
    @import "node_modules/ng2-material/dist/font";   
    @import "node_modules/ng2-material/source/all";

So far it's working good, but I want to use ng-material scss variables in my components styles.

I changed the Home component to use a home.scss file instead of the original css one: styles: [ require('./home.scss') ].

When I use external variables in home.scss, I get Undefined variable errors.
If I import ng2-material sccs into my home.scss (@import "node_modules/ng2-material/source/all";) I get a Module build failed: $result: map_merge($result, ... error.

I can't figure out how to declare scss variables that could be used in all components scss files.

Timeline cannot be loaded

The timeline is currently unavailable due to a system error. Try reloading the page. Contact support if the problem persists.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Using ng2-material variables in scss file? · Issue #211 · PatrickJS/PatrickJS-starter