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 committed Apr 26, 2022
1 parent af3945b commit db22e99
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 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 @@ -263,20 +263,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

0 comments on commit db22e99

Please sign in to comment.