_mixins.scss 1.6 KB

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