Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. // ----
  2. // libsass (v3.2.5)
  3. // ----
  4.  
  5. @import "susy";
  6. // Only for testing purpose
  7. $susy: (
  8. columns: 12,
  9. gutters: 1/4,
  10. );
  11.  
  12. ////
  13. /// List collections configuration and mixin
  14. /// @group Objects
  15. ////
  16.  
  17. /// Map with the list-collections default configuration
  18. ///
  19. /// @prop {number} elements-per-row - Number of elements in a row
  20. /// @prop {number} spacing-bottom - Spacing to set the bottom margin
  21. /// @prop {list} ratio - Ratio to set the proportion of the element
  22. /// @prop {number} title-font-size - Font-size for the collection title
  23. /// @prop {number} number-font-size - Font-size for the app number
  24. $list-collection-defaults: (
  25. 'elements-per-row': 2,
  26. 'spacing-bottom': 2,
  27. 'ratio': ( 1, 1 ),
  28. 'title-font-size': 20,
  29. 'number-font-size': 13
  30. );
  31.  
  32. /// Mixin to generate the classes for the different collections lists
  33. /// according to the layout.
  34. ///
  35. /// @param {map} $params - Sass map with the parameters to configure the mixin
  36. /// @example
  37. /// .list-collections {
  38. /// @include list-collections( (
  39. /// 'elements-per-row': 3,
  40. /// 'spacing-bottom': 3,
  41. /// 'title-font-size': 24,
  42. /// 'number-font-size': 15
  43. /// )
  44. /// );
  45. /// }
  46. ///
  47. @mixin list-collections( $params: (), $defaults: $list-collection-defaults ) {
  48. $columns: susy-get( columns );
  49. $config: map-merge( $defaults, $params );
  50. $elements-per-row: map-get( $config, 'elements-per-row' );
  51. $spacing-bottom: map-get( $config, 'spacing-bottom' );
  52. $ratio: map-get( $config, 'ratio');
  53. $title-font-size: map-get( $config, 'title-font-size' );
  54. $number-font-size: map-get( $config, 'number-font-size' );
  55. $size: $columns / $elements-per-row;
  56. $container-ratio: nth( $ratio, 2 ) / nth( $ratio, 1 );
  57.  
  58. & {
  59. display: block;
  60. // Mixin real content
  61. }
  62. //Test classes
  63. .cols {
  64. content: $elements-per-row;
  65. }
  66. .col-size {
  67. content: $size;
  68. }
  69. .proportion {
  70. content: $container-ratio;
  71. }
  72. .title {
  73. font-size: $title-font-size+"px";
  74. }
  75. .number {
  76. font-size: $number-font-size+"px";
  77. }
  78. }
  79.  
  80.  
  81. // List collection default
  82. .list-collections {
  83. @include list-collections;
  84. }
  85.  
  86. // List collection wide
  87. .list-collections-wide {
  88. @include list-collections( (
  89. 'elements-per-row': 3,
  90. 'spacing-bottom': 3,
  91. 'ratio': ( 2, 1 ),
  92. 'title-font-size': 24,
  93. 'number-font-size': 16
  94. ) );
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement