improve: tab component with gradient border like design

This commit is contained in:
Mahyar Khanbolooki
2025-08-12 00:17:28 +03:30
parent 38b13c6847
commit 84ecddc015
2 changed files with 40 additions and 3 deletions
+39 -2
View File
@@ -27,6 +27,7 @@ input[type="number"]::-webkit-inner-spin-button {
/* Firefox */
input[type="number"] {
-moz-appearance: textfield;
appearance: textfield;
}
input[type="password"]:not(:placeholder-shown) {
@@ -62,8 +63,10 @@ input[type="password"]:not(:placeholder-shown) {
/* Hide scrollbar for IE, Edge and Firefox */
.noscrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none;
/* IE and Edge */
scrollbar-width: none;
/* Firefox */
}
/* width */
@@ -109,6 +112,39 @@ input:autofill {
box-shadow: 0px 2px 16px 0px #00000014;
}
.gradient-border {
position: relative;
z-index: 0;
box-sizing: border-box;
}
.gradient-border::before {
content: "";
position: absolute;
inset: 0;
padding: 2px;
/* border thickness */
border-radius: inherit;
/* inherit border-radius from parent */
background: linear-gradient(to bottom right,
#FFFFFF 6.25%,
rgba(255, 253, 253, 0) 52.01%,
#FFFFFF 96.87%);
mask:
linear-gradient(#fff 0 0) content-box,
linear-gradient(#fff 0 0);
-webkit-mask:
linear-gradient(#fff 0 0) content-box,
linear-gradient(#fff 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
pointer-events: none;
/* so it doesn't block interactions */
z-index: -1;
box-sizing: border-box;
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
@@ -216,6 +252,7 @@ input:autofill {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
+1 -1
View File
@@ -36,7 +36,7 @@ export type TabContainerClassName = {
export const TabContainerClassNames: TabContainerClassName = {
wrapper: 'h-full',
scrollView: 'h-[72px] !pt-3 !pb-2 w-full overflow-y-hidden bg-[#FFFFFF70] justify-center border border-2 border-solid border-white rounded-[32px] inline-flex items-center gap-10',
scrollView: 'h-[72px] gradient-border !pt-3 !pb-2 w-full overflow-y-hidden bg-[#FFFFFF70] justify-center rounded-[32px] inline-flex items-center gap-10',
header: '',
headerDeactive: '',
headerActive: '',