How to handle Maths
See original GitHub issue- We decided on strict maths going forward but there is general unease about forcing () around every calculation
- I don’t think we want to change things massively or go back to the drawing board
See #1872
Possibility to add another case for calc which like font, with strict mode off, essentially turns strict mode on for a rule ? Too many exceptions in the future?
@seven-phases-max :
Well, there’re a lot of other possibilities, e.g. ./
or require parens for division (e.g. 1/2
->1/2
but (1/2)
->0.5
) etc…
Also, the “special cases” (e.g. properties where x/y
can appear as shorthand) are not so rare (starting at padding
/margin
and ending with background
/border-radius
and eventually there can be more) so we just can’t hardcode them all like it’s done for font
(and because of that I think that the current font “workaround” is just a temporary and quite dirty kludge that ideally should be removed too).
Issue Analytics
- State:
- Created 10 years ago
- Comments:102 (87 by maintainers)
Top Results From Across the Web
How to Learn Math Fast: Smart Study Tips for Students
1. Use real-world, concrete examples ... Math solutions can be very abstract, which makes them difficult to remember and understand. One of the ......
Read more >14 Ways to Study Math - wikiHow
1. Work through extra practice problems, as well. Your teacher assigns a certain number of problems for homework, but if you don’t feel...
Read more >6 Ways to Help Students Understand Math - Edutopia
1. Create an effective class opener. · 2. Introduce topics using multiple representations. · 3. Solve the problems many ways. · 4. Show...
Read more >How to Study Math in College | Department of Mathematics
Homework · Get the assignment accurately off the blackboard. · Follow the directions. · Work neatly and accurately. · Show your complete work,...
Read more >6 Effective Tips to Study Maths - Jagran Josh
Practice as much as you can. Maths is a hands on subject. · Start by solving examples. Don't start by solving complex problems....
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 FreeTop 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
Top GitHub Comments
That’s a brilliant solution without resorting to a different operator. If the expression is possibly valid CSS, leave it.
Disagree. It’s a simple set of rules, no different from any other sets of (crazy or not) rules you need to remember.
There are a few edge-cases where maths does occur without meaning to, but then you’ll just apply parentheses and you’re done.
To simplify / restate the proposal - Math changes would be as follows
1px + 2px = 3px
,1px + 1vh = 1px + 1vh
10px/2 = 5px
,10px/5px = 10px/5px
1/3 = 1/3
1px + 2vh / 2 = 1px + 2vh / 2
This proposal solves the following (from this thread):
font: 10px/5px
and similar (ratio) syntax (no calculation)calc(100vh - 30px)
(no calculation)lost-column: 1/3
and similar custom ratio syntax (no calculation)At the same time, these changes would preserve 99% of typical Less math usage. As well, the existing
unit()
andconvert()
functions allow users to cast values into compatible units for math.