aboutsummaryrefslogtreecommitdiffstats
path: root/src/less/components/control.less
blob: 48b73e0f2f07ca3c416e69fb8f61c24da0482ae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// --------------------------------------------------------------
// Control buttons
// --------------------------------------------------------------

.plyr__control {
    position: relative;
    flex-shrink: 0;
    overflow: visible; // IE11
    padding: @plyr-control-padding;
    border: 0;
    background: transparent;
    border-radius: @plyr-control-radius;
    cursor: pointer;
    transition: all 0.3s ease;
    color: inherit;

    svg {
        width: @plyr-control-icon-size;
        height: @plyr-control-icon-size;
        display: block;
        fill: currentColor;
        pointer-events: none;
    }

    // Default focus
    &:focus {
        outline: 0;
    }

    // Tab focus
    &.plyr__tab-focus {
        .plyr-tab-focus();
    }
}

// Change icons on state change
.plyr__control[aria-pressed='false'] .icon--pressed,
.plyr__control[aria-pressed='true'] .icon--not-pressed,
.plyr__control[aria-pressed='false'] .label--pressed,
.plyr__control[aria-pressed='true'] .label--not-pressed {
    display: none;
}

// Audio styles
.plyr--audio .plyr__control {
    &.plyr__tab-focus,
    &:hover,
    &[aria-expanded='true'] {
        background: @plyr-audio-control-bg-hover;
        color: @plyr-audio-control-color-hover;
    }
}

// Large play button (video only)
.plyr__control--overlaid {
    display: none;
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: ceil(@plyr-control-spacing * 1.5);
    background: fade(@plyr-video-control-bg-hover, 80%);
    border: 0;
    border-radius: 100%;
    box-shadow: 0 1px 1px fade(#000, 15%);
    color: @plyr-video-control-color;

    svg {
        position: relative;
        left: 2px; // Offset to make the play button look right
        width: @plyr-control-icon-size-large;
        height: @plyr-control-icon-size-large;
    }

    &:hover,
    &:focus {
        background: @plyr-video-control-bg-hover;
    }
}

.plyr--full-ui.plyr--video .plyr__control--overlaid {
    display: block;
}

.plyr--playing .plyr__control--overlaid {
    opacity: 0;
    visibility: hidden;
}