_hover.scss 976 Bytes
Newer Older
1
@mixin hover {
2
3
  // TODO: re-enable along with mq4-hover-shim
//  @if $enable-hover-media-query {
4
//    // See Media Queries Level 4: https://drafts.csswg.org/mediaqueries/#hover
5
6
7
8
9
10
//    // Currently shimmed by https://github.com/twbs/mq4-hover-shim
//    @media (hover: hover) {
//      &:hover { @content }
//    }
//  }
//  @else {
11
  &:hover { @content }
12
//  }
13
14
15
}

@mixin hover-focus {
16
  @if $enable-hover-media-query {
17
18
    &:focus { @content }
    @include hover { @content }
19
  } @else {
20
21
22
23
24
    &:focus,
    &:hover {
      @content
    }
  }
25
26
27
}

@mixin plain-hover-focus {
28
  @if $enable-hover-media-query {
29
30
31
32
33
    &,
    &:focus {
      @content
    }
    @include hover { @content }
34
  } @else {
35
36
37
38
39
    &,
    &:focus,
    &:hover {
      @content
    }
40
41
42
43
  }
}

@mixin hover-focus-active {
44
  @if $enable-hover-media-query {
45
46
47
48
49
    &:focus,
    &:active {
      @content
    }
    @include hover { @content }
50
  } @else {
51
52
53
54
55
    &:focus,
    &:active,
    &:hover {
      @content
    }
56
57
  }
}