Convert dp to pt then rem
- #CSS
- #SCSS
- #Sass
Convert dp to pt then rem
SCSS function to convert Density-independent Pixels(dp) to Points(pt) then to The root elements font-size(rem).
Filename: some-file.scss
/* Formula to convert dp to pt and then rem
* pt = (72/160)*dp
*/ rem = pt * 0.083333396325467
@function dp2Rem($_dp) {
@return ((72 / 160) * $_dp) * 0.083333396325467 + rem;
}
0 Comments
Sign in to join the conversation.