SHARE
TWEET

set container alignment

loggerer May 27th, 2019 (edited) 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       function setContainerAlignment(alignment) {
  2.         let x = '';
  3.         let y = '';
  4.         if (alignment.includes('top')) {
  5.           y = 'flex-start';
  6.         } else if (alignment.includes('bottom')) {
  7.           y = 'flex-end';
  8.         } else {
  9.           y = 'center';
  10.         }
  11.         if (alignment.includes('left')) {
  12.           x = 'flex-start';
  13.         } else if (alignment.includes('right')) {
  14.           x = 'flex-end';
  15.         } else {
  16.           x = 'center';
  17.         }
  18.         return {'justify-content': x, 'align-items': y}
  19.       }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top