_mixins.scss 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Mixins
  2. // --------------------------
  3. @mixin fa-icon() {
  4. display: inline-block;
  5. font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
  6. font-size: inherit; // can't have font-size inherit on line above, so need to override
  7. text-rendering: auto; // optimizelegibility throws things off #1094
  8. -webkit-font-smoothing: antialiased;
  9. -moz-osx-font-smoothing: grayscale;
  10. }
  11. @mixin fa-icon-rotate($degrees, $rotation) {
  12. -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})";
  13. -webkit-transform: rotate($degrees);
  14. -ms-transform: rotate($degrees);
  15. transform: rotate($degrees);
  16. }
  17. @mixin fa-icon-flip($horiz, $vert, $rotation) {
  18. -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)";
  19. -webkit-transform: scale($horiz, $vert);
  20. -ms-transform: scale($horiz, $vert);
  21. transform: scale($horiz, $vert);
  22. }
  23. // Only display content to screen readers. A la Bootstrap 4.
  24. //
  25. // See: http://a11yproject.com/posts/how-to-hide-content/
  26. @mixin sr-only {
  27. position: absolute;
  28. width: 1px;
  29. height: 1px;
  30. padding: 0;
  31. margin: -1px;
  32. overflow: hidden;
  33. clip: rect(0,0,0,0);
  34. border: 0;
  35. }
  36. // Use in conjunction with .sr-only to only display content when it's focused.
  37. //
  38. // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
  39. //
  40. // Credit: HTML5 Boilerplate
  41. @mixin sr-only-focusable {
  42. &:active,
  43. &:focus {
  44. position: static;
  45. width: auto;
  46. height: auto;
  47. margin: 0;
  48. overflow: visible;
  49. clip: auto;
  50. }
  51. }