Material-components-web: [mdc-typography] Unable to overwrite styles in v5

Created on 25 Feb 2020  ยท  3Comments  ยท  Source: material-components/material-components-web

Bug report

I'm migrating to v5 and while trying to override headline styles using the sass modules syntax an error is displayed during the compilation phase.

Steps to reproduce

  1. Compile the following scss with sass:
@use "@material/typography" with (
 $styles-headline1: (
    font-weight: 300,
  ),
);

Actual behavior

formatted: `Error: This module was already loaded, so it can't be configured using "with".\n` +
    '   โ”Œโ”€โ”€> node_modules/@material/typography/_index.scss\n' +
    '3  โ”‚   @forward "./functions";\n' +
    '   โ”‚   ^^^^^^^^^^^^^^^^^^^^^^ new load\n' +
    '   โ•ต\n' +
    '   โ”Œโ”€โ”€> node_modules/@material/typography/_variables.scss\n' +
    '25 โ”‚   @use "./functions";\n' +
    '   โ”‚   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” original load\n' +

Expected behavior

Styles should be overwritten.

Additional context

I'm able to overwrite the font-family without issues when i compile:

@use "@material/typography" with (
 $font-family: unquote("MyCustomFont, Verdana, Arial, sans-serif")
);

I'm following the steps described in https://github.com/material-components/material-components-web/tree/master/packages/mdc-typography#overriding-styles

bug

Most helpful comment

Should be published now in v5.1.0.

All 3 comments

Duplicate of #5621. This issue was fixed today but has not been released yet. You can verify the fix by installing the canary version of @material/typography.

I'll check in tomorrow to see if there's a patch release on the horizon that we can cut.

Thank you @asyncLiz, i appreciate you quick reply on this.

I'll check in tomorrow to see if there's a patch release on the horizon that we can cut.

That will be great! So i will be able to continue the migration to v5.

Should be published now in v5.1.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

broros picture broros  ยท  3Comments

7iomka picture 7iomka  ยท  3Comments

yapryntsev picture yapryntsev  ยท  3Comments

patrickrodee picture patrickrodee  ยท  3Comments

trimox picture trimox  ยท  4Comments