Skip to content

Commit

Permalink
fix(css): Fix missing calc() statements (#4156)
Browse files Browse the repository at this point in the history
Closes #4155
  • Loading branch information
joeyparrish authored Apr 26, 2022
1 parent 7e8393d commit 002d5eb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ui/less/ad_controls.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ui/less/buttons.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions ui/less/containers.less
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,20 @@

.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. */
.overlay-parent();

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%));
}
4 changes: 2 additions & 2 deletions ui/less/range_elements.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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. */
Expand Down
6 changes: 3 additions & 3 deletions ui/less/tooltip.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit 002d5eb

Please sign in to comment.