`calc` with square brackets doesn't work
See original GitHub issueReproduction link
Put the below code in Template
part of https://vueuse-playground.netlify.app
<div class="h-300px dark:text-white bg-gray-400">
<div class="h-[calc(100%+1rem)] bg-red-500">
Text
</div>
</div>
Steps to reproduce
- See in the Preview
- Background doesn’t turn to red
- Inspect in the console
What is expected?
Utility is properly generated.
What is happening?
Utility is not properly generated.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Should a 'Calculator' support '{' (curly braces) and '[' (box braces)
My reason for asking: The pros of the 1st approach (and cons of the 2nd) are: It makes it easier to read the...
Read more >How do you put in brackets in a calculator not ( ) these - Fixya
For curly braces {} use 2ND ( and 2ND ). For square brackets [] use 2ND multiply and 2ND plus.
Read more >PowerToys run calculator not working w/ parentheses #17595
Calculator function to return 1, or evaluate whatever expression that has parentheses to evaluate as you would naturally expect. ❌ Actual ...
Read more >10 Common Errors when Using the TI-84 Plus Calculator
1. If you press [–] instead of [(-)] at the beginning of an entry, the calculator assumes you want to subtract what comes...
Read more >I just used your equation calculator and now I am more ...
three plus two "OPEN SQUARE BRACKET" times ten "OPEN PARENTHESES BRACKET" ... I don't know why that happened, but it really doesn't matter....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Whitespace is required for
+
and-
, but not for*
and/
. But it is recommended to add whitespace for consistency. MDN RefSo I think showing autocompletion for
calc
with_
would solve this issue.It’s interesting, I found that the expression only works if you add spaces to the calc. such as
height: calc(100% + 1rem)
. You can temporarily useh-[calc(100%_+_1rem)]
,_
will be replaced with a space. It’s actually a css bug.