The Wayback Machine - https://web.archive.org/web/20220214191554/https://github.com/angular/components/issues/24405
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

docs: Add missing $theme to theming docs #24405

Open
1 task
chsami opened this issue Feb 13, 2022 · 2 comments
Open
1 task

docs: Add missing $theme to theming docs #24405

chsami opened this issue Feb 13, 2022 · 2 comments

Comments

@chsami
Copy link

@chsami chsami commented Feb 13, 2022

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I get an runtime error. Following the official document guide on using scss variables in your project: https://material.angular.io/guide/theming-your-components.

image

Reproduction

Steps to reproduce:

  1. Add the following code to your styles.scss
@use 'sass:map';
@use '@angular/material' as mat;

$color-config: mat.get-color-config($theme);
$primary-palette: map.get($color-config, 'primary');
$accent-palette: map.get($color-config, 'accent');
$warn-palette: map.get($color-config, 'warn');
$is-dark-theme: map.get($color-config, 'is-dark');
  1. Run project

Expected Behavior

No errors

Actual Behavior

image

Environment

  • Angular: 13.2.0
  • CDK/Material: 13.2.2
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

Repo with the a clean angular 13 project to reproduce: https://github.com/chsami/angular13withmaterial

@crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 13, 2022

It looks like you're referring to a variable called $theme that doesn't exist.

@wagnermaciel wagnermaciel changed the title Reading style values from a theme on clean Angular 13 Project docs: Add missing $theme to theming docs Feb 14, 2022
@wagnermaciel
Copy link
Contributor

@wagnermaciel wagnermaciel commented Feb 14, 2022

+1 to what @crisbeto said about the missing $theme. We should fix this in our docs. I think this would be a good first issue for someone wanting to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment