From 002d5ebd3d4771a082300d8987fbd019d40f9b68 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 25 Apr 2022 20:34:48 -0700 Subject: [PATCH] fix(css): Fix missing calc() statements (#4156) Closes #4155 --- ui/less/ad_controls.less | 2 +- ui/less/buttons.less | 2 +- ui/less/containers.less | 8 ++++---- ui/less/range_elements.less | 4 ++-- ui/less/tooltip.less | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ui/less/ad_controls.less b/ui/less/ad_controls.less index 73e5b65db4..92e6259916 100644 --- a/ui/less/ad_controls.less +++ b/ui/less/ad_controls.less @@ -82,7 +82,7 @@ * That divided by 2 is margin on one side, so we take that, and move the * button from its normal position to the right by that percentage. */ - right: (100 - @bottom-controls-width) / 2 * -1; + right: calc((100 - @bottom-controls-width) / 2 * -1); display: flex; flex-direction: row; margin: 0; diff --git a/ui/less/buttons.less b/ui/less/buttons.less index 6bbe896c50..fe9682df9e 100644 --- a/ui/less/buttons.less +++ b/ui/less/buttons.less @@ -26,7 +26,7 @@ * * Based on tips from https://stackoverflow.com/a/12925343 */ box-sizing: border-box; - padding: @play-button-size-percentage / 2; + padding: calc(@play-button-size-percentage / 2); width: 0; height: 0; diff --git a/ui/less/containers.less b/ui/less/containers.less index 54caae3079..ca46472722 100644 --- a/ui/less/containers.less +++ b/ui/less/containers.less @@ -337,8 +337,8 @@ .shaka-spinner { /* This uses the same trickery as the big play button define - the spinner's width and height. See .shaka-play-button - for the detailed explanation. */ + * the spinner's width and height. See .shaka-play-button + * for the detailed explanation. */ /* For the padding thing to work, spinner div needs to be an overlay-parent and spinner svg - an overlay child. */ @@ -346,11 +346,11 @@ margin: 0; box-sizing: border-box; - padding: @spinner-size-percentage / 2; + padding: calc(@spinner-size-percentage / 2); width: 0; height: 0; /* Add a bit of a white shadow to keep our black spinner visible - on a black background. */ + * on a black background. */ filter: drop-shadow(0 0 2px rgba(255 255 255 / 50%)); } diff --git a/ui/less/range_elements.less b/ui/less/range_elements.less index 903f4caf7b..15efeae529 100644 --- a/ui/less/range_elements.less +++ b/ui/less/range_elements.less @@ -39,7 +39,7 @@ .overlay-parent(); /* Vertical margins to occupy the same space as the thumb. */ - margin: (@thumb-size - @track-height)/2 6px; + margin: calc((@thumb-size - @track-height) / 2) 6px; /* Smaller height to contain the background for the virtual track. */ height: @track-height; @@ -109,7 +109,7 @@ /* Position the top of the range element so that it is centered on the * container. Note that the container is actually smaller than the thumb. */ - top: (@track-height - @thumb-size) / 2; + top: calc((@track-height - @thumb-size) / 2); /* Make sure clicking at the very top of the bar still takes effect and is not * confused with clicking the video to play/pause it. */ diff --git a/ui/less/tooltip.less b/ui/less/tooltip.less index 38dfdcb738..8316a00737 100644 --- a/ui/less/tooltip.less +++ b/ui/less/tooltip.less @@ -48,7 +48,7 @@ /* Override .material-icons-round text styling */ font-family: Roboto-Regular, Roboto, sans-serif; - line-height: @material-icons-width / 2; + line-height: calc(@material-icons-width / 2); white-space: nowrap; font-size: 13px; @@ -60,10 +60,10 @@ /* Positioning */ position: absolute; - bottom: @material-icons-width + 5px; + bottom: calc(@material-icons-width + 5px); /* Left attribute is set to half of the width of the parent button */ - left: @material-icons-width / 2; + left: calc(@material-icons-width / 2); /* The tooltip is also translated 50% to appear centered */ .translateX(-0.5);