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.

Migrate to use the Sass module system

See original GitHub issue

As discussed offline with @abhiomkar and @aprigogin, we’d like to migrate the stylesheets in this repo to use the Sass module system.

I’m working on preparing a script that uses the Sass migrator to handle most of this migration, but I have a question about how to handle member prefixes.

Right now, most variables, mixins, and functions are manually namespaced with mdc-<component>-. Since the module system adds automatic namespacing, it makes sense to remove these manual prefixes (which the migrator can handle automatically).

However, there are two cases where this pattern doesn’t quite hold:

Note that however we choose to handle namespacing during this migration, we’ll add import-only files that forward the members with their original, manually-namespaced names. When downstream users migrate, the migrator will be able to detect this and automatically change these names when necessary.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
jathakcommented, Dec 13, 2019

Update: I now have a shell script that automatically migrates most components (still working on chips, drawer, textfield, and select, which have subdirectories that make it harder to structure the migration).

This script works using a combination of Sass migrator (currently on a branch, but will be released once sass/migrator#131 is merged) and some sed scripts (primarily for ripple, due to the two prefixes). For users still using @import, it will preserve both prefixes and indirect dependencies, and those users should be able to use the migrator themselves to fix both of these when they switch to @use.

0reactions
abhiomkarcommented, Jan 10, 2020

Yes, we can rename that mixin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrator - Sass
This migration converts stylesheets that use the old @import rule to load dependencies so that they use the Sass module system via the...
Read more >
The New SASS Module System: Out with @import, In with @use
The new @use rule is the replacement for @import which allows other stylesheets to use its variables, functions, and mixins. What makes the...
Read more >
Introducing Sass Modules - CSS-Tricks
Introducing Sass Modules · Import files with @use · Import built-in Sass modules · New and changed core features · Configure imported libraries....
Read more >
The Sass Module System - codeSTACKr
The heart of the Module System is the @use rule. This rule makes CSS, variables, mixins, and functions from another stylesheet accessible in...
Read more >
Sass: Migrator - Bootstrap中文网
The module migrator assumes that any stylesheet that is depended on using a @use rule or a @forward rule has already been migrated...
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