Lightweight CSS Framework for Building Apps and Websites https://crispy-css.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
481 B

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. /**
  2. * functions to convert px to em and rem
  3. *
  4. *
  5. * @author Björn Hase
  6. *
  7. */
  8. $base__font-size: 16px !default;
  9. /**
  10. * calculate pixel value to em
  11. *
  12. * @param {px} $fontSize
  13. * @return {em}
  14. */
  15. @function pxToEm($font-size) {
  16. @return ($font-size / $base__font-size) * 1em;
  17. }
  18. /**
  19. * calculate px value to rem
  20. *
  21. * @param {px} $fonz-size
  22. * @param {px} $font-size
  23. * @return {em}
  24. */
  25. @function pxToRem($font-size) {
  26. @return ($font-size / $base__font-size) * 1rem;
  27. }