Skip to content

Commit

Permalink
docs: Update content-scripts.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 authored Jan 6, 2025
1 parent 1719d17 commit cb2bf43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/guide/essentials/content-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ outline: deep

# Content Scripts

> To create a content script, see [Entrypoint Types](/guide/essentials/entrypoints#content-scripts).
## Context

The first argument to a content script's `main` function is it's "context".

```ts
// entrypoints/content.ts
// entrypoints/example.content.ts
export default defineContentScript({
main(ctx) {},
});
Expand Down Expand Up @@ -62,7 +64,7 @@ In regular web extensions, CSS for content scripts is usually a separate CSS fil
In WXT, to add CSS to a content script, simply import the CSS file into your JS entrypoint, and WXT will automatically add the bundled CSS output to the `css` array.

```ts
// entrypoints/content/index.ts
// entrypoints/example.content/index.ts
import './style.css';

export default defineContentScript({
Expand Down

0 comments on commit cb2bf43

Please sign in to comment.