Skip to content

Commit d4be7a8

Browse files
authored
feat(Tab): reduce toolbar spacing (#5782)
* refactor: 调整间隙 * refactor: 调整拐角 * refactor: 调整左间隙 * refactor: 增加左侧偏移量 * refactor: 调整不同模式左侧偏移量 * chore: bump version 9.5.3 * refactor: 兼容阿拉伯兄弟 * refactor: 调整工具按钮防止被遮挡 * refactor: 左侧间隙支持响应式 * refactor: 更新工具按钮大小 * refactor: 更新 DevUI 样式
1 parent ae3029f commit d4be7a8

File tree

4 files changed

+43
-11
lines changed

4 files changed

+43
-11
lines changed

src/BootstrapBlazor.Server/wwwroot/css/devui.css

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,21 @@ pre code.hljs {
168168
--bb-tabs-item-close-button-height: 16px;
169169
}
170170

171-
.tabs-chrome > .tabs-header,
172-
.tabs-capsule > .tabs-header {
173-
--bb-tabs-item-body-padding: 2px 8px;
174-
--bb-tabs-header-height: 26px;
175-
}
176-
177171
.tabs-chrome {
178172
--bb-tabs-item-wrap-padding-x: 0.5rem;
179173
--bb-tabs-item-body-margin-bottom: 2px;
180174
}
175+
176+
.tabs-chrome > .tabs-header,
177+
.tabs-capsule > .tabs-header {
178+
--bb-tabs-item-body-padding: 2px 8px;
179+
--bb-tabs-chrome-item-height: 26px;
180+
}
181+
182+
.tabs-chrome > .tabs-header .nav-link-bar .nav-link-bar-button, .tabs-capsule > .tabs-header .nav-link-bar .nav-link-bar-button {
183+
padding: 0 .5rem;
184+
}
185+
186+
.tabs-chrome > .tabs-header .of .tabs-nav-scroll, .tabs-chrome > .tabs-header .extend .tabs-nav-scroll {
187+
margin-inline-start: -0.75rem;
188+
}

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.5.3-beta01</Version>
4+
<Version>9.5.3</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Tab/Tab.razor.scss

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
.tabs-nav-wrap {
9393
> .nav-link-bar {
9494
cursor: pointer;
95-
font-size: 1rem;
95+
font-size: var(--bb-font-size);
9696
color: var(--bs-body-color);
9797
width: var(--bb-tabs-bar-width);
9898
height: 100%;
@@ -582,6 +582,16 @@
582582
.tabs-chrome > .tabs-header {
583583
padding: var(--bb-tabs-header-padding);
584584

585+
.nav-link-bar-button:hover {
586+
z-index: 2;
587+
}
588+
589+
.of, .extend {
590+
.tabs-nav-scroll {
591+
margin-inline-start: -1rem;
592+
}
593+
}
594+
585595
.tabs-item-wrap {
586596
overflow: hidden;
587597
position: relative;
@@ -603,7 +613,7 @@
603613
}
604614

605615
&:not(:first-child) {
606-
margin-left: calc(0px - 2 * var(--bb-tabs-item-wrap-padding-x));
616+
margin-inline-start: calc(0px - 2 * var(--bb-tabs-item-wrap-padding-x));
607617
}
608618

609619
&:not(.active) {
@@ -633,6 +643,14 @@
633643
}
634644
}
635645

646+
&:hover:not(.active) {
647+
z-index: 5;
648+
649+
.tab-corner {
650+
display: none;
651+
}
652+
}
653+
636654
.tabs-item {
637655
border: none !important;
638656
border-top-left-radius: 10px;
@@ -682,8 +700,14 @@
682700
}
683701

684702
.tabs-capsule > .tabs-header {
703+
.of, .extend {
704+
.tabs-nav-scroll {
705+
margin-inline-start: -0.5rem;
706+
}
707+
}
708+
685709
.tabs-item-wrap {
686-
margin-left: calc(var(--bb-tabs-item-wrap-padding-x) / 2);
710+
margin-inline-start: calc(var(--bb-tabs-item-wrap-padding-x) / 2);
687711

688712
&.active {
689713
.tabs-item {

src/BootstrapBlazor/wwwroot/scss/theme/bootstrapblazor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ $bb-switch-inner-off-text-color: #606266;
603603
$bb-switch-label-margin-left: 10px;
604604

605605
// Tab
606-
$bb-tabs-item-padding: 0 1rem;
606+
$bb-tabs-item-padding: 0 .5rem;
607607
$bb-tabs-item-height: 40px;
608608
$bb-tabs-item-active-color: #409eff;
609609
$bb-tabs-item-hover-color: #409eff;

0 commit comments

Comments
 (0)