aboutsummaryrefslogtreecommitdiffstats
path: root/src/less/components/menus.less
blob: f0a92d067548f24e89f283022e7870da557b7167 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// --------------------------------------------------------------
// Menus
// --------------------------------------------------------------

.plyr__menu {
    display: flex; // Edge fix
    position: relative;

    // Animate the icon
    .plyr__control svg {
        transition: transform 0.3s ease;
    }
    .plyr__control[aria-expanded='true'] {
        svg {
            transform: rotate(90deg);
        }

        // Hide tooltip
        .plyr__tooltip {
            display: none;
        }
    }

    // The actual menu container
    &__container {
        position: absolute;
        z-index: 1;
        bottom: 100%;
        right: -3px;
        margin-bottom: 10px;
        animation: plyr-popup 0.2s ease;
        background: @plyr-menu-bg;
        border-radius: 4px;
        box-shadow: @plyr-menu-shadow;
        white-space: nowrap;
        text-align: left;
        color: @plyr-menu-color;
        font-size: @plyr-font-size-base;

        > div {
            overflow: hidden;
            transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        }

        // Arrow
        &::after {
            content: '';
            position: absolute;
            top: 100%;
            right: 15px;
            height: 0;
            width: 0;
            border: 4px solid transparent;
            border-top-color: @plyr-menu-bg;
        }

        ul {
            margin: 0;
            padding: @plyr-control-padding;
            list-style: none;
            overflow: hidden;
        }

        // Options
        .plyr__control {
            display: flex;
            align-items: center;
            width: 100%;
            padding: ceil(@plyr-control-padding / 2) (@plyr-control-padding * 2);
            color: @plyr-menu-color;
            user-select: none;

            &::after {
                content: '';
                position: absolute;
                top: 50%;
                transform: translateY(-50%);
                border: 4px solid transparent;
                transition: border-color 0.2s ease;
            }

            &--forward {
                padding-right: ceil(@plyr-control-padding * 4);

                &::after {
                    right: 5px;
                    border-left-color: fade(@plyr-menu-color, 80%);
                }

                &.plyr__tab-focus::after,
                &:hover::after {
                    border-left-color: currentColor;
                }
            }

            &--back {
                position: relative;
                @horizontal-padding: (@plyr-control-padding * 2);

                width: ~'calc(100% - @{horizontal-padding})';
                margin: @plyr-control-padding;
                margin-bottom: floor(@plyr-control-padding / 2);
                padding-left: ceil(@plyr-control-padding * 4);
                font-weight: @plyr-font-weight-regular;

                &::after {
                    left: @plyr-control-padding;
                    border-right-color: fade(@plyr-menu-color, 80%);
                }

                &::before {
                    content: '';
                    position: absolute;
                    top: 100%;
                    left: 0;
                    right: 0;
                    height: 1px;
                    overflow: hidden;
                    margin-top: ceil(@plyr-control-padding / 2);
                    background: @plyr-menu-border-color;
                    box-shadow: 0 1px 0 @plyr-menu-border-shadow-color;
                }

                &.plyr__tab-focus::after,
                &:hover::after {
                    border-right-color: currentColor;
                }
            }
        }

        label.plyr__control {
            padding-left: @plyr-control-padding;

            input[type='radio'] + span {
                position: relative;
                display: block;
                flex-shrink: 0;
                height: 16px;
                width: 16px;
                border-radius: 100%;
                background: fade(#000, 10%);
                margin-right: @plyr-control-spacing;
                transition: all 0.3s ease;

                &::after {
                    content: '';
                    position: absolute;
                    height: 6px;
                    width: 6px;
                    top: 5px;
                    left: 5px;
                    transform: scale(0);
                    opacity: 0;
                    background: #fff;
                    border-radius: 100%;
                    transition: transform 0.3s ease, opacity 0.3s ease;
                }
            }

            input[type='radio']:checked + span {
                background: @plyr-color-main;

                &::after {
                    transform: scale(1);
                    opacity: 1;
                }
            }

            input[type='radio']:focus + span {
                .plyr-tab-focus();
            }

            &.plyr__tab-focus input[type='radio'] + span,
            &:hover input[type='radio'] + span {
                background: fade(#000, 10%);
            }
        }

        // Option value
        .plyr__menu__value {
            display: flex;
            align-items: center;
            margin-left: auto;
            margin-right: -@plyr-control-padding;
            padding-left: ceil(@plyr-control-padding * 3.5);
            pointer-events: none;
            overflow: hidden;
        }
    }
}