-
-
Notifications
You must be signed in to change notification settings - Fork 878
Add decimal support to Modular Scale #717
Comments
So this would make it possible to do things like: But doesn’t this defeat the purpose of the If you increment up or down the scale in non-whole steps, the values returned can no longer be traced to a specific point in the scale and the relationship between values is lost. |
This discussion goes in depth on sass/sass#684 I think the whole concept of the responsive design is that it's scalable to any degree and not limited to specific break points. There are cases when people will choose to keep it simple, they can still use whole numbers. In my case, the design team wanted developers to scale paragraph text from Not sure if I understood you correctly on the last part. I believe the values should still be traceable. If you set the child to |
The issue you link to above is a discussion around adding math functions to Sass, not using decimals in a As for your example use case above: I don’t think this is proper use of the It’s worth noting that you can change the base value and the ratio/scale that the |
Apologies, I didn't explain my example right :) If I understand correctly, the purpose of Say the default settings are: The design team wants In this case, scaling a whole number will make text too small, and setting |
The One major thing to note is that the If I’m correctly understanding your example above, I don’t see why a decimal value would be necessary. Can it not be something like this: .aside-content {
font-size: modular-scale(-1);
}
.main-content {
font-size: modular-scale(0);
} Is the issue with the above simply that stepping down You can also use a double stranded scale, which would provide you with more values by jumping between two ratios, rather than one. All of this is in the docs. The whole purpose of the |
I'm unable to change the ratio globally, since it will impact larger texts, i.e. |
Here's a messy demonstration showing one example how it can be done. Replace the existing
modular_scale()
function with:This will allow you to scale by decimal values, such as
modular_scale(1.2)
.This script is based on https://gist.github.com/davidkpiano/ad6e6771df050ff3727f
To see SASS progress on exponents: sass/sass#684
The text was updated successfully, but these errors were encountered: