spectrum-web-components icon indicating copy to clipboard operation
spectrum-web-components copied to clipboard

[Feat]: Leverage @lit-labs/context for theming

Open hunterloftis opened this issue 3 years ago • 1 comments

Code of conduct

  • [X] I agree to follow this project's code of conduct.

Impacted component(s)

sp-theme

Description of the requested feature

Once https://github.com/lit/lit/pull/1955 is merged & published, the community will be moving towards a standard context mechanism.

<sp-theme> provides two context-like services by listening to bubbled sp-query-theme and sp-language-context events. We should refactor these to leverage @lit-labs/context.

Mockups or screenshots

No response

Implementation notes or ideas

This could also include a tachometer test that places a few hundred lang subscribers onto the page, then toggles the lang values a few times.

hunterloftis avatar Apr 22 '22 17:04 hunterloftis

Great call. There is no perf tests in <sp-theme> right now. Not sure whether we'd be able to get a pure before/after test there, but it would be cool were we able to!

Westbrook avatar Apr 22 '22 17:04 Westbrook