From 5fe681ccc5df92d4eb8590b6065344fbd9f5b0f1 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Thu, 23 Apr 2026 11:38:32 +0800 Subject: [PATCH] feat(code-tabs): add dividers for inactive tabs and improve active tab styling --- assets/scss/pages/single/_code.scss | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/assets/scss/pages/single/_code.scss b/assets/scss/pages/single/_code.scss index fe0f4616..abf31521 100644 --- a/assets/scss/pages/single/_code.scss +++ b/assets/scss/pages/single/_code.scss @@ -627,8 +627,27 @@ pre { color: fi-var(global-font-secondary-color); white-space: nowrap; user-select: none; + position: relative; @include border-radius; + &:not(:last-child)::after { + content: ''; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); + width: 1px; + height: 36%; + background-color: fi-var(global-border-color-weight); + } + + // hide dividers on both sides of the active tab + &.active::after, + &:has(+ .tab-item.active)::after { + // display: none; + background-color: fi-var(global-border-color); + } + @include media('xs') { padding-inline: 0.6rem; } @@ -648,7 +667,7 @@ pre { translate: 2px 2px; width: calc(anchor-size(width) - 0.25rem); height: calc(anchor-size(height) - 0.25rem); - box-shadow: inset 0 0 1rem 0.25rem color-mix(in srgb, fi-var(global-font-secondary-color) 30%, transparent); + box-shadow: inset 0 0 1rem 0.25rem light-dark(#fff, fi-rgba(fi-var(global-font-secondary-color), 0.4)); pointer-events: none; transition: 0.3s ease-in-out; @include border-radius;