Re: [csswg-drafts] [css-values] Iverson bracket functions (#4731)

If bools are an ordinary type (not special syntax used in `if()`), I don't see why `calc(A < B)` shouldn't return a bool. It may not be an exceptionally useful thing to do on its own, but it can be used to parenthesize expressions within `if()`, and it could later be used like `--custom-houdini-func(A < B)`. There are certainly cases where using a bool wouldn't make sense like in `width:` but string doesn't make sense there and they can justly fail.

For strings, to keep things consistent, I guess `^=` and `$=` and friends from the `[]` selector could be used, though that might be a bit hairy fitting it in the grammar with `*=` and the `i`/`s` modifiers. Additional string functions could be added later to make it and other things more convenient.

-- 
GitHub Notification of comment by jimmyfrasche
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4731#issuecomment-583015824 using your GitHub account

Received on Thursday, 6 February 2020 17:25:05 UTC