No Code Attached Yet
avatar gerryfrancis
gerryfrancis
31 Mar 2021

What needs to be fixed

Protostar (Joomla! version 3.x).

Buttons (<label> class .btn) within button groups are separated from each other with a 1 pixel gap occupied by their respective side frames when the HTML block includes other (<input>) lines in between.

This is an example of a button group when editing a module in the Protostar frontend:

grafik

This is the underlying HTML code:

<fieldset id="jform_published" class="btn-group radio">
	<input type="radio" id="jform_published0" name="jform[published]" value="1" checked="checked">
	<label for="jform_published0" class="btn active btn-success">Published</label>
	<input type="radio" id="jform_published1" name="jform[published]" value="0">
	<label for="jform_published1" class="btn">Unpublished</label>
	<input type="radio" id="jform_published2" name="jform[published]" value="-2">
	<label for="jform_published2" class="btn">Trashed</label>
</fieldset>

Why this should be fixed

Although editing is not broken in any way, it is neither intended nor transparent why alignment of buttons behaves differently.

This is an example of a button group that displays correctly:

grafik

How would you fix it

It seems that the CSS rule to close the gap does not apply in this scenario. I am no expert in CSS/LESS, but I believe that

.btn-group > .btn + .btn {
	margin-left: -1px;
}

should be replaced either with

.btn-group > .btn + input + .btn {
	margin-left: -1px;
}

or with

.btn-group > .btn ~ .btn {
	margin-left: -1px;
}

(different selector to address all .btn class elements on the same level).

Side Effects expected

None.

Personal remark

There may be other CSS/LESS rules with + selector affected when confrontated with additional HTML code lines between the elements. Besides, I do not know which (template) files other than template.css must be edited as well.

avatar gerryfrancis gerryfrancis - open - 31 Mar 2021
avatar joomla-cms-bot joomla-cms-bot - change - 31 Mar 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 31 Mar 2021
avatar anshi8269
anshi8269 - comment - 1 Apr 2021

Can u please give the link to the website where the button separates differently?
or a pic when they get separated.
Actually, I didn't get the HTML file so I can see the problem.

avatar brianteeman
brianteeman - comment - 1 Apr 2021

@anshi8269 Everything you need to resolve this is in the post. If you don't understand that then it's probably not the right issue for you to work on.

avatar ChristineWk
ChristineWk - comment - 1 Apr 2021

@anshi8269

It belongs to: editing a module in the Protostar frontend.

Actual Result:

screen shot 2021-04-01 at 10 47 47

Expected Result:

screen shot 2021-04-01 at 10 48 35


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32946.

avatar gerryfrancis
gerryfrancis - comment - 1 Apr 2021

Thanks to everyone for your commitment!

@ChristineWk That is correct, maybe I should have highlighted the info in the first place.

avatar joomdonation joomdonation - change - 16 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-16 08:51:53
Closed_By joomdonation
Labels Added: No Code Attached Yet
Removed: ?
avatar joomdonation joomdonation - close - 16 Nov 2022
avatar joomdonation
joomdonation - comment - 16 Nov 2022

Joomla 3 is now in maintenance mode and only security bugs fixes, so changes like this won't be implemented anymore. Therefore, I'm closing this issue.

avatar gerryfrancis
gerryfrancis - comment - 16 Nov 2022

@joomdonation Never mind, it is just a minor cosmetic issue. Thanks for closing! ?

Add a Comment

Login with GitHub to post a comment