_objects.pack.scss 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* ==========================================================================
  2. #PACK
  3. ========================================================================== */
  4. /**
  5. * The pack object simply causes any number of elements pack up horizontally to
  6. * automatically fill an equal, fluid width of their parent.
  7. *
  8. * 1. Fill all available space.
  9. * 2. Remove any leftover styling from lists.
  10. * 3. Cause children to be automatically equally sized.
  11. */
  12. .o-pack {
  13. width: 100%; /* [1] */
  14. margin-left: 0; /* [2] */
  15. display: table;
  16. table-layout: fixed; /* [3] */
  17. }
  18. /**
  19. * 1. Cause children to adopt table-like structure.
  20. * 2. Default item alignment is with the tops of each other.
  21. */
  22. .o-pack__item {
  23. display: table-cell; /* [1] */
  24. vertical-align: top; /* [2] */
  25. /* Vertical alignment variants
  26. ====================================================================== */
  27. .o-pack--middle > & {
  28. vertical-align: middle;
  29. }
  30. .o-pack--bottom > & {
  31. vertical-align: bottom;
  32. }
  33. }
  34. /* Unequal-width items
  35. ========================================================================== */
  36. .o-pack--auto {
  37. table-layout: auto;
  38. }
  39. /* Size variants
  40. ========================================================================== */
  41. .o-pack--tiny {
  42. border-spacing: $inuit-global-spacing-unit-tiny;
  43. }
  44. .o-pack--small {
  45. border-spacing: $inuit-global-spacing-unit-small;
  46. }
  47. .o-pack--default {
  48. border-spacing: $inuit-global-spacing-unit;
  49. }
  50. .o-pack--large {
  51. border-spacing: $inuit-global-spacing-unit-large;
  52. }
  53. .o-pack--huge {
  54. border-spacing: $inuit-global-spacing-unit-huge;
  55. }
  56. /* Reversed order packs
  57. ========================================================================== */
  58. .o-pack--reverse {
  59. direction: rtl;
  60. > .o-pack__item {
  61. direction: ltr;
  62. }
  63. }