Browse Source

ref(filmstrip): move vertical filmstrip container styles to own file

master
Leonard Kim 6 years ago
parent
commit
0aa2d81844
3 changed files with 151 additions and 156 deletions
  1. 146
    0
      css/filmstrip/_vertical_filmstrip.scss
  2. 4
    156
      css/filmstrip/_vertical_filmstrip_overrides.scss
  3. 1
    0
      css/main.scss

+ 146
- 0
css/filmstrip/_vertical_filmstrip.scss View File

@@ -0,0 +1,146 @@
1
+.vertical-filmstrip .filmstrip {
2
+    /*
3
+     * Firefox sets flex items to min-height: auto and min-width: auto,
4
+     * preventing flex children from shrinking like they do on other browsers.
5
+     * Setting min-height and min-width 0 is a workaround for the issue so
6
+     * Firefox behaves like other browsers.
7
+     * https://bugzilla.mozilla.org/show_bug.cgi?id=1043520
8
+     */
9
+    @mixin minHWAutoFix() {
10
+        min-height: 0;
11
+        min-width: 0;
12
+    }
13
+
14
+    align-items: flex-end;
15
+    box-sizing: border-box;
16
+    display: flex;
17
+    flex-direction: column-reverse;
18
+    height: 100%;
19
+    /**
20
+     * fixed positioning is necessary for remote menus and tooltips to pop
21
+     * out of the scrolling filmstrip. AtlasKit dialogs and tooltips use
22
+     * a library called popper which will position its elements fixed if
23
+     * any parent is also fixed.
24
+     */
25
+    position: fixed;
26
+    top: 0;
27
+    transition: height .3s ease-in;
28
+    z-index: $filmstripVideosZ;
29
+
30
+    &.reduce-height {
31
+        height: calc(100% - #{$newToolbarSizeWithPadding});
32
+    }
33
+
34
+    /**
35
+     * Hide videos by making them slight to the right.
36
+     */
37
+    .filmstrip__videos {
38
+        right: 0;
39
+
40
+        &.hidden {
41
+            bottom: auto;
42
+            right: -196px;
43
+        }
44
+
45
+        /**
46
+         * An id selector is used to match id specificity with existing
47
+         * filmstrip styles.
48
+         */
49
+        &#remoteVideos {
50
+            /**
51
+             * Remove horizontal filmstrip padding used to prevent videos
52
+             * from overlapping getting near the left-side of the screen.
53
+             * An id selector is used to match id specificity with filmstrip
54
+             * styles.
55
+             */
56
+            padding-left: 0;
57
+            transition: right 2s;
58
+        }
59
+    }
60
+
61
+    /**
62
+     * Re-styles the local Video to better fit vertical filmstrip layout.
63
+     */
64
+    #filmstripLocalVideo {
65
+        align-self: initial;
66
+        bottom: 5px;
67
+        display: flex;
68
+        flex-direction: column-reverse;
69
+        height: auto;
70
+        justify-content: flex-start;
71
+    }
72
+
73
+    /**
74
+     * Remove unnecssary padding that is normally used to prevent horizontal
75
+     * filmstrip from overlapping the left edge of the screen.
76
+     */
77
+    #filmstripLocalVideo,
78
+    #filmstripRemoteVideos {
79
+        padding: 0;
80
+    }
81
+
82
+    #filmstripRemoteVideos {
83
+        @include minHWAutoFix();
84
+
85
+        display: flex;
86
+        flex: 1;
87
+        flex-direction: column;
88
+        height: auto;
89
+        justify-content: flex-end;
90
+
91
+        #filmstripRemoteVideosContainer {
92
+            flex-direction: column-reverse;
93
+            /**
94
+             * Add padding as a hack for Firefox not to show scrollbars when
95
+             * unnecessary.
96
+             */
97
+            padding: 1px 0;
98
+            overflow-x: hidden;
99
+        }
100
+    }
101
+
102
+    #remoteVideos {
103
+        @include minHWAutoFix();
104
+
105
+        flex-direction: column;
106
+        flex-grow: 1;
107
+    }
108
+}
109
+
110
+/**
111
+ * Override other styles to support vertical filmstrip mode.
112
+ */
113
+.vertical-filmstrip.filmstrip-only {
114
+    .filmstrip {
115
+        flex-direction: row-reverse;
116
+    }
117
+    .filmstrip__videos-filmstripOnly {
118
+        height: 100%;
119
+    }
120
+}
121
+
122
+/**
123
+ * Workarounds for Edge and Firefox not handling scrolling properly with
124
+ * flex-direction: column-reverse. The remove videos in filmstrip should
125
+ * start scrolling from the bottom of the filmstrip, but in those browsers the
126
+ * scrolling won't happen. Per W3C spec, scrolling should happen from the
127
+ * bottom. As such, use css hacks to get around the css issue, with the intent
128
+ * being to remove the hacks as the spec is supported.
129
+ */
130
+@mixin undoColumnReverseVideos() {
131
+    .vertical-filmstrip {
132
+        #remoteVideos #filmstripRemoteVideos #filmstripRemoteVideosContainer {
133
+            flex-direction: column;
134
+        }
135
+    }
136
+}
137
+
138
+/** Firefox detection hack **/
139
+@-moz-document url-prefix() {
140
+    @include undoColumnReverseVideos();
141
+}
142
+
143
+/** Edge detection hack **/
144
+@supports (-ms-ime-align:auto) {
145
+    @include undoColumnReverseVideos();
146
+}

+ 4
- 156
css/filmstrip/_vertical_filmstrip_overrides.scss View File

@@ -1,135 +1,9 @@
1 1
 /**
2
- * Override other styles to support vertical filmstrip mode.
2
+ * Rotate the hide filmstrip icon so it points towards the right edge
3
+ * of the screen.
3 4
  */
4
-.vertical-filmstrip {
5
-    /*
6
-     * Firefox sets flex items to min-height: auto and min-width: auto,
7
-     * preventing flex children from shrinking like they do on other browsers.
8
-     * Setting min-height and min-width 0 is a workaround for the issue so
9
-     * Firefox behaves like other browsers.
10
-     * https://bugzilla.mozilla.org/show_bug.cgi?id=1043520
11
-     */
12
-    @mixin minHWAutoFix() {
13
-        min-height: 0;
14
-        min-width: 0;
15
-    }
16
-
17
-    .filmstrip {
18
-        align-items: flex-end;
19
-        box-sizing: border-box;
20
-        display: flex;
21
-        flex-direction: column-reverse;
22
-        height: 100%;
23
-        /**
24
-         * fixed positioning is necessary for remote menus and tooltips to pop
25
-         * out of the scrolling filmstrip. AtlasKit dialogs and tooltips use
26
-         * a library called popper which will position its elements fixed if
27
-         * any parent is also fixed.
28
-         */
29
-        position: fixed;
30
-        top: 0;
31
-        transition: height .3s ease-in;
32
-        z-index: $filmstripVideosZ;
33
-
34
-        /**
35
-         * Adjust the height of the filmstrip as the toolbar is displayed.
36
-         */
37
-        &.reduce-height {
38
-            height: calc(100% - #{$newToolbarSizeWithPadding});
39
-        }
40
-
41
-        /**
42
-         * Hide videos by making them slight to the right.
43
-         */
44
-        .filmstrip__videos {
45
-            right: 0;
46
-
47
-            &.hidden {
48
-                bottom: auto;
49
-                right: -196px;
50
-            }
51
-
52
-            /**
53
-             * An id selector is used to match id specificity with existing
54
-             * filmstrip styles.
55
-             */
56
-            &#remoteVideos {
57
-                /**
58
-                 * Remove horizontal filmstrip padding used to prevent videos
59
-                 * from overlapping getting near the left-side of the screen.
60
-                 * An id selector is used to match id specificity with filmstrip
61
-                 * styles.
62
-                 */
63
-                padding-left: 0;
64
-                transition: right 2s;
65
-            }
66
-        }
67
-
68
-        /**
69
-         * Re-styles the local Video to better fit vertical filmstrip layout.
70
-         */
71
-        #filmstripLocalVideo {
72
-            align-self: initial;
73
-            bottom: 5px;
74
-            display: flex;
75
-            flex-direction: column-reverse;
76
-            height: auto;
77
-            justify-content: flex-start;
78
-        }
79
-
80
-        /**
81
-         * Remove unnecssary padding that is normally used to prevent horizontal
82
-         * filmstrip from overlapping the left edge of the screen.
83
-         */
84
-        #filmstripLocalVideo,
85
-        #filmstripRemoteVideos {
86
-            padding: 0;
87
-        }
88
-
89
-        #filmstripRemoteVideos {
90
-            @include minHWAutoFix();
91
-
92
-            display: flex;
93
-            flex: 1;
94
-            flex-direction: column;
95
-            height: auto;
96
-            justify-content: flex-end;
97
-
98
-            #filmstripRemoteVideosContainer {
99
-                flex-direction: column-reverse;
100
-                /**
101
-                 * Add padding as a hack for Firefox not to show scrollbars when
102
-                 * unnecessary.
103
-                 */
104
-                padding: 1px 0;
105
-                overflow-x: hidden;
106
-            }
107
-        }
108
-
109
-        /**
110
-         * Rotate the hide filmstrip icon so it points towards the right edge
111
-         * of the screen.
112
-         */
113
-        &__toolbar {
114
-            transform: rotate(-90deg);
115
-        }
116
-
117
-        #remoteVideos {
118
-            @include minHWAutoFix();
119
-
120
-            flex-direction: column;
121
-            flex-grow: 1;
122
-        }
123
-    }
124
-
125
-    &.filmstrip-only {
126
-        .filmstrip {
127
-            flex-direction: row-reverse;
128
-        }
129
-        .filmstrip__videos-filmstripOnly {
130
-            height: 100%;
131
-        }
132
-    }
5
+.vertical-filmstrip .filmstrip__toolbar {
6
+    transform: rotate(-90deg);
133 7
 }
134 8
 
135 9
 /**
@@ -229,29 +103,3 @@
229 103
         transition-delay: 0.1s;
230 104
     }
231 105
 }
232
-
233
-/**
234
- * Workarounds for Edge, IE11, and Firefox not handling scrolling properly
235
- * with flex-direction: column-reverse. The remove videos in filmstrip should
236
- * start scrolling from the bottom of the filmstrip, but in those browsers the
237
- * scrolling won't happen. Per W3C spec, scrolling should happen from the
238
- * bottom. As such, use css hacks to get around the css issue, with the intent
239
- * being to remove the hacks as the spec is supported.
240
- */
241
-@mixin undoColumnReverseVideos() {
242
-    .vertical-filmstrip {
243
-        #remoteVideos #filmstripRemoteVideos #filmstripRemoteVideosContainer {
244
-            flex-direction: column;
245
-        }
246
-    }
247
-}
248
-
249
-/** Firefox detection hack **/
250
-@-moz-document url-prefix() {
251
-    @include undoColumnReverseVideos();
252
-}
253
-
254
-/** Edge detection hack **/
255
-@supports (-ms-ime-align:auto) {
256
-    @include undoColumnReverseVideos();
257
-}

+ 1
- 0
css/main.scss View File

@@ -72,6 +72,7 @@
72 72
 @import 'filmstrip/filmstrip_toolbar';
73 73
 @import 'filmstrip/horizontal_filmstrip';
74 74
 @import 'filmstrip/small_video';
75
+@import 'filmstrip/vertical_filmstrip';
75 76
 @import 'filmstrip/vertical_filmstrip_overrides';
76 77
 @import 'unsupported-browser/main';
77 78
 @import 'modals/invite/add-people';

Loading…
Cancel
Save