Skip to content

Commit ec34573

Browse files
Update web components (#491)
1 parent 6434ee8 commit ec34573

File tree

1 file changed

+111
-128
lines changed

1 file changed

+111
-128
lines changed

doc/content/user_guide/web-components.md

Lines changed: 111 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -50,79 +50,50 @@ success outline
5050
Here are some of the available button-style links, also using semantic
5151
colors:
5252

53-
::: grid
54-
auto
55-
56-
::: grid-item
57-
::: {.button-ref ref-type="ref" color="info" shadow=""}
58-
badges-buttons
59-
60-
Info
61-
:::
62-
:::
63-
64-
::: grid-item
65-
::: {.button-ref ref-type="ref" color="success" shadow=""}
66-
badges-buttons
67-
68-
Success
69-
:::
70-
:::
71-
72-
::: grid-item
73-
::: {.button-ref ref-type="ref" color="warning" shadow=""}
74-
badges-buttons
75-
76-
Warning
77-
:::
78-
:::
79-
80-
::: grid-item
81-
::: {.button-ref ref-type="ref" color="danger" shadow=""}
82-
badges-buttons
83-
84-
Danger
85-
:::
86-
:::
87-
88-
::: grid-item
89-
::: {.button-ref ref-type="ref" color="muted" shadow=""}
90-
badges-buttons
91-
92-
Muted
93-
:::
94-
:::
95-
96-
::: grid-item
97-
::: {.button-ref ref-type="ref" color="light" shadow=""}
98-
badges-buttons
99-
100-
Light
101-
:::
102-
:::
103-
104-
::: grid-item
105-
::: {.button-ref ref-type="ref" color="dark" shadow=""}
106-
badges-buttons
107-
108-
Dark
109-
:::
110-
:::
111-
:::
112-
113-
::: note
114-
::: title
115-
Note
116-
:::
117-
53+
{{< button info >}}
54+
label: Info
55+
link: http://example.com/
56+
{{< /button >}}
57+
58+
{{< button success >}}
59+
label: Success
60+
link: http://example.com/
61+
{{< /button >}}
62+
63+
{{< button warning >}}
64+
label: Warning
65+
link: http://example.com/
66+
{{< /button >}}
67+
68+
{{< button danger >}}
69+
label: Danger
70+
link: http://example.com/
71+
{{< /button >}}
72+
73+
{{< button muted >}}
74+
label: Muted
75+
link: http://example.com/
76+
{{< /button >}}
77+
78+
{{< button light >}}
79+
label: Light
80+
link: http://example.com/
81+
{{< /button >}}
82+
83+
{{< button dark >}}
84+
label: Dark
85+
link: http://example.com/
86+
{{< /button >}}
87+
88+
{{< admonition note >}}
11889
[Sphinx Design
11990
buttons](https://sphinx-design.readthedocs.io/en/latest/badges_buttons.html)
12091
are actually links, meaning they are rendered in HTML with `<a>` tags
12192
instead of `<button>`. Use them if you need a link to look like a
12293
button, however, be aware that they do not follow accessibility best
12394
practices for native button components such as using the correct [ARIA
12495
attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role).
125-
:::
96+
{{< /admonition >}}
12697

12798
If in your site\'s [custom CSS file](custom-css) you override the [CSS
12899
custom properties](css-variables) `--pst-color-*` (where `*` is one of
@@ -131,57 +102,68 @@ buttons will automatically use the custom color.
131102

132103
## Cards
133104

134-
::: grid
135-
::: grid-item-card
136-
Only heading
137-
:::
105+
{{< grid >}}
138106

139-
::: grid-item-card
107+
{{< card >}}
108+
title = 'Only title'
109+
{{< /card >}}
110+
111+
{{< card >}}
112+
body = '''
140113
Only body.
141114

142115
But with multiple text paragraphs.
143-
:::
144-
145-
::: grid-item-card
146-
Heading and body
116+
'''
117+
{{< /card >}}
147118

119+
{{< card >}}
120+
title = 'Heading and body'
121+
body = '''
148122
Content of the third card.
149123

150-
`Sample badge`{.interpreted-text role="bdg-primary"}
151-
:::
152-
:::
124+
{{< badge primary >}}Sample badge{{< /badge >}}
125+
'''
126+
{{< /card >}}
153127

154-
::: grid
155-
::: grid-item-card
156-
A card with a dropdown menu
128+
{{< /grid >}}
157129

158-
::: dropdown
159-
`eye me-1`{.interpreted-text role="fa"} Click to expand dropdown
130+
{{< grid >}}
160131

161-
Hidden content
162-
:::
163-
:::
132+
{{< card >}}
133+
title = 'A card with a dropdown menu'
134+
body = '''
135+
{{< dropdown >}}
136+
title = 'Click to expand dropdown'
137+
icon = 'fa-solid fa-eye'
138+
body = 'Hidden content'
139+
{{< /dropdown >}}
140+
'''
141+
{{< /card >}}
164142

165-
::: {.grid-item-card link="https://example.com"}
166-
A clickable card
167-
:::
168-
:::
169-
170-
::: grid
171-
::: grid-item-card
143+
{{< card >}}
144+
title = 'A clickable card'
145+
link = 'https://example.com'
146+
{{< /card >}}
172147

173-
### panel 1 header
148+
{{< /grid >}}
174149

175-
panel 1 content more content ++++++++++++++ panel 1 footer
176-
:::
150+
{{< grid >}}
177151

178-
::: grid-item-card
152+
{{< card >}}
153+
header = 'Header'
154+
title = 'Card Title'
155+
body = 'Card content'
156+
footer = 'Footer'
157+
{{< /card >}}
179158

180-
### panel 2 header
159+
{{< card >}}
160+
header = 'Header'
161+
title = 'Card Title'
162+
body = 'Card content'
163+
footer = 'Footer'
164+
{{< /card >}}
181165

182-
panel 2 content ++++++++++++++ panel 2 footer
183-
:::
184-
:::
166+
{{< /grid >}}
185167

186168
## Tabs
187169

@@ -285,33 +267,34 @@ An admonition for reference.
285267
And some admonition content.
286268
:::
287269

288-
::: dropdown
289-
And with no title and some content!
290-
:::
291-
292-
::: dropdown
293-
With a title
294-
295-
And some content!
296-
:::
297-
298-
::: {.dropdown icon="unlock"}
299-
With a title and icon
300-
301-
And some content and an icon!
302-
:::
303-
304-
::: {.dropdown color="primary" icon="unlock"}
305-
A primary color dropdown
306-
307-
And some content!
308-
:::
309-
310-
::: {.dropdown color="secondary" icon="unlock"}
311-
A secondary color dropdown
312-
313-
And some content!
314-
:::
270+
{{< dropdown >}}
271+
body = 'And with no title and some content!'
272+
{{< /dropdown >}}
273+
274+
{{< dropdown >}}
275+
title = 'With a title'
276+
body = 'And some content!'
277+
{{< /dropdown >}}
278+
279+
{{< dropdown >}}
280+
title = 'With a title and icon'
281+
icon = 'fa-solid fa-lock-open'
282+
body = 'And some content and an icon!'
283+
{{< /dropdown >}}
284+
285+
{{< dropdown >}}
286+
title = 'A primary color dropdown'
287+
icon = 'fa-solid fa-lock-open'
288+
color = 'primary'
289+
body = 'And some content and an icon!'
290+
{{< /dropdown >}}
291+
292+
{{< dropdown >}}
293+
title = 'A secondary color dropdown'
294+
icon = 'fa-solid fa-eye'
295+
color = 'secondary'
296+
body = 'And some content and an icon!'
297+
{{< /dropdown >}}
315298

316299
## Copybuttons
317300

0 commit comments

Comments
 (0)