CSS bug fixing : I am about to remove legacy CSS, contemplating if it would be better to override the property in a different file

In trying to fix bug 1446 ( https://github.com/plone/Products.CMFPlone/issues/1446 ) , I came across an issue where the source of the bug is in legacy CSS. I'm trying to decide whether it's better to remove the offending code or simply override it in a suitable .less file.

I found the issue in this minifield file https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/static/plone-legacy-compiled.css this CSS rule causes the problem

.icons-on .contenttype-collection{... padding-left:20px!important}

When the css property is removed it works, are there possible repercussions given its in legacy code or can it be removed without side effects ?

Image 1 - Bug #1446 : Collection text behind icon

Image 2 - Bug #1446 : effect after padding-left is disabled

IMO, there should be no side effects if the problematic CSS declaration block is removed. But don't remove it from plone-legacy-compiled.css directly, because that file is generated from others. Remove it directly from the source. Using grep on your project directory should show you where it is (grep -R icons-on..contenttype-collection .). Or have a look in http://localhost:8080/Plone/@@resourceregistry-controlpanel under the plone-legacy bundle and see, what it consists of.

1 Like

It's here: https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/static/plone-legacy-compiled.css and instructions to generate it, here: https://github.com/plone/Products.CMFPlone/blob/master/DEVELOPING_BUNDLES.rst

1 Like

I had the impression, that plone-legacy-compiled.css must have been compiled from other source files. But it looks like, it was done manually.
@bloodbare - you added this file - how did you compile it and what are it's sources?

Hmm... interesting, I would have expected an associated .map file.
But there is none for plone-legacy-compiled.css. For example https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/static/plone-compiled.css.map corresponds to https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/static/plone-compiled.css

@jordnv any progress? @ramon any insight on this one?

Are you sure plone-legacy is generated using plone-compile-resources?
I do not find any config for that.

Unless I'm misunderstanding the setup, it seems to have been generated once upon a time, but now it looks like it is maintained in place. In which case @jordnv it should be a matter of removing the "bad" code from that legacy file.

Was hoping for @ramon to say something.


Hey sorry I missed this thread,

The reason is quite simple:

  • there is no map because its not compiled as the compiled resources (requirejs)

  • legacy bundles are compiled and stored on the zodb at the first rendering page of a new site in case the "last compilation time" is earlier than the "last time installed a product with legacy bundle". Its designed to compile if you install a new product with jsregistry (that it will be installed in the new registry but we mainteined bbb) then the date of the last installation of legacy bundle will be updated and on the next view css will be "reconcatenated" (remember that legacy it only gets concatenated, not compiled)

  • The one that is on Products.CMFPlone/static/plone-legacy-compiled.css it was created just in case there is no product installed on a fresh plone site. That file will be needed to be updated on plone releases. How ? on a really manual way, I just copied the css/js from the resource registry on dev mode and saved on a file a fresh site.

About where it comes from a simple search on plone org on github it looks like it cames from the rtl.css old css that may be outdated and removed since the last time we checkin that file.

So actions to solve that would be to push a new version of it and add it to the release process or just change the site setup to execute a new cookWhenChangingSettings(self.context, legacy) after plone installation to make sure that we have "last fresh version" on the zodb


I'm going to come back and re-read this when I'm a bit fresher :slight_smile:

It's fixed: https://github.com/plone/Products.CMFPlone/issues/1446
Tnx for reporting.

1 Like