Skip to content

Commit 2648d0b

Browse files
authored
Merge pull request #787 from zihanKuang/improve-tab
Refactor: Overhaul and Modernize Tabs Component Styling
2 parents fa3780f + 4a8f58c commit 2648d0b

File tree

1 file changed

+39
-63
lines changed

1 file changed

+39
-63
lines changed

assets/scss/_styles_project.scss

Lines changed: 39 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -708,78 +708,54 @@ a:not([href]):not([class]):hover {
708708
color: $body-color;
709709
}
710710

711-
.tab-body {
712-
overflow-x: scroll;
713-
background: transparent;
714-
flex-direction: column;
715-
gap: 1rem;
716-
}
717-
718-
.tab-content>.active {
711+
.nav-tabs {
712+
border: none;
719713
display: flex;
714+
flex-wrap: nowrap;
715+
overflow-x: auto;
716+
-ms-overflow-style: none; /* IE and Edge */
717+
scrollbar-width: none; /* Firefox */
720718
}
721719

722-
.nav-tabs .nav-link.active {
723-
color: #00d3a9;
720+
.nav-tabs::-webkit-scrollbar {
721+
display: none; /* Chrome, Safari and Opera */
724722
}
725723

726-
.csvtable {
727-
width: 100%;
724+
.nav-tabs .nav-item {
725+
margin-bottom: 0;
726+
margin-right: 0;
728727
}
729-
// Only target the tabbed panels using ID naming convention
730728

731-
[id^="tabs-"] {
732-
border: 1px solid rgba($light, 0.1);
733-
border-radius: 0.5rem;
734-
padding: .5rem;
735-
margin-bottom: 1rem;
736-
background-color: rgba($light, 0.02);
737-
box-shadow: 0 0 8px rgba($dark, 0.2);
738-
739-
.nav-link {
740-
color: $light;
741-
background-color: rgba($light, 0.3); // 🆕 consistent visible bg for inactive tabs
742-
border: 2px solid rgba($light, 0.15);
743-
border-radius: 0.5rem 0.5rem 0 0;
744-
margin: 2px;
745-
padding: 0.5rem 1rem;
746-
font-weight: 500;
747-
line-height: 1.5rem;
748-
display: inline-block;
749-
transition: background-color 0.2s ease, color 0.2s ease;
750-
white-space: nowrap;
751-
box-shadow: 0 0 4px rgba($dark, 0.05); // 🆕 soft shadow for depth
752-
753-
&:hover {
754-
background-color: rgba($light, 0.5);
755-
color: $white;
756-
}
729+
.nav-tabs .nav-link {
730+
position: relative;
731+
border: 1px solid transparent;
732+
border-bottom: 1px solid $lightslategray;
733+
border-radius: 5px 5px 0 0;
734+
color: $primary;
735+
padding: 0.6rem 1.2rem;
736+
white-space: nowrap;
737+
}
757738

758-
&.active {
759-
background-color: $primary;
760-
color: #fff;
761-
border-color: $primary $primary transparent;
762-
font-weight: 600;
763-
position: relative;
764-
z-index: 2;
765-
box-shadow: none; // remove shadow from active to flatten it into content
766-
}
767-
}
739+
.nav-tabs .nav-link:not(.active):hover {
740+
background-color: lighten($dark, 10%);
741+
color: lighten($primary, 15%);
742+
border-bottom-color: lighten($lightslategray, 20%);
743+
}
768744

769-
.nav-link.disabled {
770-
background: transparent;
771-
border: none;
772-
color: rgba($light, 0.5);
773-
font-weight: 400;
774-
cursor: default;
775-
box-shadow: none;
776-
pointer-events: none;
777-
padding-left: 0;
778-
padding-right: 0;
779-
margin-right: 0.5rem;
780-
margin-left: 0.25rem;
781-
letter-spacing: 0.03em;
782-
}
745+
.nav-tabs .nav-link.active {
746+
background-color: $body-bg;
747+
font-weight: 500;
748+
border-color: $lightslategray $lightslategray;
749+
border-bottom: 1px solid $body-bg;
750+
z-index: 1;
751+
}
752+
753+
.tab-content .tab-pane {
754+
border: 1px solid $lightslategray;
755+
margin-top: -1px;
756+
padding: 1.5rem;
757+
border-radius: 0 0 5px 5px;
758+
background-color: $body-bg;
783759
}
784760

785761
html {

0 commit comments

Comments
 (0)