Skip to content

Commit

Permalink
docs(css): default and named imports from css files deprecated (#12454)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day committed Mar 17, 2023
1 parent 1543236 commit 1a8af8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/guide/features.md
Expand Up @@ -248,10 +248,14 @@ You can also use CSS modules combined with pre-processors by prepending `.module
The automatic injection of CSS contents can be turned off via the `?inline` query parameter. In this case, the processed CSS string is returned as the module's default export as usual, but the styles aren't injected to the page.

```js
import styles from './foo.css' // will be injected into the page
import './foo.css' // will be injected into the page
import otherStyles from './bar.css?inline' // will not be injected
```

::: tip NOTE
Default and named imports from CSS files (e.g `import style from './foo.css'`) are deprecated since Vite 4. Use the `?inline` query instead.
:::

## Static Assets

Importing a static asset will return the resolved public URL when it is served:
Expand Down

0 comments on commit 1a8af8d

Please sign in to comment.