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

Complex media queries and pretty-print? false #168

Closed
roosta opened this issue Dec 30, 2018 · 2 comments · Fixed by #173
Closed

Complex media queries and pretty-print? false #168

roosta opened this issue Dec 30, 2018 · 2 comments · Fixed by #173

Comments

@roosta
Copy link
Collaborator

roosta commented Dec 30, 2018

First of thanks for making Garden, its been my goto CSS library for a long time . That said I think I located a bug with pretty print and media queries. A query like this for example:

(css {:pretty-print? false} (at-media {:screen :only :min-width "32em"} [:.some-class {:width "33rem"}]))

produces this CSS:

@media only screen and(min-width:32em){.some-class{width:33rem}}

The media query is not applied due to missing whitespace after and.

@roosta
Copy link
Collaborator Author

roosta commented Jan 2, 2019

Forgot to mention my env is cljs. Found this regexp in compression.cljc
:r-paren #"^\s*\(\s*", seems it gobbles up whitespace before a literal paren
match. I also see that there is a :space+ regexp that seems to match literal
space? Maybe there's a way to have the space after and detected as :space+?

@noprompt
Copy link
Owner

Thanks for the bug report and having a look into possible solutions. It’s been a while since I’ve worked with that code and I’ll take a look into the issue. You’re proposed solution seems like it’s on the right track though.

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