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

CSS module scripts #77

Closed
uasan opened this issue Oct 20, 2022 · 7 comments
Closed

CSS module scripts #77

uasan opened this issue Oct 20, 2022 · 7 comments
Assignees
Labels
from: Microsoft Proposed, edited, or co-edited by Microsoft. position: support topic: javascript Spec relates to the JavaScript programming language topic: loading venue: WHATWG HTML Workstream

Comments

@uasan
Copy link

uasan commented Oct 20, 2022

Request for position on an emerging web specification

Implement CSS module scripts

  • WebKittens who can provide input:

Information about the spec

Design reviews and vendor positions

  • TAG Design Review:
  • Mozilla standards-positions issue:

Bugs tracking this feature

Anything else we need to know

The CSS module scripts feature has been merged into the HTML spec.

@annevk annevk added concerns: integration Can't be used w/ other web platform features (or unclear what happens if used together) from: Microsoft Proposed, edited, or co-edited by Microsoft. topic: javascript Spec relates to the JavaScript programming language topic: loading venue: WHATWG HTML Workstream labels Oct 25, 2022
@annevk
Copy link
Contributor

annevk commented Oct 25, 2022

Adding concerns: integration due to whatwg/html#7233 still existing.

@uasan
Copy link
Author

uasan commented Feb 2, 2023

The importance of this implementation lies in the fact that now it is impossible to make a polyfill, because importing { type: "css" } causes a syntax error, this means that you need to respond different JS source code on the server depending on the browser

@annevk
Copy link
Contributor

annevk commented Feb 6, 2023

Note that as per references in #128 the underlying syntax is likely to change here.

@clshortfuse
Copy link

From a developer perspective I'm transcompiling imports into a constructable CSSStyleSheet for Firefox.

On Safari (non TP), I put it into a HTMLStyleSheet and pass the child CSSStyleSheet that's still attached. Before adding a CSSStyleSheet to a ShadowDOM (Web Components), the CSSStyleSheet is inspected and the parent HTMLStyleSheet gets cloned. I imagine if/when constructable CSSStyleSheets is out ot TP, I'll be able to reduce some code, but still would need transcompilation.

I hope it gets implemented, but not entirely important for production since we package imports before deployment. For development, we'd have 0 transcompile which means we can work directly against files on the drive instead of minified (FormAssociated is/was our only polyfill). That can be rather useful for live-editing styles within the browser (easier than source maps). We do not expect to move back to SCSS, or author CSS within JS.

@hober hober moved this from Unscreened to Needs position in Standards Positions Review Backlog Mar 23, 2023
@hober hober moved this from Needs position to Needs assignees in Standards Positions Review Backlog Mar 27, 2023
@hober hober moved this from Needs assignees to Needs position in Standards Positions Review Backlog Mar 27, 2023
@annevk
Copy link
Contributor

annevk commented May 12, 2023

This would be "position: support" if #77 (comment) were addressed. Marking this blocked for now.

@annevk annevk added the blocked Coming to a position is blocked on issues identified with the spec or proposal. label May 12, 2023
@uasan
Copy link
Author

uasan commented Sep 7, 2023

@annevk As I understand it, this commit should unblock this task?
Enable import-attributes - WebKit/WebKit@587c5d4

@annevk annevk removed blocked Coming to a position is blocked on issues identified with the spec or proposal. concerns: integration Can't be used w/ other web platform features (or unclear what happens if used together) labels Oct 29, 2023
@annevk
Copy link
Contributor

annevk commented Oct 29, 2023

As #77 (comment) has been resolved (thanks Nicolò!) and no other concerns have been raised I suggest we mark this "position: support" one week from now.

@annevk annevk moved this from Needs position to Position identified in Standards Positions Review Backlog Oct 29, 2023
@annevk annevk moved this from Position identified to Done in Standards Positions Review Backlog Nov 14, 2023
@annevk annevk closed this as completed Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from: Microsoft Proposed, edited, or co-edited by Microsoft. position: support topic: javascript Spec relates to the JavaScript programming language topic: loading venue: WHATWG HTML Workstream
Development

No branches or pull requests

5 participants