Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behaviors should accept a Promise sheet type #3143

Open
nicholasrice opened this issue May 15, 2020 · 2 comments
Open

Behaviors should accept a Promise sheet type #3143

nicholasrice opened this issue May 15, 2020 · 2 comments
Labels
area:fast-element Pertains to fast-element improvement A non-feature-adding improvement

Comments

@nicholasrice
Copy link
Contributor

The behavior returned from matchMediaStylesheetBehaviorFactory currently accepts an ElementStyles object.

If we allow this to additionally accept a Promise<ElementStyles> type then this behavior could be used with dynamic import syntax: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import. In practice, this means that forced-color stylesheets could be dynamically loaded and not shipped in the primary bundles:

Previous

const styles = css` ....`
    .withBehaviors(forcedColorsStylesheetBehavior(css`/* high contrast styles */`))

Proposed additional behavior

const styles = css` ....`
    .withBehaviors(forcedColorsStylesheetBehavior(import("./high-contrast-stylesheet.js"))
@triage-new-issues triage-new-issues bot added the status:triage New Issue - needs triage label May 15, 2020
@nicholasrice nicholasrice added the improvement A non-feature-adding improvement label May 15, 2020
@triage-new-issues triage-new-issues bot removed the status:triage New Issue - needs triage label May 15, 2020
@EisenbergEffect EisenbergEffect added the area:fast-element Pertains to fast-element label Jul 20, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the warning:stale No recent activity within a reasonable amount of time label Dec 25, 2020
@nicholasrice nicholasrice added area:fast-foundation Pertains to fast-foundation and removed area:fast-element Pertains to fast-element labels May 20, 2021
@stale stale bot removed the warning:stale No recent activity within a reasonable amount of time label May 20, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the warning:stale No recent activity within a reasonable amount of time label Apr 16, 2022
@chrisdholt chrisdholt removed the warning:stale No recent activity within a reasonable amount of time label Apr 16, 2022
@EisenbergEffect EisenbergEffect added this to the FAST Foundation Future milestone May 16, 2022
@janechu janechu modified the milestones: FAST Foundation Future, FAST Element Future May 28, 2024
@janechu janechu changed the title match-media-stylesheet-behavior should accept a Promise sheet type Behaviors should accept a Promise sheet type May 28, 2024
@janechu janechu added area:fast-element Pertains to fast-element and removed area:fast-foundation Pertains to fast-foundation labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast-element Pertains to fast-element improvement A non-feature-adding improvement
Projects
Status: Triage
Development

No branches or pull requests

4 participants