Closed gvn closed 3 years ago
Initial thoughts:
mofo-
?) to avoid polluting npm/Bower. Would love to hear thoughts from @gesa and @k88hudson
After doing login 3 times I honestly think it's a goddamned fool's errand.
The problem basically boils down to CSS. It's a big global variable that each potential consumer of your UI blob modifies. If you're using the same CSS base in every consumer then you might have a chance to make it work the first time you implement it. Otherwise it's a shitshow.
If we're going to write UI blobs that we expect to work across platforms then we need to write them in one of two ways: 1) a completely hostile environment, where we inline every single style with !important or something equally ridiculous 2) a completely clean environment, aka an iframe. this will probably have mobile issues though.
I have done CSS "namespacing" in the past where everything for a component's CSS is nested under a wrapper ID (eg: #webmaker-login .thing
). It's not a perfect solution, but it does keep collisions down...
I'm a strong supporter of namespacing css with a wrapper ID
Also, I do think that if we wrote login with vanilla DOM instead of the Angular+Shim approach we'd be in a far better place. What we have now is a serious maintenance problem and we should try our best to avoid ever getting into that situation again.
We need to codify best practices for writing UI components that are reusable across all our codebases and stack variants.