Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Custom Less

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

HI there,

I am a little rusty with Joomla! so i know its something basic missing, i used to develop using the Base3 template, but i've decided to use a new template 'Responsive2'

I have created a new theme, and i have also renamed the custom.less file in templates/responsive2/less folder. I have saved and compiled this new theme and i have also enabled the 'Compress CSS output' in the settings tab. My CSS is working, however why do i need to save and compile after every change in custom.less? i seem to remember this not being an issue. Also on the front end of the site using dev tools it shows my new css with the file path going to custom.less, so to me this is not compiling to css anyway?

Also, probably a related issue but i cannot find the new variables for the new theme in the site files.

I know i'm probably missing something basic here, as i said i'm pretty rusty with Joomla!

Thanks for your help.
  • JY Web Solutions's Avatar
  • JY Web Solutions
  • LIfetime Developer - Big Bamboo
  • 29 posts
  • Karma: 0
The administrator has disabled public write access.
Hi

My apologies if you've already read this - but just in case

docs.joomlabamboo.com/zen-grid-framework-4/theme/customisation

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Also just in case I should point out the last template release does include a new version of responsive as a sub theme

It is a new framework version so depending how far you are along it may be worth looking at

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
www.joomlabamboo.com/joomla-templates/buildr and

bambootheme.com/showcase/apr16/home/responsive

- forgot to include the links

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,

Thanks for your reply. I have read this yes.

I still do not see how that resolves my problem, when clicking save and compile theme on my new theme, in dev tools the new css is coming from the less file, so to me this is not compressing to css? Also, as i mentioned despite creating theme from the admin, i cannot see this theme anywhere in the Joomla! files to see for example the new variables i created in theme options.

Thank you.
  • JY Web Solutions's Avatar
  • JY Web Solutions
  • LIfetime Developer - Big Bamboo
  • 29 posts
  • Karma: 0
The administrator has disabled public write access.
Due to me running out of time i have installed the build.r template, and i am giving this a shot. Very quickly i am having the same problem, the variables i have created in the theme, i cannot find anywhere in the files, nor is the front end listening to them???

Am i missing a setting here somewhere? I've read all documentation i cannot see anything.
  • JY Web Solutions's Avatar
  • JY Web Solutions
  • LIfetime Developer - Big Bamboo
  • 29 posts
  • Karma: 0
The administrator has disabled public write access.
Hi,

When the themes get compiled, they produce a sourcemap file which relates the compressed css file back to the less files they are generated from.
The compiled css files shouldn't be edited manually and the sourcemap shows where the rules come from.

The browser isn't using the less files on the site as it cannot interpret them, it uses the generated css file.

The theme settings are saved in the templates /settings/theme folder as a json file. You should see a file in that folder with the same name as your theme.

Let me know if that wasn't very clear!

Regards,

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
With regards to the custom less file.

You need to compile the theme for the rules to be included into the generated css file.

less files cannot be loaded directly in the browser without using javascript to convert them to css as the browser doesn't understand less files.

If you use a custom.css file then you do not need to compile as this file is loaded directly on the site.
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
HI Rob,

I think you may have mis understood my query regarding the compiled css, the Responsive 2 theme was not compiling to css, the css was outputting less, thats not an issue any more as i have decided to use the build.r template.

My only issue now is that i cannot see the variables for my new theme, i would expect to see my new variables created in the theme options in something like custom-variables.less

This file does not exist. Even though my variable values are in the json file i fail to see why i cannot find them in the less files?

Thanks for your reply.
  • JY Web Solutions's Avatar
  • JY Web Solutions
  • LIfetime Developer - Big Bamboo
  • 29 posts
  • Karma: 0
The administrator has disabled public write access.
Hi,

Less files will only be loaded if you have development mode enabled in the template settings. When that is enabled a javascript file is loaded that translated the loaded less files.

If that option is off, the compiled css file is loaded, BUT, if you are using developer tools to inspect the css, you will see the less files referenced. This does not mean that the site is loading less files, it is due to the sourcemap. If you look at the source of the page you shouldn't see any less files being loaded.

Buildr does this as well so you would see the same thing when loading a compressed css file.

Themes are not saved as less files. When the compiler runs, it gets the values from the theme's json config file.
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
The following user(s) said Thank You: JY Web Solutions

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers