2021-04-02 17:20:02 +00:00
|
|
|
@layer components {
|
|
|
|
.tabset {
|
2021-08-13 11:07:29 +00:00
|
|
|
@apply grid grid-cols-3;
|
2021-04-02 17:20:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.tabset > input[type="radio"] {
|
|
|
|
@apply absolute -left-full;
|
|
|
|
}
|
|
|
|
|
2021-05-03 17:39:58 +00:00
|
|
|
.tabset .tab-panel {
|
2021-04-02 17:20:02 +00:00
|
|
|
@apply hidden;
|
|
|
|
}
|
|
|
|
|
2021-08-13 11:07:29 +00:00
|
|
|
/* Logic for 3 tabs at most */
|
2021-04-02 17:20:02 +00:00
|
|
|
.tabset > input:first-child:checked ~ .tab-panels > .tab-panel:first-child,
|
2021-08-13 11:07:29 +00:00
|
|
|
.tabset > input:nth-child(3):checked ~ .tab-panels > .tab-panel:nth-child(2),
|
|
|
|
.tabset > input:nth-child(5):checked ~ .tab-panels > .tab-panel:nth-child(3) {
|
2021-04-02 17:20:02 +00:00
|
|
|
@apply block;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Styling */
|
|
|
|
.tabset > label {
|
|
|
|
@apply relative inline-block w-full px-4 py-3 text-center cursor-pointer opacity-70 hover:opacity-100;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tabset > input:checked + label::after {
|
2021-09-07 15:43:09 +00:00
|
|
|
@apply absolute inset-x-0 bottom-0 w-1/3 h-1 mx-auto bg-pine-500;
|
2021-04-02 17:20:02 +00:00
|
|
|
content: "";
|
|
|
|
}
|
|
|
|
|
|
|
|
.tabset > input:checked + label {
|
|
|
|
@apply font-semibold opacity-100 text-pine-700;
|
|
|
|
}
|
|
|
|
|
2021-05-03 17:39:58 +00:00
|
|
|
.tabset .tab-panels {
|
2021-08-13 11:07:29 +00:00
|
|
|
@apply col-span-3 p-6;
|
2021-04-02 17:20:02 +00:00
|
|
|
}
|
|
|
|
}
|