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">
Labels |
Added:
?
|
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.
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.
Status | New | ⇒ | Discussion |
Category | ⇒ | com_modules |
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. :)
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.
There are some other things to think like about
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.
We use this concept everywhere you can add css eg menu class. So if it is changed we should do it consistently.
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.
I just have an extra space
We can trim the extra space ;)
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.
I would suggest we can rename this to be something like
Additional Module CSS Class
and get rid of the suffix functionality
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-09 14:05:55 |
Closed_By | ⇒ | ciar4n |
Because you can actually disable an existing class with that.
Assume the modulechrome has
<div class="module">
and the template applies some styles to thatmodule
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.