question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues in setting up with Rollup

See original GitHub issue

Hi. I am trying to setup MWC with rollup but am facing quite a few issues. Can you help?

I have setup rollup to use https://github.com/Anidetrix/rollup-plugin-styles for compiling sass with dart-css loader and the config section looks like this:

styles({
        modules: true,
        mode: "emit",
        sass: {
          impl: 'sass',
          fiber: require('fibers'),
          includePaths: [
            'node_modules'
          ]
        }
      }),
      litcss(),

And my main scsss file looks like this:

@use "@material/drawer";
@use "@material/list";

@include drawer.core-styles;
@include drawer.dismissible-core-styles;
@include drawer.modal-core-styles;
@include list.core-styles;

Case 1:

Import just using @use "@material/drawer";

I get this:

Capture1

I also tried to prefix with a ~ and it had same issues.

Case 2:

I added the suffix _index.css to make the scss file like this:

@use "~@material/drawer/_index.scss";
@use "~@material/list/_index.scss";

@include drawer.core-styles;
@include drawer.dismissible-core-styles;
@include drawer.modal-core-styles;
@include list.core-styles;

ion-menu-button {
  display: block;
}

(It does not work without the ~) After this, the scss is resolved. But internally the scss refers to other scss files which are being imported like this: @use "@material/theme/variables"; This fails because it does not refer to _variables.scss

Capture

Can you please guide me on how this can be fixed? Any reference rollup implementation which I can use? Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
asyncLizcommented, Sep 21, 2020

Keep in mind that Material Web Components (MWC) and this library, Material Components for the Web (MDC), are two separate, though related libraries.

MDC uses plain HTML, JS, and CSS to render components. For customization, Sass is required. It’s the original Material + Web!

MWC uses web components to render components. It wraps the plain HTML/JS/CSS from MDC to do so and is the newer cooler kid on the block. MWC does not require Sass for customization. It uses CSS custom properties exclusively to do its theming work instead.

You cannot use MDC Sass to customize MWC components. Generally speaking, you want to pick either MDC or MWC for your application. We don’t recommend mixing and matching the two unless you’re using a component from MDC that hasn’t been added to MWC yet.

I would recommend joining the Polymer Slack and hop into the #material channel if you have more starter questions that our community may help out with.

0reactions
tvvigneshcommented, Sep 21, 2020

Sure. Thanks for the clarification. That makes sense. Closing this issue. I am already in Polymer slack, will join the material channel as well 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · rollup/rollup - GitHub
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the...
Read more >
Issues with Rollups Not Running in Real Time - YouTube
Rollup Helper is meant to be easy to set up and use, but in this series of Troubleshooting Tip videos, I'll review the...
Read more >
rollup.js
When using the JavaScript API, the configuration passed to rollup.rollup must be an object and cannot be wrapped in a Promise or a...
Read more >
How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Rollup is a next-generation JavaScript module bundler. Author your app or library using ES2015 modules, then efficiently bundle them up into a single...
Read more >
Roll up values to parent issues on your timeline | Jira Software ...
Your rollup values are effected based on filters applied to your plan. Issues that are filtered out won't be included. Roll up estimates...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found