René's URL Explorer Experiment


Title: CSS module support · Issue #46689 · microsoft/TypeScript · GitHub

Open Graph Title: CSS module support · Issue #46689 · microsoft/TypeScript

X Title: CSS module support · Issue #46689 · microsoft/TypeScript

Description: Suggestion Now that TS 4.5 supports import assertions and JSON modules, it'd be great if it similarly supported CSS modules which are now shipping in Chrome and Edge. There are two aspects of JSON module support that would be important t...

Open Graph Description: Suggestion Now that TS 4.5 supports import assertions and JSON modules, it'd be great if it similarly supported CSS modules which are now shipping in Chrome and Edge. There are two aspects of JSON ...

X Description: Suggestion Now that TS 4.5 supports import assertions and JSON modules, it'd be great if it similarly supported CSS modules which are now shipping in Chrome and Edge. There are two aspects of J...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/46689

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CSS module support","articleBody":"# Suggestion\r\n\r\nNow that TS 4.5 supports import assertions and JSON modules, it'd be great if it similarly supported [CSS modules](https://github.com/WICG/webcomponents/blob/gh-pages/proposals/css-modules-v1-explainer.md) which are now shipping in Chrome and Edge.\r\n\r\nThere are two aspects of JSON module support that would be important to add for CSS modules:\r\n1. Built-in typing of CSS modules based on their import assertion. This could be done in library code with https://github.com/microsoft/TypeScript/issues/46135 but since there's a specified interface of CSS modules, the type would ideally be included in TS's DOM lib.\r\n2. Copying of CSS files during build. JSON files are copied as part of compilation so that relative paths to JSON modules work in the compiled output. Doing this for CSS modules would ensure that they also work in the output without an extra copy step.\r\n\r\n## 🔍 Search Terms\r\n\r\n* CSS module\r\n\r\n## ✅ Viability Checklist\r\n\r\n\u003c!--\r\n   Suggestions that don't meet all these criteria are very, very unlikely to be accepted.\r\n   We always recommend reviewing the TypeScript design goals before investing time writing\r\n   a proposal for ideas outside the scope of the project.\r\n-->\r\nMy suggestion meets these guidelines:\r\n\r\n* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [x] This could be implemented without emitting different JS based on the types of the expressions\r\n* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)\r\n* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n\r\n## ⭐ Suggestion\r\n\r\n\u003c!-- A summary of what you'd like to see added or changed -->\r\n\r\n## 📃 Motivating Example\r\n\r\n```ts\r\nimport styles from './styles.css' assert {type: 'css'};\r\ndocument.adoptedStyleSheets = [...document.adoptedStyleSheets, styles];\r\n```\r\n\r\n## 💻 Use Cases\r\n\r\nImporting standard CSS modules...","author":{"url":"https://github.com/justinfagnani","@type":"Person","name":"justinfagnani"},"datePublished":"2021-11-04T19:55:43Z","url":"https://github.com/microsoft/TypeScript/issues/46689"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:90eb19f7-5697-33ea-8ec2-d92d14d89659
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB9F0:16AB79:AC6529:DC68E8:6B00F65C
html-safe-noncee015aee09d0ba4ad0adc18e036f81ba5595d3ed05cff8c3b83c9f596b50d3459
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUYwOjE2QUI3OTpBQzY1Mjk6REM2OEU4OjZCMDBGNjVDIiwidmlzaXRvcl9pZCI6IjcwNDAwNzk1OTgwMTI5NjQ3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6b338705c4e825f3c8fb84b43351c4ebccedb69fb30f20d6451faf698d568297
hovercard-subject-tagissue:1045145041
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/46689/issue_layout
twitter:imagehttps://opengraph.githubassets.com/dd13a2ea407f1dc9a2a5bd00c715c1114d3c9371df2efa6a24c8c570fc796f5a/microsoft/TypeScript/issues/46689
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/dd13a2ea407f1dc9a2a5bd00c715c1114d3c9371df2efa6a24c8c570fc796f5a/microsoft/TypeScript/issues/46689
og:image:altSuggestion Now that TS 4.5 supports import assertions and JSON modules, it'd be great if it similarly supported CSS modules which are now shipping in Chrome and Edge. There are two aspects of JSON ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejustinfagnani
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/46689#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F46689
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F46689
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/46689
Reloadhttps://github.com/microsoft/TypeScript/issues/46689
Reloadhttps://github.com/microsoft/TypeScript/issues/46689
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/46689
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/46689
CSS module supporthttps://github.com/microsoft/TypeScript/issues/46689#top
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Nov 4, 2021https://github.com/microsoft/TypeScript/issues/46689#issue-1045145041
CSS moduleshttps://github.com/WICG/webcomponents/blob/gh-pages/proposals/css-modules-v1-explainer.md
Ambient Module Declarations for Import Attributes (formerly known as Import Assertions) #46135https://github.com/microsoft/TypeScript/issues/46135
TypeScript's Design Goalshttps://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
Nexthttps://github.com/microsoft/TypeScript/issues/46689?timeline_page=1
https://github.com/benjamind
Ben Delarre (benjamind)https://github.com/benjamind
on Nov 4, 2021https://github.com/microsoft/TypeScript/issues/46689#issuecomment-961408814
Andrew Branch (andrewbranch)https://github.com/andrewbranch
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Nov 4, 2021https://github.com/microsoft/TypeScript/issues/46689#event-5571152121
https://github.com/freshp86
freshp86https://github.com/freshp86
on May 2, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1115446493
https://github.com/JustFly1984
Alexey Lyakhov (JustFly1984)https://github.com/JustFly1984
on May 3, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1115546702
https://github.com/mhoad
Mark Hoad (mhoad)https://github.com/mhoad
on Jul 13, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1183313913
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
https://github.com/franktopel
Frank Topel (franktopel)https://github.com/franktopel
on Oct 25, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1290172992
https://github.com/andrewbranch
Andrew Branch (andrewbranch)https://github.com/andrewbranch
on Oct 25, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1290847850
https://github.com/thescientist13
Owen Buckley (thescientist13)https://github.com/thescientist13
on Oct 25, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1290964955
Firefoxhttps://bugzilla.mozilla.org/show_bug.cgi?id=1520690
Safari Technical Previewhttps://github.com/WebKit/standards-positions/issues/42#issuecomment-1282354886
Import Assertions yethttps://mozilla.github.io/standards-positions/#import-attributes
Safari still has CSS Module Scripts in open statushttps://bugs.webkit.org/show_bug.cgi?id=227967
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Oct 25, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1291114999
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-css-module-scripthttps://html.spec.whatwg.org/multipage/webappapis.html#creating-a-css-module-script
Owen Buckley (@thescientist13)https://github.com/thescientist13
standard position issuehttps://html.spec.whatwg.org/multipage/webappapis.html#creating-a-css-module-script
single concern about CSP integrationhttps://github.com/WebKit/standards-positions/issues/77
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Oct 25, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1291116190
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
#46135https://github.com/microsoft/TypeScript/issues/46135
https://github.com/JustFly1984
Alexey Lyakhov (JustFly1984)https://github.com/JustFly1984
on Nov 11, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1312168245
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Nov 11, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1312186928
Alexey Lyakhov (@JustFly1984)https://github.com/JustFly1984
https://github.com/franktopel
Frank Topel (franktopel)https://github.com/franktopel
on Dec 12, 2022https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1346098048
Justin Fagnani (@justinfagnani)https://github.com/justinfagnani
https://github.com/bivens-dev
mdh (bivens-dev)https://github.com/bivens-dev
on Mar 5, 2023https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1455148165
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-css-module-scripthttps://html.spec.whatwg.org/multipage/webappapis.html#creating-a-css-module-script
https://github.com/guybedford/es-module-shimshttps://github.com/guybedford/es-module-shims
https://github.com/andrewbranch
Andrew Branch (andrewbranch)https://github.com/andrewbranch
on Mar 7, 2023https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1458800444
https://github.com/freshp86
freshp86https://github.com/freshp86
on Jun 1, 2023https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1572592935
demoted to Stage 2https://github.com/tc39/proposal-import-assertions
https://github.com/tc39/proposal-import-attributes#historyhttps://github.com/tc39/proposal-import-attributes#history
slideshttps://docs.google.com/presentation/d/1Abdr54Iflz_4sah2_yX2qS3K09qDJGV84qIZ6pHAqIk
commithttps://github.com/tc39/proposal-import-attributes/commit/0ca6f0fee2ef642be61cdcf205aeccb9e622600a?diff=split
https://github.com/andrewbranch
Andrew Branch (andrewbranch)https://github.com/andrewbranch
on Jun 1, 2023https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1572625678
Changes due to stage 3 reviews to present in July 2023 tc39/proposal-import-attributes#142https://github.com/tc39/proposal-import-attributes/issues/142
Import Attributes (Stage 3) #53656https://github.com/microsoft/TypeScript/issues/53656
feat(53656): Add support for the updated import attributes proposal #54242https://github.com/microsoft/TypeScript/pull/54242
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Oct 8, 2023https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1752153145
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Oct 8, 2023https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1752154650
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
add import attributes, and JSON and CSS module scripts to interop 2024https://github.com/web-platform-tests/interop/issues/436
https://github.com/koba-ninkigumi
小林照幸 (koba-ninkigumi)https://github.com/koba-ninkigumi
on Nov 12, 2023https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1807001567
stackblitzhttps://stackblitz.com/edit/import-attributes-sample
stackblitzhttps://stackblitz.com/edit/import-css-sample
https://github.com/mark-dropbear
mark-dropbearhttps://github.com/mark-dropbear
on Mar 4, 2024https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1975926390
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
https://github.com/andrewbranch
Andrew Branch (andrewbranch)https://github.com/andrewbranch
on Mar 4, 2024https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1977028306
#56359https://github.com/microsoft/TypeScript/issues/56359
#46135https://github.com/microsoft/TypeScript/issues/46135
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Mar 7, 2024https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1984100764
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
#56359https://github.com/microsoft/TypeScript/issues/56359
#46135https://github.com/microsoft/TypeScript/issues/46135
https://github.com/andrewbranch
Andrew Branch (andrewbranch)https://github.com/andrewbranch
on Mar 7, 2024https://github.com/microsoft/TypeScript/issues/46689#issuecomment-1984106223
Aaron Gable (aarongable)https://github.com/aarongable
on Dec 11, 2024https://github.com/microsoft/TypeScript/issues/46689#event-15624590714
Remove @ts-ignore:next-line when using CSS import attribute.https://github.com/chromium/chromium/commit/cbba0aad224ab056d88be2b0e7c2d645bdb79b6e
@ts-ignorehttps://github.com/ts-ignore
cbba0aahttps://github.com/chromium/chromium/commit/cbba0aad224ab056d88be2b0e7c2d645bdb79b6e
https://github.com/runarberg
Rúnar Berg Baugsson Sigríðarson (runarberg)https://github.com/runarberg
on Mar 19, 2025https://github.com/microsoft/TypeScript/issues/46689#issuecomment-2738551364
https://github.com/runarberg/babel-plugin-transform-import-css-stylesheetshttps://github.com/runarberg/babel-plugin-transform-import-css-stylesheets
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Sep 5, 2025https://github.com/microsoft/TypeScript/issues/46689#issuecomment-3257073928
https://bugzilla.mozilla.org/show_bug.cgi?id=1720570https://bugzilla.mozilla.org/show_bug.cgi?id=1720570
https://bugzilla.mozilla.org/show_bug.cgi?id=1986681https://bugzilla.mozilla.org/show_bug.cgi?id=1986681
https://github.com/jogibear9988
Jochen Kühner (jogibear9988)https://github.com/jogibear9988
on Oct 8, 2025https://github.com/microsoft/TypeScript/issues/46689#issuecomment-3383035044
https://github.com/runarberg/babel-plugin-transform-import-css-stylesheetshttps://github.com/runarberg/babel-plugin-transform-import-css-stylesheets
https://github.com/jogibear9988/esbuild-test/blob/main/esbuild.jshttps://github.com/jogibear9988/esbuild-test/blob/main/esbuild.js
https://github.com/justinfagnani
Justin Fagnani (justinfagnani)https://github.com/justinfagnani
on Jan 13, 2026https://github.com/microsoft/TypeScript/issues/46689#issuecomment-3745276561
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/147#javascripthttps://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/147#javascript
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/46689
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/46689
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featurehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Awaiting%20More%20Feedback%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.