No Code Attached Yet
avatar joomleb
joomleb
19 Nov 2023

Hi guys,
as far as I see, to the "Menu Item > Link Type > Link Icon class" a fixed "p-2" attribute class is applied.

That is spacing also on the left side, moving all the menu items on the right and creating a bad ordering column, confusion with the sub menu items that are not using icons, for example.

It should be "pe-2"
https://getbootstrap.com/docs/5.3/utilities/spacing/
Please, Can you confirm it ?
Please, Where can we manually edit and fix it ?

Maybe, it would be better to add it through CSS instead to use the fixed Bootstrap attribute. It would be simpler for customers to personalize it, if needed.

Please, Why you choose to add there a padding space instead of a margin space ?

avatar joomleb joomleb - open - 19 Nov 2023
avatar joomla-cms-bot joomla-cms-bot - change - 19 Nov 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Nov 2023
avatar chmst
chmst - comment - 20 Nov 2023

Did you also try with a right-to-left and left-to-right language?

avatar brianteeman
brianteeman - comment - 20 Nov 2023

@chmst pe-2 is a logical css property so should work the same in both

avatar joomleb
joomleb - comment - 21 Nov 2023

@chmst sure, that's why I reported the Bootstrap link:
"...e - (end) for classes that set margin-right or padding-right in LTR, margin-left or padding-left in RTL..."

avatar joomleb joomleb - change - 21 Nov 2023
Title
[4.4.0 Bug] Link Icon class p-2
[4.4 & 5 Bug] Link Icon class p-2
avatar joomleb joomleb - edited - 21 Nov 2023
avatar joomleb
joomleb - comment - 25 Nov 2023

Hi guys,
as far as I investigated these should be the lines to change:
…/modules/mod_menu/tmpl/default_component.php - line 44 and 47

But maybe also:
…/modules/mod_menu/tmpl/default_heading.php - line 23 and 26
…/modules/mod_menu/tmpl/default_separator.php - line 23 and 26
…/modules/mod_menu/tmpl/default_url.php - line 36 and 39

1 - @brianteeman Please, Can you confirm me ?
If confirmed and if you want I can prepare the PR...

2 - Please, What is the best solution for you ? Padding pe-2 or Margin me-2 ?

avatar brianteeman
brianteeman - comment - 25 Nov 2023

Sorry I don't understand what you are trying to solve

image

avatar joomleb
joomleb - comment - 26 Nov 2023

Hi @brianteeman
I thought it was clear and sorry for my English.

1 - The Link Icon class should only take care to space itself from the menu item title. So, only on the right (left on LTR), because in case of a mod menu in a vertical view, as it is now p-2, it is moving all the menu items with the icons on the right. This creates a bad vertical alignment, where menu items of the same level (some menu items can have the icon, some no,) are not well aligned. And creating confusion with the sub menu items, where a 1st level menu item with icon could be vertically aligned with a 2nd level menu item that is not using icon.

Is it clear now what I mean ?

2 - Then I asked you if it is better to use padding (as it is now) or margin.
Anyway we can also say that to add a spacing class there it is not a must, Why ?
Well, simply because when a Joomla user id setting the "Menu Item > Link Type > Link Icon class: ..." he can add what he wants, also a pe-2 class (or me-2, p-2 etc.).
So, to add a fixed class there it is not a must, it could be deleted and, sure, it cannot be "p-2" attribute class.

I remain available

avatar brianteeman
brianteeman - comment - 26 Nov 2023

Thanks for the screenshots. Makes perfect sense now.

Please submit a pull request so that others can test and review.

avatar chmst
chmst - comment - 26 Nov 2023

As you write, everyone can add own classes and removing the class makes it flexible.

But it is a b/c break, it affects existing menus.

avatar brianteeman
brianteeman - comment - 26 Nov 2023

As you write, everyone can add own classes and removing the class makes it flexible.

The p-2 class is hardcoded :(

But it is a b/c break, it affects existing menus.

6.1.7 Rendered markup
For the time being, rendered markup is not subject to our backwards compatibility promise.

https://developer.joomla.org/development-strategy.html#backward_compatibility

avatar chmst
chmst - comment - 26 Nov 2023

The p-2 class is hardcoded :(

I wanted to say that I prefer removing the class completely and not change it to pe- or anything else.

avatar joomleb
joomleb - comment - 26 Nov 2023

Hi guys,
@brianteeman before to going on with the PR,
Please, Can you confirm me that "to completely remove the p-2 classes" is the chosen solution ?

avatar joomleb
joomleb - comment - 28 Nov 2023

Hi guys, @brianteeman before to going on with the PR, Please, Can you confirm me that "to completely remove the p-2 classes" is the chosen solution ?

@brianteeman I know you have thousands of things here, so maybe you lost this. Just to remember you that I'm waiting your confirmation before to going on...

avatar brianteeman
brianteeman - comment - 28 Nov 2023

it is really nothing to do with me. just create a pr how you think it is best and then maintainers and release oleads will make a decision. my opinion is no more important and valid than yours

avatar joomleb joomleb - change - 29 Nov 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-11-29 17:41:31
Closed_By joomleb
avatar joomleb joomleb - close - 29 Nov 2023

Add a Comment

Login with GitHub to post a comment