mixins.less 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Mixins
  2. // --------------------------
  3. .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. .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. .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. .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. .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. }