Skip to content

Commit

Permalink
refactor: Opt into new mixed declaration behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
eXhumer committed Aug 21, 2024
1 parent e84f939 commit 7c9b3ed
Show file tree
Hide file tree
Showing 17 changed files with 124 additions and 78 deletions.
28 changes: 18 additions & 10 deletions src/Player/React/Skin/SkinModern/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
}

@mixin hidden-animated($duration: $animation-duration) {
opacity: 1;
transition: hidden-animated-transition($duration);
visibility: visible;
& {
opacity: 1;
transition: hidden-animated-transition($duration);
visibility: visible;
}

&.#{$prefix}-hidden {
opacity: 0;
Expand Down Expand Up @@ -58,7 +60,9 @@

@include hidden-animated($duration);

transition: $transitions-string;
& {
transition: $transitions-string;
}
}

// Cover the whole parent element
Expand All @@ -73,16 +77,20 @@

// Align to parent's bottom
@mixin layout-align-bottom {
bottom: 0;
position: absolute;
width: 100%;
& {
bottom: 0;
position: absolute;
width: 100%;
}
}

// Align to parent's top
@mixin layout-align-top {
position: absolute;
top: 0;
width: 100%;
& {
position: absolute;
top: 0;
width: 100%;
}
}

// H/V center items in the middle of the overlay
Expand Down
12 changes: 8 additions & 4 deletions src/Player/React/Skin/SkinModern/_skin-smallscreen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
@include layout-cover;
@include layout-center-children-in-container;

display: flex;
& {
display: flex;
}

.#{$prefix}-ui-settings-panel-page {
min-width: 15em;
Expand Down Expand Up @@ -129,9 +131,11 @@
> * {
@include hidden; // Add hidden here too, else it is overwritten by display: table-cell

display: table-cell;
vertical-align: middle;
width: 1em;
& {
display: table-cell;
vertical-align: middle;
width: 1em;
}
}

.#{$prefix}-label-metadata-title {
Expand Down
18 changes: 11 additions & 7 deletions src/Player/React/Skin/SkinModern/components/_bufferingoverlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
@include layout-cover;
@include hidden-animated($animation-duration * 2);

background-color: $color-background-highlight;
& {
background-color: $color-background-highlight;
}

> .#{$prefix}-container-wrapper {
padding: 3em;
Expand Down Expand Up @@ -62,12 +64,14 @@
}
}

animation: #{$prefix}-fancy $buffering-animation-duration ease-in infinite;
background: url('../Asset/SkinModern/images/loader.svg') no-repeat center;
display: inline-block;
height: 2em;
margin: .2em;
width: 2em;
& {
animation: #{$prefix}-fancy $buffering-animation-duration ease-in infinite;
background: url('../Asset/SkinModern/images/loader.svg') no-repeat center;
display: inline-block;
height: 2em;
margin: .2em;
width: 2em;
}

@for $i from 1 through 3 {
&:nth-child(#{$i}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
@include layout-cover;
@include hidden-animated;

background: $color-background url('../Asset/SkinModern/images/chromecast.svg') center no-repeat;
background-size: 7em 7em;
& {
background: $color-background url('../Asset/SkinModern/images/chromecast.svg') center no-repeat;
background-size: 7em 7em;
}

.#{$prefix}-ui-cast-status-label {
color: $color-primary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
}
}

background-image: url('../Asset/SkinModern/images/close.svg');
& {
background-image: url('../Asset/SkinModern/images/close.svg');
}

&:hover {
@include svg-icon-shadow;
Expand Down
16 changes: 10 additions & 6 deletions src/Player/React/Skin/SkinModern/components/_controlbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
@include hidden-animated-focusable;
@include layout-align-bottom;

background: linear-gradient(to bottom, $color-transparent, $color-background-bars);
box-sizing: border-box;
line-height: 1em;
padding: 1em 1em .5em;
& {
background: linear-gradient(to bottom, $color-transparent, $color-background-bars);
box-sizing: border-box;
line-height: 1em;
padding: 1em 1em .5em;
}

.#{$prefix}-controlbar-top,
.#{$prefix}-controlbar-bottom {
Expand Down Expand Up @@ -54,8 +56,10 @@
> * {
@include hidden; // Add hidden here too, else it is overwritten by display: table-cell

display: table-cell;
vertical-align: middle;
& {
display: table-cell;
vertical-align: middle;
}
}

.#{$prefix}-ui-volumeslider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
@include layout-cover;
@include hidden;

background-color: $color-background;
pointer-events: none;
& {
background-color: $color-background;
pointer-events: none;
}

.#{$prefix}-ui-errormessage-label {
color: $color-primary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
}
}

cursor: default;
height: 8em;
outline: none;
overflow: hidden; // hide overflow from scale animation
width: 8em;
& {
cursor: default;
height: 8em;
outline: none;
overflow: hidden; // hide overflow from scale animation
width: 8em;
}

.#{$prefix}-image {
background-image: url('../Asset/SkinModern/images/play_big.svg');
Expand Down
6 changes: 4 additions & 2 deletions src/Player/React/Skin/SkinModern/components/_label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
@extend %ui-component;
@include hidden;

cursor: default;
white-space: nowrap;
& {
cursor: default;
white-space: nowrap;
}
}

.#{$prefix}-ui-label {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
@include layout-center-children-in-container;
@include hidden-animated($animation-duration * 2);

background-color: $color-background-highlight;
& {
background-color: $color-background-highlight;
}

> .#{$prefix}-container-wrapper {
padding: 3em;
Expand Down
12 changes: 7 additions & 5 deletions src/Player/React/Skin/SkinModern/components/_seekbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ $seekbar-height: .3125em;
@include hidden;
@include focusable;

cursor: pointer;
font-size: 1em;
height: 1em;
position: relative;
width: 100%;
& {
cursor: pointer;
font-size: 1em;
height: 1em;
position: relative;
width: 100%;
}

$bar-inset: auto;

Expand Down
14 changes: 8 additions & 6 deletions src/Player/React/Skin/SkinModern/components/_seekbarlabel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
@extend %ui-container;
@include hidden-animated;

bottom: 100%;
left: 0;
margin-bottom: 1em;
pointer-events: none;
position: absolute;
text-align: center;
& {
bottom: 100%;
left: 0;
margin-bottom: 1em;
pointer-events: none;
position: absolute;
text-align: center;
}

// Center container on left edge to get it centered over timeline position
%center-on-left-edge {
Expand Down
14 changes: 8 additions & 6 deletions src/Player/React/Skin/SkinModern/components/_selectbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
@extend %ui-component;
@include focusable;

background-color: transparent;
border: 0;
color: $color-highlight;
cursor: pointer;
font-size: .8em;
padding: .3em;
& {
background-color: transparent;
border: 0;
color: $color-highlight;
cursor: pointer;
font-size: .8em;
padding: .3em;
}

option {
color: $color-secondary;
Expand Down
14 changes: 8 additions & 6 deletions src/Player/React/Skin/SkinModern/components/_settingspanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

$background-color: color.adjust($color-background, $alpha: .15);

background-color: $background-color;
bottom: 5em;
overflow: hidden;
padding: 0;
position: absolute;
right: 2em;
& {
background-color: $background-color;
bottom: 5em;
overflow: hidden;
padding: 0;
position: absolute;
right: 2em;
}

> .#{$prefix}-container-wrapper {
margin: .5em;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
@extend %ui-container;
@include hidden;

font-size: 1.2em;
pointer-events: none;
position: absolute;
text-align: center;
inset: 0;
transition: bottom $animation-duration-short ease-out;
& {
font-size: 1.2em;
pointer-events: none;
position: absolute;
text-align: center;
inset: 0;
transition: bottom $animation-duration-short ease-out;
}

* {
// This aims to prevent possibly conflicting style definitions inherited
Expand Down
10 changes: 6 additions & 4 deletions src/Player/React/Skin/SkinModern/components/_titlebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
@include hidden-animated-focusable;
@include layout-align-top;

background: linear-gradient(to top, $color-transparent, $color-background-bars);
box-sizing: border-box;
padding: .5em 1em 1em;
pointer-events: none;
& {
background: linear-gradient(to top, $color-transparent, $color-background-bars);
box-sizing: border-box;
padding: .5em 1em 1em;
pointer-events: none;
}

> .#{$prefix}-container-wrapper {
padding: .5em;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
.#{$prefix}-ui-volumeslider {
@include animate-slide-in-from-bottom(6em, $animation-duration-short);

background-color: $color-background;
bottom: 100%;
height: 6em;
position: absolute;
width: 1.5em;
& {
background-color: $color-background;
bottom: 100%;
height: 6em;
position: absolute;
width: 1.5em;
}

.#{$prefix}-seekbar {
height: auto;
Expand Down

0 comments on commit 7c9b3ed

Please sign in to comment.