Skip to content

Commit

Permalink
Fix SCSS deprecation warnings
Browse files Browse the repository at this point in the history
This also touches our vendored copy of fontawesome.
See opencast#429.
  • Loading branch information
JulianKniephoff committed May 23, 2024
1 parent 5dd7547 commit da2ca5d
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 21 deletions.
4 changes: 3 additions & 1 deletion src/styles/base/fontawesome/_core.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@use "sass:list";

// Base Class Definition
// -------------------------

.#{$fa-css-prefix} {
display: inline-block;
font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
font: normal normal normal list.slash($fa-font-size-base, $fa-line-height-base) FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
Expand Down
4 changes: 3 additions & 1 deletion src/styles/base/fontawesome/_fixed-width.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use "sass:math";

// Fixed Width Icons
// -------------------------
.#{$fa-css-prefix}-fw {
width: (18em / 14);
width: math.div(18em, 14);
text-align: center;
}
6 changes: 4 additions & 2 deletions src/styles/base/fontawesome/_larger.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@use "sass:math";

// Icon Sizes
// -------------------------

/* makes the font 33% larger relative to the icon container */
.#{$fa-css-prefix}-lg {
font-size: (4em / 3);
line-height: (3em / 4);
font-size: math.div(4em, 3);
line-height: (3em * 0.25);
vertical-align: -15%;
}
.#{$fa-css-prefix}-2x { font-size: 2em; }
Expand Down
6 changes: 4 additions & 2 deletions src/styles/base/fontawesome/_list.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:math";

// List Icons
// -------------------------

Expand All @@ -11,9 +13,9 @@
position: absolute;
left: -$fa-li-width;
width: $fa-li-width;
top: (2em / 14);
top: math.div(2em, 14);
text-align: center;
&.#{$fa-css-prefix}-lg {
left: -$fa-li-width + (4em / 14);
left: -$fa-li-width + math.div(4em, 14);
}
}
4 changes: 3 additions & 1 deletion src/styles/base/fontawesome/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@use "sass:list";

// Mixins
// --------------------------

@mixin fa-icon() {
display: inline-block;
font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
font: normal normal normal list.slash($fa-font-size-base, $fa-line-height-base) FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
Expand Down
4 changes: 3 additions & 1 deletion src/styles/base/fontawesome/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:math";

// Variables
// --------------------------

Expand All @@ -9,7 +11,7 @@ $fa-css-prefix: fa !default;
$fa-version: "4.6.3" !default;
$fa-border-color: #eee !default;
$fa-inverse: #fff !default;
$fa-li-width: (30em / 14) !default;
$fa-li-width: math.div(30em, 14) !default;

$fa-var-500px: "\f26e";
$fa-var-adjust: "\f042";
Expand Down
4 changes: 3 additions & 1 deletion src/styles/components/_stats.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* the License.
*
*/
@use "sass:math";

.stats-container {
text-align: right;

Expand All @@ -28,7 +30,7 @@
box-sizing: border-box;
display: inline-block;
vertical-align: top;
min-width: (40% / $num-cols);
min-width: math.div(40%, $num-cols);
margin-bottom: 20px;
margin-top: 12px;
padding: 0 5px;
Expand Down
4 changes: 2 additions & 2 deletions src/styles/components/modals/_modal-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

.medium-modal {
width: $modal-width;
margin-left: -($modal-width / 2);
margin-left: -($modal-width * 0.5);
}

.large-modal {
Expand All @@ -62,7 +62,7 @@
position: absolute;
top: 100px;
left: 50%;
margin-left: -($modal-width / 2);
margin-left: -($modal-width * 0.5);
background: $body-background;
border-radius: $main-border-radius;
box-shadow: 0 0 20px 2px rgba($black, 0.3);
Expand Down
2 changes: 1 addition & 1 deletion src/styles/components/modals/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
font-weight: 600;

$size: 8px;
$position-from-right: ($width/2) - $size;
$position-from-right: ($width*0.5) - $size;

@include triangle-point(bottom, $size, $size, $position-from-right, $off-white, 1px, $modal-nav-border-color, -8px);
}
Expand Down
16 changes: 8 additions & 8 deletions src/styles/components/video/_video-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* the License.
*
*/

@use "sass:math";

// Timeline styles
// ----------------------------------------
Expand Down Expand Up @@ -171,14 +171,14 @@ $segment-deleted-selected: saturate(darken($segment-deleted, 25%), 5%);
$sliver-active-stops: ();
$sliver-deleted-stops: ();

@for $j from 0 through floor($segment-sliver-vert-length/$num-colors) {
@for $j from 0 through floor(math.div($segment-sliver-vert-length, $num-colors)) {
@for $i from 1 through $num-colors {
$active-color: nth($segment-sliver-active-colors, $i);
$deleted-color: nth($segment-sliver-deleted-colors, $i);
$new-active-stops: $active-color percentage(($i - 1) / $segment-sliver-vert-length + $j * $num-colors / $segment-sliver-vert-length),
$active-color percentage($i / $segment-sliver-vert-length + $j * $num-colors / $segment-sliver-vert-length);
$new-deleted-stops: $deleted-color percentage(($i - 1) / $segment-sliver-vert-length + $j * $num-colors / $segment-sliver-vert-length),
$deleted-color percentage($i / $segment-sliver-vert-length + $j * $num-colors / $segment-sliver-vert-length);
$new-active-stops: $active-color percentage(math.div($i - 1, $segment-sliver-vert-length) + math.div($j * $num-colors, $segment-sliver-vert-length)),
$active-color percentage(math.div($i, $segment-sliver-vert-length) + math.div($j * $num-colors, $segment-sliver-vert-length));
$new-deleted-stops: $deleted-color percentage(math.div($i - 1, $segment-sliver-vert-length) + math.div($j * $num-colors, $segment-sliver-vert-length)),
$deleted-color percentage(math.div($i, $segment-sliver-vert-length) + math.div($j * $num-colors, $segment-sliver-vert-length));
$sliver-active-stops: join($sliver-active-stops, $new-active-stops, comma);
$sliver-deleted-stops: join($sliver-deleted-stops, $new-deleted-stops, comma);
}
Expand Down Expand Up @@ -465,8 +465,8 @@ $segment-deleted-selected: saturate(darken($segment-deleted, 25%), 5%);

$handle-size: 14px;
.handle {
bottom: ($handle-size/-2) + 1;
left: ($handle-size/-2);
bottom: math.div($handle-size, -2) + 1;
left: math.div($handle-size, -2);
width: $handle-size;
height: $handle-size;
border-radius: $handle-size;
Expand Down
2 changes: 1 addition & 1 deletion src/styles/mixins/_mixins-config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
// Base styles
position: absolute;
top: 52px;
left: -($width / 2 - 20);
left: -($width * 0.5 - 20);
z-index: $max-z - 9;
visibility: hidden;
opacity: 0;
Expand Down

0 comments on commit da2ca5d

Please sign in to comment.