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

$theme variable is not defined in pre-built themes. #13476

Closed
davidshen84 opened this issue Oct 7, 2018 · 4 comments
Closed

$theme variable is not defined in pre-built themes. #13476

davidshen84 opened this issue Oct 7, 2018 · 4 comments

Comments

@davidshen84
Copy link

Bug, feature request, or proposal:

But

What is the expected behavior?

The $theme variable should be defined in the pre-built themes.

What is the current behavior?

After @import a pre-built theme, the $theme variable is not defined.

What are the steps to reproduce?

@import "~@angular/material/prebuilt-themes/indigo-pink.css";

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

Follow the guide on https://material.angular.io/guide/theming-your-components#how-to-use-code-mixin-code- to define my own theme.

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


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 6.0.8
Node: 8.11.3
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.6.8
@angular-devkit/core         0.6.8
@angular-devkit/schematics   0.6.8
@schematics/angular          0.6.8
@schematics/update           0.6.8
rxjs                         6.2.1
typescript                   2.7.2

Is there anything else we should know?

@crisbeto
Copy link
Member

crisbeto commented Oct 7, 2018

It looks like your import is pointing to a .css file which is compiled and doesn't have any of the variables.

@manklu
Copy link

manklu commented Oct 7, 2018

Duplicate of #5152

@jelbourn
Copy link
Member

Duplicate of #5152

The docs will be updated with v7

@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

No branches or pull requests

4 participants