Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Minify: Removal of percentage sign breaks gallery block #1020

Open
bndn opened this issue Dec 22, 2024 · 2 comments
Open

CSS Minify: Removal of percentage sign breaks gallery block #1020

bndn opened this issue Dec 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@bndn
Copy link

bndn commented Dec 22, 2024

My gallery block works great when I’m logged in, but it’s broken for visitors which load minified CSS.

W3 Total Cache CSS Minifier remove a percentage sign from the CSS flex property of an image block in the gallery block.

When CSS is not minified:

# /wp-includes/blocks/gallery/style.min.css
.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) a, .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
  flex: 1 0 0%;
  …

When CSS is minified:

.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) a, .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
  flex: 1 0 0;
  …

But flex-basis have a different behaviour with 0% and 0px.

@cssjoe cssjoe added the bug Something isn't working label Jan 23, 2025
@jacobd91
Copy link
Contributor

@bndn

I have been unable to replicate this issue under the latest version of W3 Total Cache (2.8.4) using only the Minify module with the Disk Enhanced engine selected

Could you please provide more details pertaining to your configuration?

Specifically

  • W3 Total Cache version
  • Other modules active and configured (Page Cache, DB Cache, etc)
  • All of the minify.* lines from your master.php configuration file

@bndn
Copy link
Author

bndn commented Feb 7, 2025

@jacobd91

I just realized that this problem happens only with the CSS Tidy minifier, but not with default Minify minifier.

I can switch back to Minify since an another bug with calc() et white spaces have been fixed a long time ago and is now included in W3 Total Cache.

mrclay/minify#560
tubalmartin/YUI-CSS-compressor-PHP-port#22

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants