Skip to content

Commit a67cb6e

Browse files
authored
build: Downgrade less (#3982)
Downgrade less to v3. v4 is failing on macOS for some reason. See less/less.js#3693 This also makes some less/CSS changes that are useful for future upgrades: - wrap all calculations in calc(), which is required in less v4 - remove unneeded @transparent variable Finally, this fixes an erroneous error message that said "extern generation failed" instead of "CSS compilation failed". Closes #3981
1 parent d236877 commit a67cb6e

8 files changed

+42
-113
lines changed

build/compiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def compile(self, force=False):
287287
cmd_line = lessc + less_options + [self.main_source_file, self.output]
288288

289289
if shakaBuildHelpers.execute_get_code(cmd_line) != 0:
290-
logging.error('Externs generation failed')
290+
logging.error('CSS compilation failed')
291291
return False
292292

293293
# We need to prepend the license header to the compiled CSS.

package-lock.json

+31-100
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"karma-sourcemap-loader": "^0.3.8",
4444
"karma-spec-reporter": "^0.0.33",
4545
"karma-webdriver-launcher": "^1.0.8",
46-
"less": "^4.1.2",
46+
"less": "^3.13.1",
4747
"less-plugin-clean-css": "^1.5.1",
4848
"material-design-lite": "^1.3.0",
4949
"mux.js": "^5.14.1",

ui/less/ad_controls.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
* That divided by 2 is margin on one side, so we take that, and move the
8383
* button from its normal position to the right by that percentage.
8484
*/
85-
right: (100 - @bottom-controls-width) / 2 * -1;
85+
right: calc((100 - @bottom-controls-width) / 2 * -1);
8686
display: flex;
8787
flex-direction: row;
8888
margin: 0;

ui/less/buttons.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* Based on tips from https://stackoverflow.com/a/12925343 */
2828
box-sizing: border-box;
29-
padding: @play-button-size-percentage / 2;
29+
padding: calc(@play-button-size-percentage / 2);
3030
width: 0;
3131
height: 0;
3232

ui/less/containers.less

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/* All of the top-level containers into which various visible features go. */
88

9-
@transparent: rgba(0, 0, 0, 0);
10-
119
/* A container for the entire video + controls combo. This is the auto-setup
1210
* div which we populate. */
1311
.shaka-video-container {
@@ -277,7 +275,7 @@
277275
.show-when-controls-shown();
278276

279277
/* A black gradient at the bottom, behind the controls, but only so high. */
280-
background: linear-gradient(to top, rgba(0, 0, 0, 1) 0, @transparent 15%);
278+
background: linear-gradient(to top, black 0, transparent 15%);
281279
}
282280

283281
.shaka-text-container {
@@ -348,7 +346,7 @@
348346

349347
margin: 0;
350348
box-sizing: border-box;
351-
padding: @spinner-size-percentage / 2;
349+
padding: calc(@spinner-size-percentage / 2);
352350
width: 0;
353351
height: 0;
354352

ui/less/range_elements.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
.overlay-parent();
4040

4141
/* Vertical margins to occupy the same space as the thumb. */
42-
margin: (@thumb-size - @track-height)/2 6px;
42+
margin: calc((@thumb-size - @track-height) / 2) 6px;
4343

4444
/* Smaller height to contain the background for the virtual track. */
4545
height: @track-height;
@@ -104,7 +104,7 @@
104104

105105
/* Position the top of the range element so that it is centered on the
106106
* container. Note that the container is actually smaller than the thumb. */
107-
top: (@track-height - @thumb-size) / 2;
107+
top: calc((@track-height - @thumb-size) / 2);
108108

109109
/* Make sure clicking at the very top of the bar still takes effect and is not
110110
* confused with clicking the video to play/pause it. */

ui/less/tooltip.less

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
/* Override .material-icons-round text styling */
5050
font-family: Roboto-Regular, Roboto, sans-serif;
51-
line-height: @material-icons-width / 2;
51+
line-height: calc(@material-icons-width / 2);
5252
white-space: nowrap;
5353
font-size: 13px;
5454

@@ -60,10 +60,10 @@
6060

6161
/* Positioning */
6262
position: absolute;
63-
bottom: @material-icons-width + 5px;
63+
bottom: calc(@material-icons-width + 5px);
6464

6565
/* Left attribute is set to half of the width of the parent button */
66-
left: @material-icons-width / 2;
66+
left: calc(@material-icons-width / 2);
6767

6868
/* The tooltip is also translated 50% to appear centered */
6969
.translateX(-0.5);

0 commit comments

Comments
 (0)