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

calc() not followed by end of line or semicolon not correctly matched #301

Closed
simondud opened this issue Nov 24, 2019 · 0 comments
Closed

Comments

@simondud
Copy link
Collaborator

calc() expressions not followed by end of line or semicolon are matched with the rest of the content on that line until the first semicolon. Sometimes this breaks the calc() expression like in the example below:

Original CSS:

.e-gallery-masonry .e-gallery-item { --percent-height: 0; position:absolute; width:calc(100% / var(--columns) - (var(--hgap) * (var(--columns) - 1) / var(--columns))); left:calc((100% / var(--columns) - (var(--hgap) * (var(--columns) - 1) / var(--columns))) * var(--column) + (var(--hgap) * var(--column))); top:calc(var(--percent-height) + (var(--row) * var(--vgap))) }

Minified CSS:

.e-gallery-masonry .e-gallery-item{--percent-height:0;position:absolute;width:calc(100% / var(--columns) - (var(--hgap) * (var(--columns) - 1) / var(--columns)));left:calc((100% / var(--columns) - (var(--hgap) * (var(--columns) - 1) / var(--columns))) * var(--column) + (var(--hgap) * var(--column)));top:calc(var(--percent-height)+(var(--row) * var(--vgap)))}

The problem is that there are no spaces around the last + (...height)+(var(--row)...)

davidscotson pushed a commit to davidscotson/minify that referenced this issue Mar 22, 2020
It's not clear if both of these are necessary, the second one should
just match everything the first one matches plus things within internal
lines, so it seems redundant.

The unit test commited with it, plus all the others still pass, and
there's no diff in the output on a long test file.
davidscotson pushed a commit to davidscotson/minify that referenced this issue Mar 22, 2020
It's not clear if both of these are necessary, the second one should
just match everything the first one matches plus things within internal
lines, so it seems redundant.

The unit test commited with it, plus all the others still pass, and
there's no diff in the output on a long test file.
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

1 participant