components icon indicating copy to clipboard operation
components copied to clipboard

Schematic does not add custom theme

Open jerryorta opened this issue 8 years ago • 1 comments

Bug, feature request, or proposal:

When creating a new angular project using version 6.0 fo @angular/cli, And adding material with a custom theme using the schematic -- ng add @angular/material --theme=custom, Then a default custom theme should be applied to the file src/styles.scss.

What is the expected behavior?

The stubbed custom theme contents should be added to the file src/styles.scss.

What is the current behavior?

The follow error is thrown in the console: "No style files could be found into which a theme could be added"

What are the steps to reproduce?

In the console:


# create a new project with scss as default stylesheet
ng new test-styles --style=scss

# change directories
cd test-styles

# Use schematic to add material with custom theme
ng add @angular/material --theme=custom


What is the use-case or motivation for changing an existing behavior?

To add a custom theme to my projects.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Node 8.10.0 Angular 6.0.0 Material 6.0.0

Is there anything else we should know?

As a work-around, before adding material, in the angular.json file, change project “styles” to

"styles": [
  {
    "input": "src/styles.scss"
  }
], 

And then it works fine.

The issue appears to be here, which requires src/styles.scss to in an object.

jerryorta avatar May 06 '18 17:05 jerryorta

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.