_hover.scss 985 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. @mixin hover {
  2. @if $enable-hover-media-query {
  3. // See Media Queries Level 4: http://drafts.csswg.org/mediaqueries/#hover
  4. // Currently shimmed by https://github.com/twbs/mq4-hover-shim
  5. @media (hover: hover) {
  6. &:hover {
  7. @content;
  8. }
  9. }
  10. } @else {
  11. &:hover {
  12. @content;
  13. }
  14. }
  15. }
  16. @mixin hover-focus {
  17. @if $enable-hover-media-query {
  18. &:focus {
  19. @content;
  20. }
  21. @include hover {
  22. @content;
  23. }
  24. } @else {
  25. &:focus,
  26. &:hover {
  27. @content;
  28. }
  29. }
  30. }
  31. @mixin plain-hover-focus {
  32. @if $enable-hover-media-query {
  33. &,
  34. &:focus {
  35. @content;
  36. }
  37. @include hover {
  38. @content;
  39. }
  40. } @else {
  41. &,
  42. &:focus,
  43. &:hover {
  44. @content;
  45. }
  46. }
  47. }
  48. @mixin hover-focus-active {
  49. @if $enable-hover-media-query {
  50. &:focus,
  51. &:active {
  52. @content;
  53. }
  54. @include hover {
  55. @content;
  56. }
  57. } @else {
  58. &:focus,
  59. &:active,
  60. &:hover {
  61. @content;
  62. }
  63. }
  64. }