]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/include/_mixins.scss
Add local user subscriptions
[github/Chocobozzz/PeerTube.git] / client / src / sass / include / _mixins.scss
CommitLineData
63c4db6d
C
1@import '_variables';
2
26c6ee80 3@mixin disable-default-a-behaviour {
cadb46d8 4 &:hover, &:focus, &:active {
26c6ee80
C
5 text-decoration: none !important;
6 outline: none !important;
7 }
8}
c30745f3 9
3ec8dc09
C
10@mixin disable-outline {
11 outline: none;
12
13 &::-moz-focus-inner {
14 border: 0;
15 padding: 0
16 }
17}
18
7a14004b
C
19@mixin peertube-word-wrap {
20 word-break: normal;
21 word-wrap: break-word;
22 overflow-wrap: break-word;
23 -webkit-hyphens: auto;
24 -ms-hyphens: auto;
25 -moz-hyphens: auto;
26 hyphens: auto;
27 text-align: justify;
28}
29
c30745f3
C
30@mixin peertube-input-text($width) {
31 display: inline-block;
32 height: $button-height;
33 width: $width;
34 background: #fff;
35 border: 1px solid #C6C6C6;
36 border-radius: 3px;
37 padding-left: 15px;
15ca2e87 38 padding-right: 15px;
8a19bee1 39}
c30745f3 40
8a19bee1
C
41@mixin peertube-input-group($width) {
42 width: $width;
43 height: $button-height;
44 padding-top: 0;
45 padding-bottom: 0;
46
47 .input-group-text{
48 font-size: 14px;
c30745f3
C
49 }
50}
51
5f0805d3
C
52@mixin peertube-textarea ($width, $height) {
53 @include peertube-input-text($width);
54
55 height: $height;
56 padding: 5px 15px;
57 font-size: 15px;
58}
59
7b272fd7 60@mixin orange-button {
15a7387d
C
61 &, &:active, &:focus {
62 color: #fff;
63 background-color: $orange-color;
64 }
7b272fd7 65
15a7387d 66 &:hover {
0727cab0 67 color: #fff;
7b272fd7
C
68 background-color: $orange-hoover-color;
69 }
4cc66133
C
70
71 &[disabled], &.disabled {
72 cursor: default;
cadb46d8
C
73 color: #fff;
74 background-color: #C6C6C6;
4cc66133 75 }
7b272fd7
C
76}
77
78@mixin grey-button {
15a7387d
C
79 &, &:active, &:focus {
80 background-color: $grey-color;
81 color: #585858;
82 }
7b272fd7 83
4cc66133 84 &:hover, &:active, &:focus, &[disabled], &.disabled {
0727cab0 85 color: #585858;
7b272fd7
C
86 background-color: $grey-hoover-color;
87 }
4cc66133
C
88
89 &[disabled], &.disabled {
90 cursor: default;
91 }
7b272fd7
C
92}
93
c30745f3
C
94@mixin peertube-button {
95 border: none;
c30745f3
C
96 font-weight: $font-semibold;
97 font-size: 15px;
98 height: $button-height;
99 line-height: $button-height;
100 border-radius: 3px;
101 text-align: center;
c30745f3
C
102 padding: 0 17px 0 13px;
103 cursor: pointer;
e600e1fe 104 outline: 0;
c30745f3
C
105}
106
107@mixin peertube-button-link {
108 display: inline-block;
109
c30745f3 110 @include disable-default-a-behaviour;
ce0e281d 111 @include peertube-button;
c30745f3 112}
2295ce6c 113
c5911fd3
C
114@mixin peertube-button-file ($width) {
115 position: relative;
116 overflow: hidden;
117 display: inline-block;
118 width: $width;
119
120 @include peertube-button;
121 @include orange-button;
122
123 input[type=file] {
124 position: absolute;
125 top: 0;
126 right: 0;
127 min-width: 100%;
128 min-height: 100%;
129 font-size: 100px;
130 text-align: right;
131 filter: alpha(opacity=0);
132 opacity: 0;
133 outline: none;
134 background: white;
135 cursor: inherit;
136 display: block;
137 }
138}
139
0727cab0
C
140@mixin icon ($size) {
141 display: inline-block;
142 background-repeat: no-repeat;
143 background-size: contain;
144 width: $size;
145 height: $size;
146 vertical-align: middle;
147 cursor: pointer;
148}
4cc66133 149
15a7387d
C
150@mixin peertube-select-container ($width) {
151 padding: 0;
152 margin: 0;
4cc66133 153 border: 1px solid #C6C6C6;
4cc66133
C
154 width: $width;
155 border-radius: 3px;
15a7387d
C
156 overflow: hidden;
157 background: #fff;
158 position: relative;
5f0805d3 159 font-size: 15px;
15a7387d
C
160
161 &:after {
162 top: 50%;
163 right: calc(0% + 15px);
164 content: " ";
165 height: 0;
166 width: 0;
167 position: absolute;
168 pointer-events: none;
169 border: 5px solid rgba(0, 0, 0, 0);
a4f99a76 170 border-top-color: #000;
15a7387d
C
171 margin-top: -2px;
172 z-index: 100;
173 }
174
175 select {
108af661 176 padding: 0 35px 0 12px;
15a7387d
C
177 width: calc(100% + 2px);
178 position: relative;
179 left: 1px;
180 border: none;
181 box-shadow: none;
182 background: transparent none;
183 appearance: none;
184 cursor: pointer;
185 height: $button-height;
108af661 186 text-overflow: ellipsis;
15a7387d
C
187
188 &:focus {
189 outline: none;
190 }
191
192 &:-moz-focusring {
193 color: transparent;
194 text-shadow: 0 0 0 #000;
195 }
196 }
197}
198
199@mixin peertube-select-disabled-container ($width) {
200 @include peertube-select-container($width);
201
202 background-color: #E5E5E5;
203
204 select {
205 cursor: default;
206 }
4cc66133 207}
a0d69908 208
5f0805d3
C
209// Thanks: https://codepen.io/triss90/pen/XNEdRe/
210@mixin peertube-radio-container {
211 input[type="radio"] {
212 display: none;
213
214 & + label {
215 font-weight: $font-regular;
216 cursor: pointer;
217
218 &:before {
219 position: relative;
220 top: -2px;
221 content: '';
222 background: #fff;
223 border-radius: 100%;
224 border: 1px solid #000;
225 display: inline-block;
226 width: 15px;
227 height: 15px;
228 vertical-align: middle;
229 cursor: pointer;
230 text-align: center;
231 margin-right: 10px;
232 }
233 }
234
235 &:checked + label:before {
236 background-color: #000;
237 box-shadow: inset 0 0 0 4px #fff;
238 }
239
240 &:focus + label:before {
241 outline: none;
242 border-color: #000;
243 }
244 }
245}
246
a0d69908
C
247@mixin peertube-checkbox ($border-width) {
248 display: none;
249
0f7fedc3 250 & + span {
a0d69908
C
251 position: relative;
252 width: 18px;
253 height: 18px;
254 border: $border-width solid #000;
255 border-radius: 3px;
256 vertical-align: middle;
257 cursor: pointer;
258
259 &:after {
260 content: '';
261 position: absolute;
262 top: calc(2px - #{$border-width});
263 left: 5px;
264 width: 5px;
265 height: 12px;
266 opacity: 0;
267 transform: rotate(45deg) scale(0);
268 border-right: 2px solid #fff;
269 border-bottom: 2px solid #fff;
270 }
271 }
272
0f7fedc3 273 &:checked + span {
a0d69908
C
274 border-color: transparent;
275 background: $orange-color;
276 animation: jelly 0.6s ease;
277
278 &:after {
279 opacity: 1;
280 transform: rotate(45deg) scale(1);
281 }
282 }
283
0f7fedc3 284 & + span + span {
a0d69908
C
285 font-size: 15px;
286 font-weight: $font-regular;
287 margin-left: 5px;
288 cursor: pointer;
6693df9d 289 display: inline;
a0d69908 290 }
bbe0f064 291
0f7fedc3
C
292 &[disabled] + span,
293 &[disabled] + span + span{
bbe0f064
C
294 opacity: 0.5;
295 cursor: default;
296 }
a0d69908
C
297}
298
4e8c8728
C
299
300@mixin avatar ($size) {
301 object-fit: cover;
a4f99a76 302 border-radius: 50%;
4e8c8728
C
303 width: $size;
304 height: $size;
305}
c6352f2c
C
306
307@mixin chevron ($size, $border-width) {
308 border-style: solid;
309 border-width: $border-width $border-width 0 0;
310 content: '';
311 display: inline-block;
312 transform: rotate(-45deg);
313 height: $size;
314 width: $size;
315}
316
317@mixin chevron-right ($size, $border-width) {
318 @include chevron($size, $border-width);
319
320 left: 0;
321 transform: rotate(45deg);
322}
323
324@mixin chevron-left ($size, $border-width) {
325 @include chevron($size, $border-width);
326
327 left: 0.25em;
328 transform: rotate(-135deg);
329}
0626e7af
C
330
331@mixin in-content-small-title {
332 text-transform: uppercase;
333 color: $orange-color;
334 font-weight: $font-bold;
335 font-size: 13px;
170726f5
C
336}
337
22a16e36
C
338@mixin actor-owner {
339 @include disable-default-a-behaviour;
340
341 display: block;
342 font-size: 13px;
343 margin-top: 4px;
344 color: #000;
345
346 span:hover {
347 opacity: 0.8;
348 }
349
350 img {
351 @include avatar(18px);
352
353 margin-left: 7px;
354 position: relative;
355 top: -2px;
356 }
357}
358
170726f5
C
359@mixin sub-menu-with-actor {
360 height: 160px;
361 display: flex;
362 flex-direction: column;
363 align-items: start;
364
365 .actor {
366 display: flex;
367 margin-top: 20px;
368 margin-bottom: 20px;
369
370 img {
371 @include avatar(80px);
372
373 margin-right: 20px;
374 }
375
376 .actor-info {
377 display: flex;
378 flex-direction: column;
379 justify-content: center;
380
7de6afdf
C
381 .actor-names {
382 display: flex;
383 align-items: center;
384
385 .actor-display-name {
386 font-size: 23px;
387 font-weight: $font-bold;
388 }
389
390 .actor-name {
391 margin-left: 7px;
392 position: relative;
393 top: 3px;
394 font-size: 14px;
22a16e36 395 color: $grey-actor-name;
7de6afdf 396 }
170726f5
C
397 }
398
399 .actor-followers {
400 font-size: 15px;
401 }
a4f99a76
C
402
403 .actor-owner {
22a16e36 404 @include actor-owner;
a4f99a76 405 }
170726f5
C
406 }
407 }
408
409 .links {
410 margin-top: 0;
411 margin-bottom: 10px;
412
413 a {
414 margin-top: 0;
415 margin-bottom: 0;
416 }
417 }
08c1efbe
C
418}
419
695237b2 420@mixin create-button ($imageUrl) {
08c1efbe
C
421 @include peertube-button-link;
422 @include orange-button;
423
424 .icon.icon-add {
f2bbd1e1 425 @include icon(20px);
08c1efbe 426
f2bbd1e1
C
427 position: relative;
428 top: -1px;
429 margin-right: 5px;
695237b2 430 background-image: url($imageUrl);
08c1efbe 431 }
a4f99a76 432}
22a16e36
C
433
434@mixin row-blocks {
435 display: flex;
436 min-height: 130px;
437 padding-bottom: 20px;
438 margin-bottom: 20px;
439 border-bottom: 1px solid #C6C6C6;
440
441 @media screen and (max-width: 800px) {
442 flex-direction: column;
443 height: auto;
444 text-align: center;
445 align-items: center;
446 }
447}