Shape 5

Joomla Club Extensions => Accordion Menu - Club => : phoenix710 October 23, 2017, 08:37:00 AM



: Best Practice: changing template.css, s5_accordion_menu.css and custom.css.
: phoenix710 October 23, 2017, 08:37:00 AM
Joomla 3.8.0
Template: StorePro, downloaded a few days ago.
Plugin: Accordion Menu, also downloaded a few days ago.

While working on some styling for the Accordion Menu module, I used the dev tools feature of Chrome to find the style(s) I needed to modify. (Pretty standard, no surprises ...)

I then confirmed that new styles placed in custom.css (in the template subdir) did, in fact, take precedence as expected.

However, while attempting to change the hover/active color of the top-level elements, I discovered that there were 30+ s5_accordion_menu CSS style defs were in template.css, while a relatively small number were in s5_accordion_menu.css.

I've seen, for the most part, the s5_accordion_menu styles in template.css are a superset of those found in s5_accordion_menu.css. I didn't expect this. (Of course I understand that the Accordion Menu styles found in the template's CSS file will be ignored if the Accordion Menu is NOT installed.)

Since I'm new with S5, I have no idea how frequently the templates and extensions are updated (if ever), which brings me to the question of Best Practice.

What is best practice for style changes? I've noticed in reviewing many entries in this forum that there is the frequent inference and/or mention of actually changing the template and/or extension CSS files directly. I thought that this type of change was NOT to be done, since either the template and/or the extension could be updated and reinstalled; any changes made to source files would be therefore be lost.

Is there any reason to NOT use custom.css for ALL changes?
It is more efficient to the rendering if the source files contain the custom styles?
Is custom.css the "last place" checked by the rendering engine for styling data?

Or, is it the case that StorePro and/or Accordion Menu (in my site) will never be updated, and therefore source file changes can be, in effect, viewed as permanent?

Thanks,
Dave


: Re: Best Practice: changing template.css, s5_accordion_menu.css and custom.css.
: jonahh October 23, 2017, 12:19:13 PM
Hey Dave,

The custom.css file is specifically for your custom changes so that you can backup this file and reinstall the template if you need to. But since most updates usually always take place on a framework level you probably will never come across this situation unless something happens like the template files get messed up with an edit.

When you patch the framework files it will never touch the template.css file or custom.css files. The only reason a template would ever get updated would be a CSS bug but these usually happen near the beginning of a template launch and are quite rare anymore. Also if they do happen we usually post the fix so you could just update it yourself vs re-installing the entire template.



: Re: Best Practice: changing template.css, s5_accordion_menu.css and custom.css.
: phoenix710 October 23, 2017, 12:51:39 PM
Thank you for the info.
Dave