primevue-mirror/components/lib/tabmenu/style/TabMenuStyle.js

117 lines
3.5 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
.p-tabmenu {
overflow-x: auto;
}
.p-tabmenu-tablist {
display: flex;
margin: 0;
padding: 0;
list-style-type: none;
2024-05-04 17:06:51 +00:00
background: ${dt('tabmenu.tablist.background')};
2024-05-11 09:30:44 +00:00
border-style: solid;
border-color: ${dt('tabmenu.tablist.border.color')};
border-width: ${dt('tabmenu.tablist.border.width')};
position: relative;
}
.p-tabmenu-item-link {
cursor: pointer;
user-select: none;
display: flex;
align-items: center;
text-decoration: none;
position: relative;
overflow: hidden;
2024-05-11 09:30:44 +00:00
background: ${dt('tabmenu.item.background')};
border-style: solid;
2024-05-11 09:30:44 +00:00
border-width: ${dt('tabmenu.item.border.width')};
border-color: ${dt('tabmenu.item.border.color')};
color: ${dt('tabmenu.item.color')};
padding: ${dt('tabmenu.item.padding')};
font-weight: ${dt('tabmenu.item.font.weight')};
2024-05-26 21:38:39 +00:00
transition: background ${dt('tabmenu.transition.duration')}, border-color ${dt('tabmenu.transition.duration')}, color ${dt('tabmenu.transition.duration')}, outline-color ${dt('tabmenu.transition.duration')}, box-shadow ${dt(
'tabmenu.transition.duration'
)};
2024-05-11 09:30:44 +00:00
margin: ${dt('tabmenu.item.margin')};
outline-color: transparent;
2024-05-11 09:30:44 +00:00
gap: ${dt('tabmenu.item.gap')};
}
.p-tabmenu-item-link:focus-visible {
2024-05-11 16:45:10 +00:00
z-index: 1;
2024-05-11 09:30:44 +00:00
box-shadow: ${dt('tabmenu.item.focus.ring.shadow')};
outline: ${dt('tabmenu.item.focus.ring.width')} ${dt('tabmenu.item.focus.ring.style')} ${dt('tabmenu.item.focus.ring.color')};
outline-offset: ${dt('tabmenu.item.focus.ring.offset')};
}
.p-tabmenu-item-icon {
2024-05-11 09:30:44 +00:00
color: ${dt('tabmenu.item.icon.color')};
2024-05-26 21:38:39 +00:00
transition: background ${dt('tabmenu.transition.duration')}, border-color ${dt('tabmenu.transition.duration')}, color ${dt('tabmenu.transition.duration')}, outline-color ${dt('tabmenu.transition.duration')}, box-shadow ${dt(
'tabmenu.transition.duration'
)};
}
.p-tabmenu-item-label {
line-height: 1;
}
2024-05-11 09:30:44 +00:00
.p-tabmenu-item:not(.p-tabmenu-item-active):not(.p-disabled):hover .p-tabmenu-item-link {
2024-05-11 09:30:44 +00:00
background: ${dt('tabmenu.item.hover.background')};
border-color: ${dt('tabmenu.item.hover.border.color')};
color: ${dt('tabmenu.item.hover.color')};
}
.p-tabmenu-item:not(.p-tabmenu-item-active):not(.p-disabled):hover .p-tabmenu-item-icon {
color: ${dt('tabmenu.item.icon.hover.color')};
}
.p-tabmenu-item-active .p-tabmenu-item-link {
2024-05-11 09:30:44 +00:00
background: ${dt('tabmenu.item.active.background')};
border-color: ${dt('tabmenu.item.active.border.color')};
color: ${dt('tabmenu.item.active.color')};
}
.p-tabmenu-item-active .p-tabmenu-item-icon {
color: ${dt('tabmenu.item.icon.active.color')};
}
2024-05-11 09:30:44 +00:00
.p-tabmenu-active-bar {
z-index: 1;
display: block;
position: absolute;
2024-05-11 09:30:44 +00:00
bottom: ${dt('tabmenu.active.bar.bottom')};
height: ${dt('tabmenu.active.bar.height')};
background: ${dt('tabmenu.active.bar.background')};
transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);
}
.p-tabmenu::-webkit-scrollbar {
display: none;
}
`;
const classes = {
root: 'p-tabmenu p-component',
tablist: 'p-tabmenu-tablist',
item: ({ instance, index, item }) => [
2024-04-09 14:03:17 +00:00
'p-tabmenu-item',
{
2024-04-09 14:03:17 +00:00
'p-tabmenu-item-active': instance.d_activeIndex === index,
'p-disabled': instance.disabled(item)
}
],
itemLink: 'p-tabmenu-item-link',
itemIcon: 'p-tabmenu-item-icon',
itemLabel: 'p-tabmenu-item-label',
2024-05-11 09:30:44 +00:00
activeBar: 'p-tabmenu-active-bar'
};
export default BaseStyle.extend({
name: 'tabmenu',
theme,
classes
});