Skip to content

Commit 02d7b0c

Browse files
committed
CSS Classes: Add .text-{small,smaller,medium,larger,large} classes
1 parent 9e1095d commit 02d7b0c

File tree

3 files changed

+82
-7
lines changed

3 files changed

+82
-7
lines changed

docs/css_classes.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
(css-classes)=
2+
3+
# CSS Classes
4+
5+
Additionally to [sphinx{design}](inv:sd#index)'s [](inv:sd#css_classes),
6+
this package provides a few more CSS classes, mostly serving as convenience
7+
shortcuts.
8+
See [`compiled/style.css`] for inspecting the whole CSS rule file.
9+
10+
11+
## Font sizes
12+
13+
The `.text-{small,smaller,medium,larger,large}` CSS classes exclusively adjust the
14+
`font-size` CSS attribute. They can be used anywhere.
15+
16+
:::{card}
17+
```{div} text-small
18+
Small text.
19+
```
20+
```{div} text-smaller
21+
Smaller text.
22+
```
23+
```{div} text-medium
24+
Medium text.
25+
```
26+
```{div} text-large
27+
Large text.
28+
```
29+
```{div} text-larger
30+
Larger text.
31+
```
32+
:::
33+
34+
35+
[`compiled/style.css`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/compiled/style.css

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ infocard
8080
tag
8181
```
8282

83+
```{toctree}
84+
:caption: Styling
85+
:hidden:
86+
87+
css_classes
88+
```
89+
8390
```{toctree}
8491
:caption: Development
8592
:hidden:

sphinx_design_elements/compiled/style.css

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
1-
/* Grid table */
1+
/**
2+
* Appearance shortcuts.
3+
*/
24

3-
/* Beautiful light-weight table outline flavor. */
5+
6+
/* General */
7+
8+
/* Very small text size */
9+
.text-small {
10+
font-size: small;
11+
}
12+
13+
/* Smaller text size */
14+
.text-smaller {
15+
font-size: smaller;
16+
}
17+
18+
/* Medium text size */
19+
.text-medium {
20+
font-size: medium;
21+
}
22+
23+
/* Large text size */
24+
.text-large {
25+
font-size: large;
26+
}
27+
28+
/* Very large text size */
29+
.text-larger {
30+
font-size: larger;
31+
}
32+
33+
34+
/* Grid table: Light-weight table-row outline styling. */
435
.top-border {
536
border-top-width: thin;
637
border-top-style: solid;
@@ -12,18 +43,20 @@
1243
border-top-color: lightgray;
1344
}
1445

15-
/* Remove margins of child elements inside table items. */
46+
47+
/**
48+
* Appearance bugfixes.
49+
*/
50+
51+
/* Grid table: Fix margins of child elements inside table items. */
1652
.sd-col > .highlight-markdown {
1753
margin: unset;
1854
}
1955
.sd-col > .highlight-restructuredtext {
2056
margin: unset;
2157
}
2258

23-
24-
/* Info card */
25-
26-
/* Fix grid item formatting. */
59+
/* Info card: Fix grid item formatting. */
2760
.sd-col > div.line-block {
2861
margin-top: unset;
2962
margin-bottom: unset;

0 commit comments

Comments
 (0)