Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. // ----
  2. // libsass (v3.3.2)
  3. // ----
  4.  
  5. $small : 400px;
  6. $medium: 600px;
  7. $bigscreen: 800px;
  8.  
  9. $kicker-font: (
  10. font-family : Arial,
  11. font-weight : 900,
  12. color : black,
  13. size-map : (
  14. null : 12px,
  15. $small : 15px,
  16. $medium : (16px, 1.3)
  17. ),
  18. fallback-size-map : (
  19. null : 14px,
  20. $small : 16px,
  21. $bigscreen : (18px, 2)
  22. )
  23. );
  24.  
  25. @mixin getFont($font-map) {
  26. @if map-has-key($font-map, font-family) {
  27. font-family : map-get($font-map, font-family);
  28. }
  29. @if map-has-key($font-map, font-weight) {
  30. font-weight : map-get($font-map, font-weight);
  31. }
  32. @if map-has-key($font-map, color) {
  33. color : map-get($font-map, color);
  34. }
  35. @if map-has-key($font-map, size-map) {
  36. $fs-map : map-get($font-map, size-map);
  37.  
  38. @each $breakpoint, $size-props in $fs-map {
  39. @if $breakpoint == null {
  40. @include makeFontSize($size-props);
  41. }
  42. @else {
  43. @media screen and (min-width: $breakpoint) {
  44. @include makeFontSize($size-props);
  45. }
  46. }
  47. }
  48. }
  49.  
  50. @if map_has_key($font-map, fallback-size-map) {
  51. $fbs-map : map-get($font-map, fallback-size-map);
  52.  
  53. @each $breakpoint, $size-props in $fbs-map {
  54. @if $breakpoint == null {
  55. @include makeFallbackFontSize($size-props);
  56. }
  57. @else {
  58. @media screen and (min-width: $breakpoint) {
  59. @include makeFallbackFontSize($size-props);
  60. }
  61. }
  62. }
  63. }
  64. }
  65.  
  66. @mixin makeFontSize($size-props) {
  67. @if type-of($size-props) == "list" {
  68. .fonts-loaded & {
  69. font-size: nth($size-props, 1);
  70. }
  71. @if (length($size-props) > 1) {
  72. .fonts-loaded & {
  73. line-height: nth($size-props, 2);
  74. }
  75. }
  76. }
  77. @else {
  78. .fonts-loaded & {
  79. font-size: $size-props;
  80. }
  81. }
  82. }
  83.  
  84. @mixin makeFallbackFontSize($size-props) {
  85. @if type-of($size-props) == "list" {
  86. font-size: nth($size-props, 1);
  87. @if (length($size-props) > 1) {
  88. line-height: nth($size-props, 2);
  89. }
  90. }
  91. @else {
  92. font-size: $size-props;
  93. }
  94. }
  95.  
  96. .kicker{
  97. @include getFont($kicker-font);
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement