Refactored menu css

pull/5677/head
Cagatay Civici 2024-04-09 14:59:41 +03:00
parent 7b0c4450a7
commit 0f716d4e16
2 changed files with 26 additions and 27 deletions

View File

@ -9,21 +9,21 @@ const classes = {
}
],
start: 'p-menu-start',
menu: 'p-menu-list p-reset',
submenuHeader: 'p-submenu-header',
separator: 'p-menuitem-separator',
menu: 'p-menu-list',
submenuHeader: 'p-menu-submenu-item',
separator: 'p-menu-separator',
end: 'p-menu-end',
menuitem: ({ instance }) => [
'p-menuitem',
'p-menu-item',
{
'p-focus': instance.id === instance.focusedOptionId,
'p-disabled': instance.disabled()
}
],
content: 'p-menuitem-content',
action: 'p-menuitem-link',
icon: 'p-menuitem-icon',
label: 'p-menuitem-text'
content: 'p-menu-item-content',
action: 'p-menu-item-link',
icon: 'p-menu-item-icon',
label: 'p-menu-item-text'
};
export default BaseStyle.extend({

View File

@ -9,25 +9,25 @@ export default {
min-width: 12.5rem;
}
.p-menu ul {
.p-menu-list {
margin: 0;
padding: 0;
list-style: none;
}
.p-menu .p-menuitem {
.p-menu-item {
margin: 2px 0;
}
.p-menu .p-menuitem:first-child {
.p-menu-item:first-child {
margin-top: 0;
}
.p-menu .p-menuitem:last-child {
.p-menu-item:last-child {
margin-bottom: 0;
}
.p-menu .p-menuitem-link {
.p-menu-item-link {
cursor: pointer;
display: flex;
align-items: center;
@ -39,52 +39,51 @@ export default {
user-select: none;
}
.p-menu .p-menuitem-text {
line-height: 1;
}
.p-menu .p-menuitem-content {
.p-menu-item-content {
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')};
border-radius: ${dt('rounded.sm')};
color: ${dt('menu.item.color')};
}
.p-menu .p-menuitem-icon {
.p-menu-item-text {
line-height: 1;
}
.p-menu-item-icon {
color: ${dt('menu.item.icon.color')};
margin-right: 0.5rem;
}
.p-menu .p-menuitem.p-focus .p-menuitem-content {
.p-menu-item.p-focus .p-menu-item-content {
color: ${dt('menu.item.focus.color')};
background: ${dt('menu.item.focus.background')};
}
.p-menu .p-menuitem.p-focus .p-menuitem-icon {
.p-menu-item.p-focus .p-menu-item-icon {
color: ${dt('menu.item.icon.focus.color')};
}
.p-menu .p-menuitem:not(.p-disabled) .p-menuitem-content:hover {
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover {
color: ${dt('menu.item.focus.color')};
background: ${dt('menu.item.focus.background')};
}
.p-menu .p-menuitem:not(.p-disabled) .p-menuitem-content:hover .p-menuitem-icon,
.p-menu .p-menuitem:not(.p-disabled) .p-menuitem-content:hover .p-submenu-icon {
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {
color: ${dt('menu.item.icon.focus.color')};
}
.p-menu.p-menu-overlay {
.p-menu-overlay {
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.p-menu .p-submenu-header {
.p-menu-submenu-item {
margin: 0;
padding: 0.5rem 0.75rem;
color: ${dt('menu.submenu.header.color')};
font-weight: 600;
}
.p-menu .p-menuitem-separator {
.p-menu-separator {
border-top: 1px solid ${dt('menu.separator.border.color.color')};
margin: 2px 0;
}