Advertisement
Guest User

SCSS padding functions

a guest
Nov 17th, 2015
111
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @function padding-top($padding){
  2.   @return nth($padding, 1);
  3. }
  4.  
  5. @function padding-right($padding){
  6.   @if length($padding) == 1 {
  7.     @return nth($padding, 1);
  8.   } @else {
  9.     @return nth($padding, 2);
  10.   }
  11. }
  12.  
  13. @function padding-bottom($padding){
  14.   @if length($padding) == 1 {
  15.     @return $padding;
  16.   } @elseif length($padding) == 2 {
  17.     @return nth($padding, 1);
  18.   } @else {
  19.     @return nth($padding, 3);
  20.   }
  21. }
  22.  
  23. @function padding-left($padding){
  24.   @if length($padding) == 1 {
  25.     @return nth($padding, 1);
  26.   } @elseif length($padding) == 2 or length($padding) == 3 {
  27.     @return nth($padding, 2);
  28.   } @else {
  29.     @return nth($padding, 4);
  30.   }
  31. }
Advertisement
RAW Paste Data Copied
Advertisement