Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setContainerAlignment(alignment) {
- let x = '';
- let y = '';
- if (alignment.includes('top')) {
- y = 'flex-start';
- } else if (alignment.includes('bottom')) {
- y = 'flex-end';
- } else {
- y = 'center';
- }
- if (alignment.includes('left')) {
- x = 'flex-start';
- } else if (alignment.includes('right')) {
- x = 'flex-end';
- } else {
- x = 'center';
- }
- return {'justify-content': x, 'align-items': y}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement