Skip to content
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

Schematic does not add custom theme #11188

Closed
jerryorta-dev opened this issue May 6, 2018 · 1 comment · Fixed by #11189
Closed

Schematic does not add custom theme #11188

jerryorta-dev opened this issue May 6, 2018 · 1 comment · Fixed by #11189

Comments

@jerryorta-dev
Copy link
Contributor

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.

@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 8, 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 a pull request may close this issue.

2 participants