Skip to content

Commit 908bb23

Browse files
committed
Add styling to autodoc content
Add colors, formatting and font to autodoc generated content, that mostly is suffixed by ".sig-". Signed-off-by: Jorge Marques <jorge.marques@analog.com>
1 parent a685ea1 commit 908bb23

File tree

6 files changed

+47
-3
lines changed

6 files changed

+47
-3
lines changed

adi_doctools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .role import setup as role_setup
1010
from .lut import get_lut
1111

12-
__version__ = "0.3.20"
12+
__version__ = "0.3.21"
1313

1414
logger = logging.getLogger(__name__)
1515

adi_doctools/theme/cosmic/style/bundle.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
@import "search";
99
@import "footer";
1010
@import "related";
11+
@import "code";
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.sig-object {
2+
font-family: monospace;
3+
font-size: 1rem;
4+
}
5+
6+
.sig-prename, .sig-name {
7+
color: var(--accent-color-code);
8+
}
9+
10+
.sig-name, em.property {
11+
font-weight: 600;
12+
}
13+
14+
em.sig-param, em.property {
15+
font-style: normal;
16+
}
17+
18+
.headerlink {
19+
color: var(--accent-color);
20+
opacity: 0;
21+
transition: ease opacity .25s;
22+
padding-left: .25em;
23+
}
24+
25+
.sig-object {
26+
transition: ease background-color .25s;
27+
background-color: rgba(125, 125, 125, 0);
28+
padding: .25em .5rem;
29+
border-radius: 1rem;
30+
}
31+
32+
.sig-object:hover {
33+
background-color: rgba(125, 125, 125, 0.1);
34+
}
35+
36+
.sig-object:hover .headerlink {
37+
opacity: 1;
38+
}

adi_doctools/theme/cosmic/style/element.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ a {
1515
color: inherit;
1616
}
1717

18-
.body p a {
18+
.body p a, .body a.reference.internal {
1919
color: var(--accent-color);
2020
border-bottom: 1px solid rgba(125, 125, 125, .25);
2121
}
2222

23-
.body p a:hover {
23+
.body p a:hover, .body a.reference.internal:hover {
2424
border-color: var(--text-color2);
2525
}
2626

adi_doctools/theme/cosmic/style/style.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ body {
3333
--text-color2: #{$text-color-light2};
3434
--text-color3: #{$text-color-light3};
3535
--accent-color: #{$accent-color-light};
36+
--accent-color-code: #{$accent-color-code-light};
3637
}
3738

3839
body.dark {
@@ -48,6 +49,7 @@ body.dark {
4849
--text-color2: #{$text-color-dark2};
4950
--text-color3: #{$text-color-dark3};
5051
--accent-color: #{$accent-color-dark};
52+
--accent-color-code: #{$accent-color-code-dark};
5153
}
5254

5355
@media (prefers-color-scheme: dark) {
@@ -64,6 +66,7 @@ body.dark {
6466
--text-color2: #{$text-color-dark2};
6567
--text-color3: #{$text-color-dark3};
6668
--accent-color: #{$accent-color-dark};
69+
--accent-color-code: #{$accent-color-code-dark};
6770
}
6871
}
6972

adi_doctools/theme/cosmic/style/variable.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ $border-th: 1px solid rgba(125, 125, 125, 0.5);
1616
$border-td: 1px solid rgba(125, 125, 125, 0.25);
1717
$accent-color-light: #0067b9;
1818
$accent-color-dark: #0076d6;
19+
$accent-color-code-light: #cc6d34;
20+
$accent-color-code-dark: #ff8d34;
1921
$border-radius: .25em;
2022

2123
$width-wide: 105em;

0 commit comments

Comments
 (0)