-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
Constant CSS values being sanitized #131
Comments
Thanks for looking into this, I was able to reproduce the issue easily thanks to your great report. This is a bug - I can't see a reason why a constant value coming from a developer would be sanitized. It looks like I was overzealous when I added CSS property sanitization to the system, or decided to use the existing sanitization function instead of printing the value, and the existing test suite didn't happen to contain a value that triggered the sanitization, and I didn't use any CSS expressions in my own work with templ so far so you found it first! |
Hey there, thanks for making this great tool!
Playing with porting over some react code and noticed an inconsistency between the docs and CSS generation behaviour. The docs state "Within css blocks, property names, and constant CSS property values are not sanitized or escaped."
But given a CSS expression like
templ generates
Which suggests the
max-height
value is being sent throughsafehtml.SanitizeCSS
which rejects CSS functions. Is this expected behaviour? Is there a preferred alternative way to express this? I feel I must be overlooking something.The text was updated successfully, but these errors were encountered: