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 Invalid #419

Open
m-O-rpheus opened this issue Aug 5, 2024 · 2 comments
Open

CSS Invalid #419

m-O-rpheus opened this issue Aug 5, 2024 · 2 comments

Comments

@m-O-rpheus
Copy link

Unfortunately, with the current version 3.1.12, the CSS becomes invalid due to Autoptimize, especially when combined with CSS nesting.

.container {
	& .parent {
		scroll-padding: 0px max((((100% - var(--wrapper-big)) / 2) + var(--wrapper-padding)), var(--wrapper-padding));

		& .item + .item {
			margin-left: var(--wrapper-padding);
		}
	}
}
Screen2

In the example, which contains the Adjacent sibling combinator ".item + .item", the spaces around the + inside the calc (max) are removed. This makes the CSS invalid and it does not work.

@m-O-rpheus m-O-rpheus changed the title CSS Ungültig CSS Invalid Aug 5, 2024
@futtta
Copy link
Owner

futtta commented Aug 11, 2024

thanks for reporting @m-O-rpheus ! i'm afraid I don't have an easy fix; AO uses https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port to do minification which seems pretty abandoned at the moment and I have no been able to find the changes that would be needed to avoid spaces being removed in this use case.

As a temporary workaround you can exclude said file from being minfied OR you can minify it on your end and make sure the filename reflects the fact it has been minified already by ensuring it has min in it e.g. myfile.min.css or myfile-min.css.

on my end I might end up switching to a different minifier (e.g. https://github.com/matthiasmullie/minify/) but all come with their own set of sometimes obscure bugs .. :-/

@futtta
Copy link
Owner

futtta commented Oct 2, 2024

I might have a solution (workaround) @m-O-rpheus , would you have time to test ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants