Skip to content
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

rem to 2 decimal places #7

Open
freakyleaf opened this issue Feb 2, 2015 · 1 comment
Open

rem to 2 decimal places #7

freakyleaf opened this issue Feb 2, 2015 · 1 comment

Comments

@freakyleaf
Copy link

Have started accommodating half pixel values for high DPI screens, and found that pxtorem currently only outputs to 1 decimal place...

Changed @pxtorem-js-function to the following to allow 2 decimal place calculations... Not tested exhaustively though...

@pxtorem-js-function: ~`pxtorem = function(px){ if (typeof rmxsBaseFontSize == 'undefined')  rmxsBaseFontSize = @{base-font-size-px}; return (parseFloat(px.replace(/(^\d+)(\.\d{1,2})?$(.+$)/i,'$1')) / rmxsBaseFontSize + 'rem') }`;
@christopher-ramirez
Copy link
Owner

Thanks for your contribution @freakyleaf. Would you please provide a pull request with your changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants