Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. // ----
  2. // libsass (v3.2.5)
  3. // ----
  4.  
  5. // Foundation by ZURB
  6. // foundation.zurb.com
  7. // Licensed under MIT Open Source
  8.  
  9. // This is the default html and body font-size for the base rem value.
  10. $rem-base: 16px !default;
  11.  
  12. // IMPORT ONCE
  13. // We use this to prevent styles from being loaded multiple times for components that rely on other components.
  14. $modules: () !default;
  15.  
  16. @mixin exports($name) {
  17. // Import from global scope
  18. $modules: $modules !global;
  19. // Check if a module is already on the list
  20. $module_index: index($modules, $name);
  21. @if (($module_index == null) or ($module_index == false)) {
  22. $modules: append($modules, $name) !global;
  23. @content;
  24. }
  25. }
  26.  
  27. //
  28. // @functions
  29. //
  30.  
  31.  
  32. // RANGES
  33. // We use these functions to define ranges for various things, like media queries.
  34. @function lower-bound($range) {
  35. @if length($range) <= 0 {
  36. @return 0;
  37. }
  38. @return nth($range, 1);
  39. }
  40.  
  41. @function upper-bound($range) {
  42. @if length($range) < 2 {
  43. @return 999999999999;
  44. }
  45. @return nth($range, 2);
  46. }
  47.  
  48. // STRIP UNIT
  49. // It strips the unit of measure and returns it
  50. @function strip-unit($num) {
  51. @return $num / ($num * 0 + 1);
  52. }
  53.  
  54. // TEXT INPUT TYPES
  55.  
  56. @function text-inputs( $types: all, $selector: input ) {
  57.  
  58. $return: ();
  59.  
  60. $all-text-input-types:
  61. text
  62. password
  63. date
  64. datetime
  65. datetime-local
  66. month
  67. week
  68. email
  69. number
  70. search
  71. tel
  72. time
  73. url
  74. color
  75. textarea;
  76.  
  77. @if $types == all { $types: $all-text-input-types; }
  78.  
  79. @each $type in $types {
  80. @if $type == textarea {
  81. @if $selector == input {
  82. $return: append($return, unquote('#{$type}'), comma)
  83. } @else {
  84. $return: append($return, unquote('#{$type}#{$selector}'), comma)
  85. }
  86. } @else {
  87. $return: append($return, unquote('#{$selector}[type="#{$type}"]'), comma)
  88. }
  89. }
  90.  
  91. @return $return;
  92.  
  93. }
  94.  
  95. // CONVERT TO REM
  96. @function convert-to-rem($value, $base-value: $rem-base) {
  97. $value: strip-unit($value) / strip-unit($base-value) * 1rem;
  98. @if ($value == 0rem) { $value: 0; } // Turn 0rem into 0
  99. @return $value;
  100. }
  101.  
  102. @function data($attr) {
  103. @if $namespace {
  104. @return '[data-' + $namespace + '-' + $attr + ']';
  105. }
  106.  
  107. @return '[data-' + $attr + ']';
  108. }
  109.  
  110. // REM CALC
  111.  
  112. // New Syntax, allows to optionally calculate on a different base value to counter compounding effect of rem's.
  113. // Call with 1, 2, 3 or 4 parameters, 'px' is not required but supported:
  114. //
  115. // rem-calc(10 20 30px 40);
  116. //
  117. // Space delimited, if you want to delimit using comma's, wrap it in another pair of brackets
  118. //
  119. // rem-calc((10, 20, 30, 40px));
  120. //
  121. // Optionally call with a different base (eg: 8px) to calculate rem.
  122. //
  123. // rem-calc(16px 32px 48px, 8px);
  124. //
  125. // If you require to comma separate your list
  126. //
  127. // rem-calc((16px, 32px, 48), 8px);
  128.  
  129. @function rem-calc($values, $base-value: $rem-base) {
  130. $max: length($values);
  131.  
  132. @if $max == 1 { @return convert-to-rem(nth($values, 1), $base-value); }
  133.  
  134. $remValues: ();
  135. @for $i from 1 through $max {
  136. $remValues: append($remValues, convert-to-rem(nth($values, $i), $base-value));
  137. }
  138. @return $remValues;
  139. }
  140.  
  141.  
  142. @function em-calc($values) {
  143. $remValues: rem-calc($values);
  144.  
  145. $max: length($remValues);
  146.  
  147. @if $max == 1 { @return strip-unit(nth($remValues, 1)) * 1em; }
  148.  
  149. $emValues: ();
  150. @for $i from 1 through $max {
  151. $emValues: append($emValues, strip-unit(nth($remValues, $i)) * 1em);
  152. }
  153. @return $emValues;
  154. }
  155.  
  156.  
  157. // Deprecated: OLD EM CALC
  158. @function emCalc($values) {
  159. @return em-calc($values);
  160. }
  161. $small-breakpoint: em-calc(580);
  162. $medium-breakpoint: em-calc(1024);
  163. $large-breakpoint: em-calc(1280);
  164. $xlarge-breakpoint: em-calc(1920);
  165. .cls{
  166. width: $small-breakpoint;
  167. height: $medium-breakpoint;
  168. margin: $large-breakpoint ;
  169. padding: $xlarge-breakpoint;
  170.  
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement