This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-tirx.git


The following commit(s) were added to refs/heads/main by this push:
     new c8f68749d [DOCS] Color sphinx-tabs with the theme in light and dark 
modes (#164)
c8f68749d is described below

commit c8f68749d1345066647b7260d6a7cbe006d80bfe
Author: Linzhang Li <[email protected]>
AuthorDate: Mon Nov 2 12:34:57 2026 -0500

    [DOCS] Color sphinx-tabs with the theme in light and dark modes (#164)
    
    In dark mode, the tabs of the documentation, such as the CPU and CUDA
    tabs of the Quick Start, keep a white panel and white selected tab, and
    text inside a panel is light gray on white. The tabs now take their
    colors from the theme, so they follow its light and dark modes.
---
 docs/_static/css/tabs_theme.css | 45 +++++++++++++++++++++++++++++++++++++++++
 docs/conf.py                    |  3 +++
 2 files changed, 48 insertions(+)

diff --git a/docs/_static/css/tabs_theme.css b/docs/_static/css/tabs_theme.css
new file mode 100644
index 000000000..ff45f75d8
--- /dev/null
+++ b/docs/_static/css/tabs_theme.css
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * sphinx-tabs colors its tabs for a white page and styles its dark mode under
+ * body[data-theme], which this theme does not set: it sets data-theme on 
<html>.
+ * The theme's color variables follow its light and dark modes, so the tabs do 
too.
+ */
+
+[role="tablist"] {
+  border-bottom-color: var(--pst-color-border);
+}
+
+.sphinx-tabs-tab {
+  color: var(--pst-color-link);
+  background-color: transparent;
+}
+
+.sphinx-tabs-tab[aria-selected="true"] {
+  border-color: var(--pst-color-border);
+  border-bottom-color: var(--pst-color-background);
+  background-color: var(--pst-color-background);
+}
+
+.sphinx-tabs-panel {
+  color: var(--pst-color-text-base);
+  border-color: var(--pst-color-border);
+  background-color: var(--pst-color-background);
+}
diff --git a/docs/conf.py b/docs/conf.py
index 1a930c4fd..dc21ae85c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -117,6 +117,9 @@ autosummary_generate = True
 templates_path = ["_templates"]
 exclude_patterns = ["_build", "_stubs"]
 html_theme = "sphinx_book_theme"
+html_static_path = ["_static"]
+# Colors the sphinx-tabs tabs with the theme, in its light and dark modes.
+html_css_files = ["css/tabs_theme.css"]
 
 autodoc_default_options = {
     "members": True,

Reply via email to