Skip to content

Commit

Permalink
Add styling to autodoc content
Browse files Browse the repository at this point in the history
Add colors, formatting and font to autodoc generated content, that
mostly is suffixed by ".sig-".

Signed-off-by: Jorge Marques <[email protected]>
  • Loading branch information
gastmaier committed Mar 12, 2024
1 parent a685ea1 commit 908bb23
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adi_doctools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .role import setup as role_setup
from .lut import get_lut

__version__ = "0.3.20"
__version__ = "0.3.21"

logger = logging.getLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions adi_doctools/theme/cosmic/style/bundle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
@import "search";
@import "footer";
@import "related";
@import "code";
38 changes: 38 additions & 0 deletions adi_doctools/theme/cosmic/style/code.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.sig-object {
font-family: monospace;
font-size: 1rem;
}

.sig-prename, .sig-name {
color: var(--accent-color-code);
}

.sig-name, em.property {
font-weight: 600;
}

em.sig-param, em.property {
font-style: normal;
}

.headerlink {
color: var(--accent-color);
opacity: 0;
transition: ease opacity .25s;
padding-left: .25em;
}

.sig-object {
transition: ease background-color .25s;
background-color: rgba(125, 125, 125, 0);
padding: .25em .5rem;
border-radius: 1rem;
}

.sig-object:hover {
background-color: rgba(125, 125, 125, 0.1);
}

.sig-object:hover .headerlink {
opacity: 1;
}
4 changes: 2 additions & 2 deletions adi_doctools/theme/cosmic/style/element.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ a {
color: inherit;
}

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

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

Expand Down
3 changes: 3 additions & 0 deletions adi_doctools/theme/cosmic/style/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ body {
--text-color2: #{$text-color-light2};
--text-color3: #{$text-color-light3};
--accent-color: #{$accent-color-light};
--accent-color-code: #{$accent-color-code-light};
}

body.dark {
Expand All @@ -48,6 +49,7 @@ body.dark {
--text-color2: #{$text-color-dark2};
--text-color3: #{$text-color-dark3};
--accent-color: #{$accent-color-dark};
--accent-color-code: #{$accent-color-code-dark};
}

@media (prefers-color-scheme: dark) {
Expand All @@ -64,6 +66,7 @@ body.dark {
--text-color2: #{$text-color-dark2};
--text-color3: #{$text-color-dark3};
--accent-color: #{$accent-color-dark};
--accent-color-code: #{$accent-color-code-dark};
}
}

Expand Down
2 changes: 2 additions & 0 deletions adi_doctools/theme/cosmic/style/variable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ $border-th: 1px solid rgba(125, 125, 125, 0.5);
$border-td: 1px solid rgba(125, 125, 125, 0.25);
$accent-color-light: #0067b9;
$accent-color-dark: #0076d6;
$accent-color-code-light: #cc6d34;
$accent-color-code-dark: #ff8d34;
$border-radius: .25em;

$width-wide: 105em;
Expand Down

0 comments on commit 908bb23

Please sign in to comment.