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

docs: CSS ?inline query parameter #8050

Merged
merged 3 commits into from
Jun 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: update
  • Loading branch information
patak-dev committed May 30, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit ee81c3abe1d1d87106a6dfedca73e24af73d55ce
9 changes: 4 additions & 5 deletions docs/guide/features.md
Original file line number Diff line number Diff line change
@@ -210,16 +210,15 @@ Vite improves `@import` resolving for Sass and Less so that Vite aliases are als

You can also use CSS modules combined with pre-processors by prepending `.module` to the file extension, for example `style.module.scss`.

### Disabling injection into the page
### Disabling CSS injection into the page

If you want to turn off the automatic injection of CSS contents, you can do via the `?inline` query parameter:
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 otherStyles from './bar.css?inline'; // will not be injected into the page
import styles from './foo.css' // will be injected into the page
import otherStyles from './bar.css?inline' // will not be injected into the page
```


## Static Assets

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