Skip to content

Materialize CSS custom theme #3347

@parker789

Description

@parker789

OS?

Mac OS X Sierra

Versions.

angular-cli: 1.0.0-beta.21
node: 7.1.0
os: darwin x64

Repro steps.

I created a new project using the ng new myapp --style=scss command. After doing this I've added the global .scss and .js dependencies into my angular-cli.json:

"styles": [
  "../node_modules/materialize-css/sass/materialize.scss",
  "styles.scss"
],
"scripts": [
 "../node_modules/jquery/dist/jquery.js",
 "../node_modules/materialize-css/dist/js/materialize.js"
],

After this I copied the materializecss' _variables.scss contents from node_modules/materialize-css/sass/components/_variables.scss into my local file src/assets/styles/_variables.scss, and inside this file I'm trying @import "./assets/styles/_variables.scss", which keeps resulting in the error log shown below. I found that both of these imports (below) together remove the error, but my modified styles are not showing within my app.. it still happens to be the default materialize-css theme.

@import "../node_modules/materialize-css/sass/components/_color.scss";
@import "./assets/styles/_variables.scss";

The log given by the failure.

ERROR in ./~/css-loader?sourcemap!./~/postcss-loader!./~/sass-loader?sourcemap!./src/styles.scss
Module build failed:
  $primary-color-light: lighten($primary-color, 15%);
                       ^
      Argument `$color` of `lighten($color, $amount)` must be a color

Backtrace:
	src/assets/styles/_variables.scss:40, in function `lighten`
	src/assets/styles/_variables.scss:40
      in myapp/src/assets/styles/_variables.scss (line 40, column 25)
 @ ./src/styles.scss 4:14-179
 @ multi styles

Mention any other details that might be useful.

I assume that this would also be an issue when trying to overwrite Bootstrap variables and other frameworks? Am I just doing something wrong? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions