Skip to content

Commit 5d2c86f

Browse files
committed
Properly use the nav tabs border color
fixes #4868
1 parent c447f04 commit 5d2c86f

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

news/changelog-1.3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185

186186
- HTML output will not decorate links within source code (for example, from `code-link: true`) with external icons. (#3755)
187187
- Use `toc-expand` to control to what level the TOC will expand by default in HTML documents.
188+
- Improve tab border coloring across themes ([#4868](https://github.com/quarto-dev/quarto-cli/issues/4868)).
188189

189190
## Miscellaneous
190191

src/resources/formats/html/bootstrap/_bootstrap-functions.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
$gray-300: #dee2e6 !default;
8080
$blue: #0d6efd !default;
8181

82+
$simplex-border-mix: mix($white, $black, 93.5%) !default;
83+
8284
$theme-overrides: (
8385
cerulean: (
8486
navbar-fg: $white,
@@ -138,6 +140,8 @@
138140
navbar-bg: $white,
139141
navbar-fg: rgba($black, 0.6),
140142
navbar-hl: $black,
143+
nav-tabs-link-active-border-color: $simplex-border-mix $simplex-border-mix
144+
transparent,
141145
),
142146
sketchy: (
143147
navbar-fg: $white,

src/resources/formats/html/bootstrap/_bootstrap-rules.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,15 @@ $code-block-bg-color: quarto-color.adjust(
747747
}
748748
}
749749

750+
.nav-tabs .nav-item {
751+
margin-top: 1px;
752+
}
753+
750754
.tab-content {
751755
margin-top: 0px;
752-
border-left: $border-color 1px solid;
753-
border-right: $border-color 1px solid;
754-
border-bottom: $border-color 1px solid;
756+
border-left: $nav-tabs-border-color $nav-tabs-border-width solid;
757+
border-right: $nav-tabs-border-color $nav-tabs-border-width solid;
758+
border-bottom: $nav-tabs-border-color $nav-tabs-border-width solid;
755759
margin-left: 0;
756760
padding: 1em;
757761
margin-bottom: 1em;

src/resources/formats/html/bootstrap/_bootstrap-variables.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,21 @@ $input-border-color: theme-override-value(
180180
if(variable-exists(input-border-color), $input-border-color, null)
181181
);
182182

183+
// Same as above (default is respected if there is not override
184+
// so the `!default` keyword is omitted). Some themes don't provide
185+
// active tab border colors and they customize the main border
186+
// color which results in the tabs looking slightly weird since the
187+
// colors may not match (for example, simplex).
188+
$nav-tabs-link-active-border-color: theme-override-value(
189+
$theme-name,
190+
"nav-tabs-link-active-border-color",
191+
if(
192+
variable-exists(nav-tabs-link-active-border-color),
193+
$nav-tabs-link-active-border-color,
194+
null
195+
)
196+
);
197+
183198
/* GRID VARIABLES */
184199
// The left hand sidebar
185200
$grid-sidebar-width: 250px !default;

0 commit comments

Comments
 (0)