Working on CSS/Less in plonetheme.barceloneta

I'm working on the following issue:

The fix will most likely entail replacing @plone-font-weight-light with @plone-font-weight-regular in a less file.
I've made the change but I expected grunt watch to just detect it and then be able to see the change in my live site. Is there a step I'm missing?

I really want to see that the change has been effected before doing a pull request.

Enabling development mode solved the problem.

If I understand things correctly, Plone 5 will compile LESS without grunt, so I'm not sure if the whole grunt watch thing was even needed to fix this bug. Can anyone clarify this for me?

@zopyx that should work. If grunt watch detects it, it should compile and save.

Only other thing is to make sure you are developing plonetheme.barceloneta.

Barceloneta diazo css/less is not registered on the registry of plone in order to enable zip themes to be loaded.

So, if you work on less from barceloneta on plonetheme.barceloneta you need to compile it with the gruntfile that is on the package. In diazo themes we defined the less/requirejs development files and css/js production files on the manifest.cfg so when you are on development on plone you also get the source of the code. As its not defined as a bundle you will not be able to compile it on Plone (we had a discussion on Bristol to enable that barceloneta can be a theme without profile).

Conclusion:

If you want to modify plonetheme.barceloneta less you need to run grunt less or grunt watch on plonetheme.barceloneta src folder.

2 Likes

Thanks @ramon, very useful.

Great info! Could it be included in https://github.com/plone/plonetheme.barceloneta/blob/master/HOWTO_DEVELOP.txt ?

1 Like

That's a good idea. In fact this information should probably be either in the README or referenced from the README.

1 Like

Does this capture it? (the Notes at the bottom)

Notes
-----

- You may want to enable Development Mode in the Site Setup -> Resource Registries to see your changes.

- If you want to modify plonetheme.barceloneta LESS you need to run `grunt less` or `grunt watch` on the plonetheme.barceloneta src folder

I've made some updates to the HOWTO_DEVELOP document here:

The updated file looks like this:

1 Like