_objects.media.scss 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /* ==========================================================================
  2. #MEDIA
  3. ========================================================================== */
  4. /**
  5. * Place any image- and text-like content side-by-side, as per:
  6. * http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code
  7. */
  8. .o-media {
  9. @include inuit-clearfix();
  10. display: block;
  11. }
  12. .o-media__img {
  13. float: left;
  14. margin-right: $inuit-global-spacing-unit;
  15. > img {
  16. display: block;
  17. }
  18. }
  19. .o-media__body {
  20. overflow: hidden;
  21. display: block;
  22. &,
  23. > :last-child {
  24. margin-bottom: 0;
  25. }
  26. }
  27. /* Size variants
  28. ========================================================================== */
  29. /**
  30. * Modify the amount of space between our image and our text. We also have
  31. * reversible options for all available sizes.
  32. */
  33. .o-media--flush {
  34. > .o-media__img {
  35. margin-right: 0;
  36. margin-left: 0;
  37. }
  38. }
  39. .o-media--tiny {
  40. > .o-media__img {
  41. margin-right: $inuit-global-spacing-unit-tiny;
  42. }
  43. &.o-media--reverse {
  44. > .o-media__img {
  45. margin-right: 0;
  46. margin-left: $inuit-global-spacing-unit-tiny;
  47. }
  48. }
  49. }
  50. .o-media--small {
  51. > .o-media__img {
  52. margin-right: $inuit-global-spacing-unit-small;
  53. }
  54. &.o-media--reverse {
  55. > .o-media__img {
  56. margin-right: 0;
  57. margin-left: $inuit-global-spacing-unit-small;
  58. }
  59. }
  60. }
  61. .o-media--large {
  62. > .o-media__img {
  63. margin-right: $inuit-global-spacing-unit-large;
  64. }
  65. &.o-media--reverse {
  66. > .o-media__img {
  67. margin-right: 0;
  68. margin-left: $inuit-global-spacing-unit-large;
  69. }
  70. }
  71. }
  72. .o-media--huge {
  73. > .o-media__img {
  74. margin-right: $inuit-global-spacing-unit-huge;
  75. }
  76. &.o-media--reverse {
  77. > .o-media__img {
  78. margin-right: 0;
  79. margin-left: $inuit-global-spacing-unit-huge;
  80. }
  81. }
  82. }
  83. /* Reversed media objects
  84. ========================================================================== */
  85. .o-media--reverse {
  86. > .o-media__img {
  87. float: right;
  88. margin-right: 0;
  89. margin-left: $inuit-global-spacing-unit;
  90. }
  91. }