primevue-mirror/components/lib/menu/style/MenuStyle.js

114 lines
2.6 KiB
JavaScript
Raw Normal View History

import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => `
.p-menu {
2024-05-10 07:23:39 +00:00
padding: ${dt('menu.padding')};
background: ${dt('menu.background')};
color: ${dt('menu.color')};
border: 1px solid ${dt('menu.border.color')};
2024-05-10 07:23:39 +00:00
border-radius: ${dt('menu.border.radius')};
min-width: 12.5rem;
}
.p-menu-list {
margin: 0;
padding: 0;
2024-05-02 10:56:41 +00:00
outline: 0;
list-style: none;
2024-05-10 07:23:39 +00:00
display: flex;
flex-direction: column;
gap: ${dt('menu.gap')};
}
.p-menu-item-link {
cursor: pointer;
display: flex;
align-items: center;
text-decoration: none;
overflow: hidden;
position: relative;
color: inherit;
2024-05-10 07:23:39 +00:00
padding: ${dt('menu.item.padding')};
user-select: none;
2024-05-10 07:23:39 +00:00
gap: ${dt('menu.item.gap')};
}
.p-menu-item-content {
2024-05-10 07:23:39 +00:00
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')};
border-radius: ${dt('menu.item.border.radius')};
color: ${dt('menu.item.color')};
}
.p-menu-item-label {
line-height: 1;
}
.p-menu-item-icon {
color: ${dt('menu.item.icon.color')};
}
.p-menu-item.p-focus .p-menu-item-content {
2024-05-05 15:51:29 +00:00
color: ${dt('menu.item.focus.color')};
background: ${dt('menu.item.focus.background')};
}
.p-menu-item.p-focus .p-menu-item-icon {
2024-05-10 07:23:39 +00:00
color: ${dt('menu.item.icon.focus.color')};
}
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover {
2024-05-05 15:51:29 +00:00
color: ${dt('menu.item.focus.color')};
background: ${dt('menu.item.focus.background')};
}
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {
2024-05-10 07:23:39 +00:00
color: ${dt('menu.item.icon.focus.color')};
}
.p-menu-overlay {
2024-05-10 07:23:39 +00:00
box-shadow: ${dt('menu.shadow')};
}
.p-menu-submenu-item {
2024-05-10 07:23:39 +00:00
background: ${dt('menu.submenu.label.background')};
padding: ${dt('menu.submenu.label.padding')};
color: ${dt('menu.submenu.label.color')};
font-weight: ${dt('menu.submenu.label.font.weight')};
}
.p-menu-separator {
2024-05-10 07:23:39 +00:00
border-top: 1px solid ${dt('menu.separator.border.color')};
}
`;
const classes = {
root: ({ props }) => [
'p-menu p-component',
{
'p-menu-overlay': props.popup
}
],
start: 'p-menu-start',
list: 'p-menu-list',
submenuItem: 'p-menu-submenu-item',
2024-04-09 11:59:41 +00:00
separator: 'p-menu-separator',
end: 'p-menu-end',
item: ({ instance }) => [
2024-04-09 11:59:41 +00:00
'p-menu-item',
{
'p-focus': instance.id === instance.focusedOptionId,
'p-disabled': instance.disabled()
}
],
itemContent: 'p-menu-item-content',
itemLink: 'p-menu-item-link',
itemIcon: 'p-menu-item-icon',
2024-05-06 13:10:13 +00:00
itemLabel: 'p-menu-item-label'
};
export default BaseStyle.extend({
name: 'menu',
theme,
classes
});