Skip to content

Commit d5a7375

Browse files
committed
docs(popover-examples): simplify styling example
1 parent 0a42743 commit d5a7375

File tree

4 files changed

+6
-145
lines changed

4 files changed

+6
-145
lines changed

apps/website/src/routes/docs/headless/popover/examples/animation.css

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/website/src/routes/docs/headless/popover/examples/listbox-animation.tsx

Lines changed: 0 additions & 106 deletions
This file was deleted.

apps/website/src/routes/docs/headless/popover/examples/styling.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ import { Popover, PopoverTrigger } from '@qwik-ui/headless';
44
export default component$(() => {
55
return (
66
<>
7-
<PopoverTrigger
8-
popovertarget="styling-id"
9-
class="rounded-base border-2 border-slate-300 bg-slate-800 px-3 py-1 text-white"
10-
>
7+
<PopoverTrigger popovertarget="styling-id" class="popover-trigger">
118
Popover Trigger
129
</PopoverTrigger>
13-
{/* slate gets overrided */}
14-
<Popover
15-
class="rounded-base border-2 border-red-200 bg-slate-600 px-3 py-1 shadow-md [&[popover]]:bg-red-900"
16-
id="styling-id"
17-
>
10+
{/* popover bacground-color gets overrided */}
11+
<Popover class="popover [&[popover]]:bg-primary" id="styling-id">
1812
Popover
1913
</Popover>
2014
</>

apps/website/src/routes/docs/headless/popover/index.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Here are a couple of example components where the Popover API can be used. Inclu
136136
caveats that should be kept in mind when consuming the popover.
137137
</Note>
138138

139-
### Psuedo Selectors
139+
### Pseudo Selectors
140140

141141
#### :popover-open
142142

@@ -337,13 +337,11 @@ In the previous docs examples, we use the gutter property on the listbox. Gutter
337337

338338
<Showcase name="gutter" />
339339

340-
> In this case, that is the listbox or unordered list, and the input element. If Flip is enabled, it will provide a gutter space for both the top and bottom.
341-
342340
## Styling
343341

344342
Styles can be added normally like any other component in Qwik UI, such as adding a class. The Popover API however, exposes the `[popover]` and `:popover-open` attribute and pseudo-class selectors which can be used to style both the open and closed states.
345343

346-
From an earlier section, we learned that the `:popover-open` psuedo-class cannot be polyfilled, and so a class is added instead.
344+
From an earlier section, we learned that the `:popover-open` pseudo-class cannot be polyfilled, and so a class is added instead.
347345

348346
```tsx
349347
[popover] {
@@ -408,7 +406,7 @@ If you need to override any of the listbox properties, use the following CSS var
408406
409407
## Animations
410408

411-
<Showcase name="listbox-animation" />
409+
<Showcase name="hero" />
412410

413411
To use an animation, add the following CSS classes to the component.
414412

0 commit comments

Comments
 (0)