_mixin.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. $roboto_light: "Roboto-Light";
  2. $file: "Roboto-Light-webfont";
  3. $family: "roboto_light/";
  4. $category: "sans-serif";
  5. @mixin font-face($roboto_light, $file, $family, $category:"") {
  6. $filepath: "../fonts/" + $family + "/" + $file;
  7. @font-face {
  8. font-family: "#{$roboto_light}";
  9. src: url($filepath + ".eot");
  10. src: url($filepath + ".eot?#iefix") format('embedded-opentype'), url($filepath + ".woff") format('woff'), url($filepath + ".ttf") format('truetype'), url($filepath + ".svg#" + $roboto_light + "") format('svg');
  11. }
  12. %#{$roboto_light} {
  13. font: {
  14. @if $category != "" {
  15. family: "#{$roboto_light}", #{$category};
  16. weight: normal;
  17. }
  18. @else {
  19. family: "#{$roboto_light}";
  20. weight: normal;
  21. }
  22. }
  23. }
  24. }
  25. $roboto_regular: "Roboto-regular";
  26. $file2: "Roboto-Regular-webfont";
  27. $family2: "roboto_regular/";
  28. @mixin font-face($roboto_regular, $file2, $family2, $category:"") {
  29. $filepath: "../fonts/" + $family2 + "/" + $file2;
  30. @font-face {
  31. font-family: "#{$roboto_regular}";
  32. src: url($filepath + ".eot");
  33. src: url($filepath + ".eot?#iefix") format('embedded-opentype'), url($filepath + ".woff") format('woff'), url($filepath + ".ttf") format('truetype'), url($filepath + ".svg#" + $roboto_regular + "") format('svg');
  34. }
  35. %#{$roboto_regular} {
  36. font: {
  37. @if $category != "" {
  38. family: "#{$roboto_regular}", #{$category};
  39. weight: normal;
  40. }
  41. @else {
  42. family: "#{$roboto_regular}";
  43. weight: normal;
  44. }
  45. }
  46. }
  47. }
  48. $roboto_medium: "Roboto-Medium";
  49. $file3: "Roboto-Medium-webfont";
  50. $family3: "roboto_medium/";
  51. @mixin font-face($roboto_medium, $file3, $family3, $category:"") {
  52. $filepath: "../fonts/" + $family3 + "/" + $file3;
  53. @font-face {
  54. font-family: "#{$roboto_medium}";
  55. src: url($filepath + ".eot");
  56. src: url($filepath + ".eot?#iefix") format('embedded-opentype'), url($filepath + ".woff") format('woff'), url($filepath + ".ttf") format('truetype'), url($filepath + ".svg#" + $roboto_medium + "") format('svg');
  57. }
  58. %#{$roboto_medium} {
  59. font: {
  60. @if $category != "" {
  61. family: "#{$roboto_medium}", #{$category};
  62. weight: normal;
  63. }
  64. @else {
  65. family: "#{$roboto_medium}";
  66. weight: normal;
  67. }
  68. }
  69. }
  70. }
  71. $roboto_bold: "Roboto-Bold";
  72. $file4: "Roboto-Bold-webfont";
  73. $family4: "roboto_bold/";
  74. @mixin font-face($roboto_bold, $file4, $family4, $category:"") {
  75. $filepath: "../fonts/" + $family4 + "/" + $file4;
  76. @font-face {
  77. font-family: "#{$roboto_bold}";
  78. src: url($filepath + ".eot");
  79. src: url($filepath + ".eot?#iefix") format('embedded-opentype'), url($filepath + ".woff") format('woff'), url($filepath + ".ttf") format('truetype'), url($filepath + ".svg#" + $roboto_bold + "") format('svg');
  80. }
  81. %#{$roboto_bold} {
  82. font: {
  83. @if $category != "" {
  84. family: "#{$roboto_bold}", #{$category};
  85. }
  86. @else {
  87. family: "#{$roboto_bold}";
  88. weight: normal;
  89. }
  90. }
  91. }
  92. }