diff --git a/doc/changelog.d/652.fixed.md b/doc/changelog.d/652.fixed.md new file mode 100644 index 000000000..3f013e2c6 --- /dev/null +++ b/doc/changelog.d/652.fixed.md @@ -0,0 +1 @@ +update the style for highlight name function \ No newline at end of file diff --git a/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme-variable.scss b/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme-variable.scss index 33066a3e1..5dd0ad638 100644 --- a/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme-variable.scss +++ b/src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme-variable.scss @@ -1,6 +1,8 @@ /* Contains variables for colors and fonts used in the theme */ @import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap"); +@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap'); + @font-face { font-family: "Source Sans Pro Light"; src: url(../fonts/SourceSansPro-Light.ttf); @@ -33,6 +35,7 @@ var(--pst-font-family-monospace-system); --ast-body-family: "Open Sans", sans-serif; --ast-header-family: "Source Sans Pro", sans-serif; + --ast-code-family: "Source Code Pro", monospace; /** * Ansys compatible colors diff --git a/src/ansys_sphinx_theme/assets/styles/ast-search.scss b/src/ansys_sphinx_theme/assets/styles/ast-search.scss index 0f744cf19..6766c41e3 100644 --- a/src/ansys_sphinx_theme/assets/styles/ast-search.scss +++ b/src/ansys_sphinx_theme/assets/styles/ast-search.scss @@ -50,6 +50,7 @@ /* Highlighted Text */ html[data-theme="light"] .highlight { color: var(--ast-highlight-color); + font-family: var(--ast-code-family); } /* Search Input Styles */ diff --git a/src/ansys_sphinx_theme/assets/styles/pydata-sphinx-theme-custom.scss b/src/ansys_sphinx_theme/assets/styles/pydata-sphinx-theme-custom.scss index bb840db80..d172bb76d 100644 --- a/src/ansys_sphinx_theme/assets/styles/pydata-sphinx-theme-custom.scss +++ b/src/ansys_sphinx_theme/assets/styles/pydata-sphinx-theme-custom.scss @@ -779,3 +779,17 @@ button.btn.version-switcher__button:hover { span.math { display: math; } + +/** + * code block name function + */ + +div.highlight .nf{ + font-family: var(--ast-code-family); + -webkit-font-smoothing: auto; +} + + +code, kbd, pre, samp { + font-family: var(--ast-code-family); +} \ No newline at end of file diff --git a/src/ansys_sphinx_theme/assets/styles/sphinx-gallery.scss b/src/ansys_sphinx_theme/assets/styles/sphinx-gallery.scss index 9a25f87c1..143449c00 100644 --- a/src/ansys_sphinx_theme/assets/styles/sphinx-gallery.scss +++ b/src/ansys_sphinx_theme/assets/styles/sphinx-gallery.scss @@ -5,6 +5,7 @@ .highlight { pre { font-size: 0.9em; + font-family: var(--ast-code-family); } }