Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dglazkov
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dglazkov/70b9fc2e0468a0ad23ed to your computer and use it in GitHub Desktop.
Save dglazkov/70b9fc2e0468a0ad23ed to your computer and use it in GitHub Desktop.
Widget Building Man's Style Problems

I am a Widget Building Man. I bulid widgets. All my widgets are custom elements. Each of my elements has a shadow tree that contains styles.

Situation 1: My widgets share the same set of styles, which makes them consistent and awesome. I keep this set of styles in awesome.css.

Situation 2: Some of my widgets have styles that are long and boring. I want to split them into a separate file, instead of using the style element.

In both situations:

  1. What's the easy-peasy HTML syntax for doing this?
  2. There's a distinct FOUC moment between instantiating the widget's shadow tree and the styles being available. How do I control that?
  3. Now that I have imports and their glorious dependency management, I also sort of want to use HTML imports to do this work for me. Why can't I do that?
  4. If not, at least make @import behave sanely in a shadow tree?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment