-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add styles based on the documentation tool (#473)
Use our heuristic to detect the documentation tool/theme and add specific `--readthedocs-*` CSS variables based on that for known tools/themes. Reference: readthedocs/readthedocs.org#11849 (comment) --------- Co-authored-by: Anthony <[email protected]>
- Loading branch information
Showing
6 changed files
with
161 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Specific styles based on documentation tools and themes | ||
* | ||
* Usage of `@layer` at-rule pushes this rules down a step in | ||
* precedence/priority. This allows a user `:root` rule to override these | ||
* values. | ||
**/ | ||
@layer defaults { | ||
:root[data-readthedocs-tool="mkdocs-material"] { | ||
--readthedocs-font-size: 0.58rem; | ||
--readthedocs-flyout-font-size: 0.58rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="antora"] { | ||
--readthedocs-font-size: 0.7rem; | ||
--readthedocs-flyout-font-size: 0.7rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="mdbook"] { | ||
--readthedocs-font-size: 1.3rem; | ||
--readthedocs-flyout-font-size: 1.3rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="sphinx"][data-readthedocs-tool-theme="furo"] { | ||
--readthedocs-font-size: 0.725rem; | ||
--readthedocs-flyout-font-size: 0.725rem; | ||
} | ||
|
||
:root[data-readthedocs-tool="sphinx"][data-readthedocs-tool-theme="immaterial"] { | ||
--readthedocs-font-size: 0.58rem; | ||
--readthedocs-flyout-font-size: 0.58rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters