Closed (fixed)
Project:
Advanced CSS/JS Aggregation
Version:
8.x-4.x-dev
Component:
General CSS/JS
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Apr 2020 at 07:38 UTC
Updated:
7 Apr 2021 at 09:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jwilson3This SVG compression problem from the YUI Compressor not only affects AdvAgg + Claro theme, but also AdvAgg + Bootstrap 4 related themes, such as Radix because Bootstrap 4 inlines the SVGs for several components like the next/previous icons for carousel component, and the radio/checkbox for their
.custom-*form components.The workaround for me has been to leverage sass's str-replace() mixin to manually url encode all space characters with '%20'.
in src/sass/base/_variables.scss:
Comment #3
jwilson3A second perhaps better workaround is the following patch, which also requires running
composer require tubalmartin/cssminin your site.This will work until a more complete patch would remove and or update CSSMin class from the module codebase and add a dependency in this module's composer.json, or instructions in the module's README.
Comment #4
jwilson3Marking it needs work, because the patch in #3 does nothing to clean up the old outdated CSSMin class bundled with the module in
advagg/advagg_css_minify/yui/CSSMin.inc.Comment #5
joelpittet@jwilson3 I'm not sure the answer here but could we add this to the
composer.jsonas a dependency and if so, will this require we version bump and include non-composer instructions?I feel it would be "easy" to update the code in place but maybe not "right". Anyways this patch is just riffing on the direction you were going with composer.
Comment #6
joelpittetAdded to the main composer.json because there is no way to do optional third-party dependencies, discussed with @mixologic
Comment #8
joelpittetIf we want a quick-fix, I don't mind dumping the class in that file and calling it a day... just say the word maintainers.
Quick change to the test.
Comment #10
joelpittetMy editor added a line break at the end of the file.
Comment #11
agoradesign commentedworks for me :)
Comment #12
jwilson3@joelpittet, thanks for picking up the ball and running with it!
I like that you also updated the comment_hacks css file. It made me wonder if we should actually add a test for something like the inline SVG data uri as a test case in a CSS file? Provide a "-tests-only" patch and watch it fail. Maybe this is going too far for a contrib module, and since I'm not the maintainer, it's just a suggestion.
Again, not the maintainer, but I cannot see how a maintainer would consciously make the decision to do something like and perpetuate more work for themselves to keep the library up-to-date long into the future, rather than just adding the composer dependency like your patches do, which is super easy to update in the future.
Comment #13
jwilson3Anyone feel free to set back to NW if they feel strongly about implementing tests. I'm good with it as is.
Comment #15
thallesThis looks good to me!
I think good add composer dependencies.
Comment #17
thallesComment #19
playful commentedI tried #10 on 8.4.1 using D8.9.7 and got a WSOD with this error:
Error: Class 'tubalmartin\CssMin\Minifier' not found in Drupal\advagg_css_minify\Asset\CssMinifier->minifyCssMin() (line 110 of /home/forge/mysite.org/web/modules/contrib/advagg/advagg_css_minify/src/Asset/CssMinifier.php)I'm still unable to use the YUI compressor since it doesn't work with Radix. Help appreciated!
Comment #20
rar9 commentedany update for radix?
Comment #21
klemendev commentedAnother reason to update YUI is broken @keyframes support: https://github.com/yui/yuicompressor/issues/275, https://github.com/yui/yuicompressor/issues/195, https://github.com/yui/yuicompressor/issues/80