I was trying to play with CSS Module Scripts the other day, which are a way to import CSS as a constructable stylesheet using the ESModules syntax. They are Chrome-only so not really something we can generally use (unless you’re building an Electron app or something), but I really like the idea of being able to load a stylesheet for a web component in a separate file cleanly. Anyway, there is lots of information out there that shows and old syntax that doesn’t work anymore, and little information that the syntax has changed to use the with
keyword.
// NOPE, old
import sheet from './styles.css' assert { type: 'css' };
// YEP, they changed it
import sheet from './styles.css' with { type: 'css' };
Code language: JavaScript (javascript)
So they are called “import attributes” now also, best I can tell. I imagine it applies to the JSON version as well. Hope this saves someone some grief.