Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. /* Start with a LESS list. */
  2. @griditems: 5, 10, 20, 25, 30, 33.33, 40, 50, 60, 66.66, 70, 75, 80, 90, 95, 100;
  3.  
  4. /* Start Declaration - optional - Loop can be inside or outside. */
  5. .grid-flex
  6. {
  7. display: flex;
  8. flex-wrap: wrap;
  9.  
  10. .grid-item
  11. {
  12. flex-grow: 1;
  13. }
  14.  
  15. /*
  16. length - Gets the length of the LESS List.
  17. extract - Gets a value from the LESS List.
  18. floor - MAth Floor function.
  19. percentage - LESS Percentage function
  20. */
  21.  
  22. .griditems(@i: length(@griditems)) when (@i > 0)
  23. {
  24. .griditems(@i - 1);
  25.  
  26. @griditem: extract(@griditems, @i);
  27.  
  28. @classname: floor(@griditem);
  29.  
  30. .grid-item-@{classname}
  31. {
  32. min-width: percentage(@griditem * 0.01);
  33. }
  34.  
  35. .grid-flex-@{classname}
  36. {
  37. .grid-item
  38. {
  39. min-width: percentage(@griditem * 0.01);
  40. }
  41. }
  42. }
  43.  
  44. .griditems();
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement