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.

Handling names when propagating config from an all-in-one module to individual components

See original GitHub issue

MDC Web has an all-in-one package, including an scss file which currently imports all of the individual component packages and emits all their styles.

I suspect this gets far more use via its distributed CSS rather than running it through a preprocessor, but if someone were to @use this file, IIUC if we were to @forward each of the individual MDC package imports, it would also forward any with configuration to all of them?

This raises a potential question in terms of namespacing with configuration. For example, the names primary and secondary make sense when directly consuming @material/theme (referring to primary and secondary theme colors), but may be ambiguous in the context of the entire material-components-web library.

This probably seems like an edge case, but has any thought been given to some way to map variable names when @forwarded?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
nex3commented, Oct 12, 2018

We could probably do show * as button-*, yeah. I don’t think we’d need to have an equivalent with statement; as long as @forward forwards/renames variables, with should just work with the new names.

0reactions
nex3commented, Nov 12, 2018

Ah, I think I understand now.

In your last comment it sounded like you thought the with part would be redundant due to the nature of @forward? I took this to mean that show * as theme-* would already imply that the variables would similarly be renamed, and thus to override them you would already need to follow the new prefixed name.

Yeah, that’s right. As far as any users of material-components-web are concerned, the theme variable always has the same name whether it’s being accessed, set, or configured using with.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Log4j2 Example Tutorial - Configuration, Levels, Appenders
LoggerConfig name is identical to fully qualified class name (Software component). Logger instance will be created and associated with the ...
Read more >
Config propagation to child modules - nestjs - Stack Overflow
I'm looking for a way to: propagate config of a dynamic module into child modules; change imports of a dynamic module depending on...
Read more >
VBA Error Handling - A Complete Guide - Excel Macro Mastery
To understand error handling we must first understand the different types of errors in VBA. ... Giving a Sub or Function the same...
Read more >
Manual - NS-3
These two simulation modules by themselves are intended to comprise a generic simulation core that can ... Handling event handlers with different signatures....
Read more >
OpenTracing - NGINX Ingress Controller - Kubernetes
Enables requests served by NGINX for distributed tracing via The OpenTracing Project. Using the third party module opentracing-contrib/nginx-opentracing the ...
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