From 03c9826afcd0a5f6a5d2187636ada8e7a6a7137e Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Thu, 31 Oct 2024 10:13:43 +0300 Subject: [PATCH] Refactor #6682 - For Menubar --- .../src/menubar/style/MenubarStyle.js | 39 ++++++++++++++++--- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/packages/primevue/src/menubar/style/MenubarStyle.js b/packages/primevue/src/menubar/style/MenubarStyle.js index 454bfd45b..a783a135f 100644 --- a/packages/primevue/src/menubar/style/MenubarStyle.js +++ b/packages/primevue/src/menubar/style/MenubarStyle.js @@ -77,6 +77,12 @@ const theme = ({ dt }) => ` height: ${dt('menubar.submenu.icon.size')}; } +.p-menubar-submenu .p-menubar-submenu-icon:dir(rtl) { + margin-left: 0; + margin-right: auto; + transform: rotate(180deg); +} + .p-menubar-item.p-focus > .p-menubar-item-content { color: ${dt('menubar.item.focus.color')}; background: ${dt('menubar.item.focus.background')}; @@ -132,24 +138,34 @@ const theme = ({ dt }) => ` } .p-menubar-submenu .p-menubar-separator { - border-top: 1px solid ${dt('menubar.separator.border.color')}; + border-block-start: 1px solid ${dt('menubar.separator.border.color')}; } .p-menubar-submenu .p-menubar-item { position: relative; } - .p-menubar-submenu > .p-menubar-item-active > .p-menubar-submenu { +.p-menubar-submenu > .p-menubar-item-active > .p-menubar-submenu { display: block; left: 100%; top: 0; } +.p-menubar-submenu > .p-menubar-item-active > .p-menubar-submenu:dir(rtl) { + left: auto; + right: 100%; +} + .p-menubar-end { margin-left: auto; align-self: center; } +.p-menubar-end:dir(rtl) { + margin-left: 0; + margin-right: auto; +} + .p-menubar-button { display: none; justify-content: center; @@ -201,6 +217,11 @@ const theme = ({ dt }) => ` gap: ${dt('menubar.submenu.gap')}; } +.p-menubar-mobile .p-menubar-root-list:dir(rtl) { + left: auto; + right: 0; +} + .p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content > .p-menubar-item-link { padding: ${dt('menubar.item.padding')}; } @@ -215,7 +236,7 @@ const theme = ({ dt }) => ` } .p-menubar-mobile .p-menubar-root-list .p-menubar-separator { - border-top: 1px solid ${dt('menubar.separator.border.color')}; + border-block-start: 1px solid ${dt('menubar.separator.border.color')}; } .p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content .p-menubar-submenu-icon { @@ -223,6 +244,12 @@ const theme = ({ dt }) => ` transition: transform 0.2s; } +.p-menubar-mobile .p-menubar-root-list > .p-menubar-item > .p-menubar-item-content .p-menubar-submenu-icon:dir(rtl), +.p-menubar-mobile .p-menubar-submenu-icon:dir(rtl) { + margin-left: 0; + margin-right: auto; +} + .p-menubar-mobile .p-menubar-root-list > .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon { transform: rotate(-180deg); } @@ -232,7 +259,7 @@ const theme = ({ dt }) => ` transform: rotate(90deg); } -.p-menubar-mobile .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon { +.p-menubar-mobile .p-menubar-item-active > .p-menubar-item-content .p-menubar-submenu-icon { transform: rotate(-90deg); } @@ -241,8 +268,8 @@ const theme = ({ dt }) => ` position: static; box-shadow: none; border: 0 none; - padding-left: ${dt('menubar.submenu.mobile.indent')}; - padding-right: 0; + padding-inline-start: ${dt('menubar.submenu.mobile.indent')}; + padding-inline-end: 0; } `;