joomla / 40-backend-template

Joomla 4.0 Backend Template Repository
GNU General Public License v2.0
14 stars 6 forks source link

Add SCSS compiler to Template #92

Open C-Lodder opened 7 years ago

C-Lodder commented 7 years ago

This was going to be re-evaluated for J4.0 and needs to be done:

https://github.com/joomla/joomla-cms/pull/11941

ghost commented 7 years ago

I'm in favor a front end API and we should be able to override everything. That's kind of the point of MVC and it's big advantage in our architecture that we should do more with.

I question the need to recompile all template core files and bootstrap dependencies unless it's an override and people are choosing to do that. Any end user solution should be completely based on overrides, they shouldn't be based around potential changes to the core file implementation. We all know users shouldn't be messing with core files, too many do already and we should discourage it.

Core files don't need to be recompiled, only custom changes do and it needs to be implemented in a way that overrides the core files and leaves them untouched. Custom css or scss doesn't necessarily need to be added to template.css.min, it could be complied into custom.css.min or whatever. If users can override the compiling script in through a template override they could do whatever they want.

I think just having an option available or some way to hook into the functionality is enough for people who want to do this kind of thing.

mbabker commented 7 years ago

We aren't talking about recompiling all of the core files here. Unless I've missed something, this is focused on the template manager integrations, where a user can and will edit anything the UI gives them access to. Yeah, that might mean the files shipped with the core templates because users directly modify those instead of copying the templates or whatnot, but that's beside the point and not something we can prevent; the template is the user's domain.

If we try to get fancy by detecting the file changes and compiling those into a custom.css file or something, we're going to make the code a lot more complex than it needs to be. Clicking "Compile Whatever-This-Is" shouldn't be much more complex than a simple grunt less job.

C-Lodder commented 7 years ago

Well that's pretty much another topic. We'll provide a custom.scss file for the user to edit. Do we want to compile this into a separate file (custom.css.min)? Or do we want to re-compile everything. Personally, I'd rather save the additional HTTP request.

ghost commented 7 years ago

I agree we shouldn't make this overly complex. There are downsides to this particular idea but the upside is it takes some of the other complications away. We don't necessarily need a detection system, just a way for people to hook into the functionality so they can customize the way they want to.

All we need to do is make the functionality more accessible to people who want to use it. It's all in there right now but it's much easier to install a third party solution than it is to take advantage of the core functionality.

As I've said all along, it's not a highly requested feature but I don't see any downside to providing an easier way to let people tap into it. We can bring this functionality out in many different ways, either through an override, a more accessible script, or better documentation. It doesn't have to be complicated.

N6REJ commented 5 years ago

am I wrong or has scss compilation been added to 3.9?

wilsonge commented 5 years ago

You are wrong :)