Skip to content

Commit 0905c5c

Browse files
Add PST cards (#463)
1 parent c63614f commit 0905c5c

4 files changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Imported from file "design-style.css" from the "sphinx-design"
2+
// extension used in PyData Sphinx Theme.
3+
4+
.sd-card {
5+
background-clip: border-box;
6+
background-color: transparent;
7+
border-radius: 0.25rem;
8+
box-sizing: border-box;
9+
color: inherit;
10+
display: flex;
11+
flex-direction: column;
12+
min-width: 0;
13+
position: relative;
14+
word-wrap: break-word;
15+
}
16+
17+
.sd-mb-3 {
18+
margin-bottom: 1rem !important;
19+
}
20+
21+
.sd-card-header,
22+
.sd-card-footer {
23+
padding: 0.5rem 1rem;
24+
margin-bottom: 0;
25+
}
26+
27+
.sd-card-body {
28+
flex: 1 1 auto;
29+
padding: 1rem 1rem;
30+
}
31+
32+
.sd-card-title {
33+
margin-bottom: 0.5rem;
34+
}
35+
36+
.sd-font-weight-bold {
37+
font-weight: 700 !important;
38+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
@import "./pst-deps/sphinx-design/badges";
2+
@import "./pst-deps/sphinx-design/card";
23
@import "./pst/pydata-sphinx-theme";
34
@import "./spht/code";

doc/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ disableKinds: ["taxonomy"]
88
markup:
99
highlight:
1010
noClasses: false
11+
goldmark:
12+
renderer:
13+
unsafe: true
1114

1215
params:
1316
author:

layouts/shortcodes/card.html

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{{/*
2+
3+
doc: Cards
4+
5+
{{< card title="Only heading" >}}{{< /card >}}
6+
7+
{{< card >}}
8+
Only body.
9+
10+
But with multiple text paragraphs.
11+
{{< /card >}}
12+
13+
{{< card title="Heading and body" >}}
14+
Content of the third card.
15+
16+
{{< badge primary >}}
17+
Sample badge
18+
{{< /badge >}}
19+
20+
{{< /card >}}
21+
22+
23+
{{< card title="Card Title" header="Header" footer="Footer">}}
24+
Card content
25+
{{< /card >}}
26+
27+
28+
*/}}
29+
30+
31+
32+
<div class="bd-content">
33+
<div class="sd-card sd-shadow-sm sd-mb-3">
34+
{{ with .Get "header" }}
35+
<div class="sd-card-header">
36+
{{ . | markdownify }}
37+
</div>
38+
{{ end }}
39+
<div class="sd-card-body">
40+
{{ with .Get "title" }}
41+
<div class="sd-card-title sd-font-weight-bold">
42+
{{ . }}
43+
</div>
44+
{{ end }}
45+
{{ with .Inner }}
46+
{{ . | markdownify }}
47+
{{ end }}
48+
</div>
49+
{{ with .Get "footer" }}
50+
<div class="sd-card-footer">
51+
{{ . | markdownify }}
52+
</div>
53+
{{ end }}
54+
</div>
55+
</div>

0 commit comments

Comments
 (0)