YUI compressor in AEM removes % signs from colour values

727 Views Asked by At

When using zero values, YUICompressor assumes that the units of measure are not required, so the YUICompressor will strip them.

But it causes issues in our compressed CSS file as follow:

YUICompressor compressed this:

hsla(0, 0%, 100%, 0)

to this:

hsla(0, 0, 100%, 0)

But by removing the % from the second value for hsla (saturation), YUICompressor generates an invalid css statement.

Is it possible to configure YUICompressor settings to correct this behaviour?

1

There are 1 best solutions below

0
Jens On

You can configure YUI compressor, although I am not sure if you can explicitly fix your issue.

The compressor can be configured in the OSGi configuration called Adobe Granite HTML Library Manager that you can find in /system/console/configMgr. This configuration should contain a JS Processor Default Configs configuration, that you can change.

But please be aware that this configuration is used for the whole AEM installation. If you want to change settings on the client library level, you can do so in the .content.xml where you define the cq:ClientLibraryFolder of the client library you want to change the settings.

More information on the YUI compressor can be found here:

https://yui.github.io/yuicompressor/

The --disable-optimizations might be what you are looking for.