?
avatar ciar4n
ciar4n
28 Jun 2017

I'm possibly missing something here but why Module Class Suffix and not just Module Class. Does this not add an extra complexity having to explain that any class added has to be prepended by a space? Adding an extra class rather than appending the current class will be the use case 95% of the time. Even considering Bootstrap you will always add a class rather than append the current class.

For example it is always...

<div class="card card-primary">

Not..

<div class="card-primary">

avatar ciar4n ciar4n - open - 28 Jun 2017
avatar joomla-cms-bot joomla-cms-bot - change - 28 Jun 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Jun 2017
avatar ciar4n ciar4n - change - 28 Jun 2017
The description was changed
avatar ciar4n ciar4n - edited - 28 Jun 2017
avatar ciar4n ciar4n - change - 28 Jun 2017
The description was changed
avatar ciar4n ciar4n - edited - 28 Jun 2017
avatar ciar4n ciar4n - change - 28 Jun 2017
The description was changed
avatar ciar4n ciar4n - edited - 28 Jun 2017
avatar Bakual
Bakual - comment - 28 Jun 2017

Because you can actually disable an existing class with that.
Assume the modulechrome has <div class="module"> and the template applies some styles to that module class. Using a suffix you can make that class <div class="module-custom"> and fully disable the default styling and apply your own.

Basically a suffix is more flexible than just a class.

avatar ciar4n
ciar4n - comment - 28 Jun 2017

I understand the logic behind it, I would just question it's real world usage. A slight case of complicating a field for the sake of an edge case. Especially these days where we have more modular CSS.

avatar Bakual
Bakual - comment - 28 Jun 2017

I don't think it is an edge case, it is used quite often in templates to offer various styles for a module.
I also don't think it's complicating a field. You just have to understand the word "Suffix", which isn't that hard.
I think it's a useful flexible feature which comes at a very minor cost.

avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Jun 2017
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Jun 2017
Category com_modules
avatar ciar4n
ciar4n - comment - 28 Jun 2017

I don't think it is an edge case, it is used quite often in templates to offer various styles for a module.

I am failing to find any. Checked all major template clubs that I can think of (Rockettheme, Shape5, Gavick, Joomshaper) and they all either appear to create a chrome adding a space or require variation classes to be appended with a space.

You just have to understand the word "Suffix", which isn't that hard.

This is possibly an indicator of my skill level in the English language but I did have to quickly google 'define suffix' before I opened this. :)

avatar Bakual
Bakual - comment - 28 Jun 2017

I am failing to find any.

I know I use that in my own template (which is based on a discontinued other one).
What I find far more troubling is that this suffix is often used both in the chrome and in the module output itself, giving you duplicate nested classes. But that is the case regardless if it is a suffix or an own class.

This is possibly an indicator of my skill level in the English language

You should use a language pack in your language ?
I think the concept of suffixes is well known in Joomla as it is used in various places, not only modules. I doubt it is a real problem.

avatar brianteeman
brianteeman - comment - 28 Jun 2017

There are some other things to think like about

  1. Personally I have never seen it used as a true suffix but I guess there may be cases. However the user experience is terrible if it is to be a sufficient as you can never see the class name that you are adding the suffix to.

  2. We use this concept everywhere you can add css eg menu class. So if it is changed we should do it consistently.

  3. After 12 years I know to always start with a space but from experience teaching others it is not obvious.

So what is the consequences of making it a true class and not a suffix. As long as we make the changes get consistently everywhere there really isn't any as it was hard to use as a real suffix (see above) and for old timers like me who are used to adding a space if you remove the need and I still add a space then it still works I just have an extra space.

avatar dgt41
dgt41 - comment - 28 Jun 2017

I just have an extra space

We can trim the extra space ;)

avatar ciar4n
ciar4n - comment - 28 Jun 2017

I would add that Module Class Suffix does not really help in promoting a naming convention for reusable and modular CSS. In my experience you should only see a suffixed class name if referring to either a modifier or a child of the class name been suffixed. This is a parent class and modifiers are always added to and never replace the class they are modifying.

avatar brianteeman
brianteeman - comment - 30 Jun 2017

I would suggest we can rename this to be something like
Additional Module CSS Class

and get rid of the suffix functionality

avatar ciar4n
ciar4n - comment - 9 Jul 2017

PR created.. #17023

avatar ciar4n ciar4n - change - 9 Jul 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-07-09 14:05:55
Closed_By ciar4n
avatar ciar4n ciar4n - close - 9 Jul 2017

Add a Comment

Login with GitHub to post a comment