_direction.scss 670 B

12345678910111213141516171819202122232425262728293031323334353637
  1. @function opposite-direction($dir) {
  2. @if $dir == 'left' {
  3. @return right;
  4. }
  5. @else if $dir == 'right' {
  6. @return left;
  7. }
  8. @else if $dir == 'ltr' {
  9. @return rtl;
  10. }
  11. @else if $dir == 'rtl' {
  12. @return ltr;
  13. }
  14. @else if $dir == 'top' {
  15. @return bottom;
  16. }
  17. @else if $dir == 'bottom' {
  18. @return top;
  19. }
  20. @else {
  21. @warn "#{$dir} is not a direction! Make sure your direction is all lowercase!";
  22. @return false;
  23. }
  24. }
  25. @function named-direction($dir) {
  26. @if $dir == 'ltr' {
  27. @return left;
  28. }
  29. @else if $dir == 'rtl' {
  30. @return right;
  31. }
  32. @else {
  33. @warn "#{$dir} is not a valid HTML direction! Make sure you are using a valid HTML direction";
  34. @return false;
  35. }
  36. }