-
Notifications
You must be signed in to change notification settings - Fork 33
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
Allow rounding option #62
Comments
/cc @MartijnCuppens problem still exists, can you provide codepen where |
I guess this is what you are looking for: https://codepen.io/MartijnCuppens/pen/rREmxN?editors=1010 (For some resolutions the buttons do have the same width, but in many cases they don't) |
hm looks like we potentially can break code |
I think we need new option for this, also i think we should don't round |
#61 was about adding an option which can be disabled to keep calc when the rounded version is not the same as the original value. So by default it would have been the same. |
@MartijnCuppens 👍 Can you send a PR again? For next major version we set |
@evilebottnawi You can reopen the PR. |
@XhmikosR still need rebase |
That is something @MartijnCuppens can do after you reopen it. |
It's now rebased |
@MartijnCuppens What do you think about disable round by default as i describe above in next major? |
@evilebottnawi, the |
@MartijnCuppens Maybe we can do better:
? |
|
This option allows users to limit the default precision to what's defined in
precision
, but doesn't round the number if the rounded number isn't equal to the number itself. This may sound a bit vague, so let's demonstrate this with an example:Let's assume you have configured
precision: 5
andallowRounding: false
:calc(100% / 3)
will outputcalc(100% / 3)
becausecalc(100% / 3) != 33.33333%
calc(100% / 4)
will output25%
becausecalc(100% / 4) == 25%
What's the advantage? We never have rounded numbers which can cause issues like twbs/bootstrap#27374 and we don't have expressions like
calc(100% / 4)
that can be simplified.PR: #61
The text was updated successfully, but these errors were encountered: