Skip to content

Commit

Permalink
docs : Fix useStylesScoped$ (QwikDev#4050)
Browse files Browse the repository at this point in the history
Fix wrong hook name, `useStyleScoped$` should be change to `useStylesScoped$`
  • Loading branch information
tanftw authored May 4, 2023
1 parent f685531 commit 1ff8c20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/docs/src/routes/docs/(qwik)/components/styles/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ export const Cmp = component$(() => {

## Scoped CSS

To use scoped CSS, you can use the `useStyleScoped$()` hook exported from `@builder.io/qwik`.
To use scoped CSS, you can use the `useStylesScoped$()` hook exported from `@builder.io/qwik`.

```tsx {4-8} title="src/components/MyComponent/MyComponent.tsx"
import { component$, useStyleScoped$ } from '@builder.io/qwik';
import { component$, useStylesScoped$ } from '@builder.io/qwik';

export default component$(() => {
useStyleScoped$(`
useStylesScoped$(`
.container {
background-color: red;
}
Expand All @@ -165,12 +165,12 @@ You can also import an external CSS file. For that you need to add the `?inline`
```

```tsx {3,6} title="src/components/MyComponent/MyComponent.tsx"
import { component$, useStyleScoped$ } from '@builder.io/qwik';
import { component$, useStylesScoped$ } from '@builder.io/qwik';

import styles from './MyComponent.css?inline';

export default component$(() => {
useStyleScoped$(styles);
useStylesScoped$(styles);
return <div class="container">Hello world</div>;
});
```
Expand Down

0 comments on commit 1ff8c20

Please sign in to comment.