Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cleanup] Remove unused mixins from the codebase #703

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 10 additions & 215 deletions assets/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,61 +22,6 @@
// THE SOFTWARE.
//

// ---- LEGACY IE SUPPORT USING FILTERS ----
// Should IE filters be used or not?
// PROS: gradients, drop shadows etc will be handled by css.
// CONS: will harm the site performance badly,
// especially on sites with heavy rendering and scripting.
$useIEFilters: 0;
// might be 0 or 1. disabled by default.
// ---- /LEGACY IE SUPPORT USING FILTERS ----


@mixin background-size ($value) {
-webkit-background-size: $value;
background-size: $value;
}

@mixin border-image ($path, $offsets, $repeats) {
-moz-border-image: $path $offsets $repeats;
-o-border-image: $path $offsets $repeats;
-webkit-border-image: $path $offsets $repeats;
border-image: $path $offsets $repeats;
}

@mixin border-radius ($values...) {
-moz-border-radius: $values;
-webkit-border-radius: $values;
border-radius: $values;
/*-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;*/
}

@mixin box-shadow ($values...) {
-moz-box-shadow: $values;
-webkit-box-shadow: $values;
box-shadow: $values;
}

//@mixin box-shadow ($x, $y, $offset, $hex, $ie: $useIEFilters, $inset: null, $spread:null) {
// -moz-box-shadow: $x $y $offset $spread $hex $inset;
// -webkit-box-shadow: $x $y $offset $spread $hex $inset;
// box-shadow: $x $y $offset $spread $hex $inset;
//
// @if $ie == 1 {
// $iecolor: '#' + red($hex) + green($hex) + blue($hex);
// filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}');
// -ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'));
// }
//}

@mixin box-sizing($value) {
-moz-box-sizing: $value;
-webkit-box-sizing: $value;
box-sizing: $value;
}

// requires sass 3.2
@mixin keyframes($name){
@-moz-keyframes #{$name} { @content; }
Expand All @@ -86,169 +31,23 @@ $useIEFilters: 0;
@keyframes #{$name} { @content; }
}

@mixin linear-gradient($from, $to, $ie: $useIEFilters) {
@if $ie != 1 { background-color: $to; }

background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, $from),color-stop(1, $to));
background-image: -webkit-linear-gradient(top, $from, $to);
background-image: -moz-linear-gradient(top, $from, $to);
background-image: -ms-linear-gradient(top, $from, $to);
background-image: -o-linear-gradient(top, $from, $to);
background-image: linear-gradient(top, bottom, $from, $to);

@if $ie == 1 {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}');
}
}

@mixin horizontal-gradient($startColor: #555, $endColor: #333, $ie: $useIEFilters) {
@if $ie != 1 { background-color: $endColor; }

background-color: $endColor;
background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
background-repeat: repeat-x;
@if $ie == 1 {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=1);
}
}

@mixin radial-gradient($from, $to, $ie: $useIEFilters) {
@if $ie != 1 { background-color: $to; }

background: -moz-radial-gradient(center, circle cover, $from 0%, $to 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, $from), color-stop(100%, $to));
background: -webkit-radial-gradient(center, circle cover, $from 0%, $to 100%);
background: -o-radial-gradient(center, circle cover, $from 0%, $to 100%);
background: -ms-radial-gradient(center, circle cover, $from 0%, $to 100%);
background: radial-gradient(center, circle cover, $from 0%, $to 100%);
background-color: $from;

@if $ie == 1 {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}', GradientType=1); /* IE6-9 fallback on horizontal gradient */
}
}

@mixin perspective($perspective) {
-moz-perspective: $perspective;
-ms-perspective: $perspective;
-webkit-perspective: $perspective;
perspective: $perspective;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}

@mixin transform ($transforms) {
-moz-transform: $transforms;
-o-transform: $transforms;
-ms-transform: $transforms;
-webkit-transform: $transforms;
transform: $transforms;
}

@mixin matrix ($a, $b, $c, $d, $e, $f) {
-moz-transform: matrix($a, $b, $c, $d, #{$e}px, #{$f}px);
-o-transform: matrix($a, $b, $c, $d, $e, $f);
-ms-transform: matrix($a, $b, $c, $d, $e, $f);
-webkit-transform: matrix($a, $b, $c, $d, $e, $f);
transform: matrix($a, $b, $c, $d, $e, $f);
}

@mixin rotate ($deg) {
@include transform(rotate(#{$deg}deg));
}

@mixin scale ($size) {
@include transform(scale(#{$size}));
}

@mixin translate ($x, $y) {
@include transform(translate($x, $y));
}

@mixin transition ($value...) {
-moz-transition: $value;
-o-transition: $value;
-ms-transition: $value;
-webkit-transition: $value;
transition: $value;
}

@mixin animation($str) {
-webkit-animation: #{$str};
-moz-animation: #{$str};
-ms-animation: #{$str};
-o-animation: #{$str};
animation: #{$str};
@mixin transform($transforms) {
transform: $transforms;
}

@mixin animation-name($str) {
-webkit-animation-name: #{$str};
-moz-animation-name: #{$str};
-ms-animation-name: #{$str};
-o-animation-name: #{$str};
animation-name: #{$str};
@mixin rotate($deg) {
@include transform(rotate(#{$deg}deg));
}

@mixin animation-duration($str) {
-webkit-animation-duration: #{$str};
-moz-animation-duration: #{$str};
-ms-animation-duration: #{$str};
-o-animation-duration: #{$str};
animation-duration: #{$str};
@mixin scale($size) {
@include transform(scale(#{$size}));
}

@mixin animation-direction($str) {
-webkit-animation-direction: #{$str};
-moz-animation-direction: #{$str};
-ms-animation-direction: #{$str};
-o-animation-direction: #{$str};
animation-direction: #{$str};
}

@mixin animation-delay($str) {
animation-delay:#{$str};
-o-animation-delay:#{$str};
-ms-animation-delay:#{$str};
-webkit-animation-delay:#{$str};
-moz-animation-delay:#{$str};
}

@mixin animation-iteration-count($str) {
animation-iteration-count:#{$str};
-o-animation-iteration-count:#{$str};
-ms-animation-iteration-count:#{$str};
-webkit-animation-iteration-count:#{$str};
-moz-animation-iteration-count:#{$str};
}

@mixin animation-timing-function($str) {
-webkit-animation-timing-function: #{$str};
-moz-animation-timing-function: #{$str};
-ms-animation-timing-function: #{$str};
-o-animation-timing-function: #{$str};
animation-timing-function: #{$str};
@mixin translate($x, $y) {
@include transform(translate($x, $y));
}

// ==== /CSS3 SASS MIXINS ====

@mixin opacity($opacity) {
opacity: $opacity;
$opacity-ie: $opacity * 100;
filter: alpha(opacity=$opacity-ie); //IE8
}

@mixin size($width, $height: $width)
{
width: $width;
height: $height;
}

@mixin clearfix
{
&:after {
Expand All @@ -260,11 +59,7 @@ $useIEFilters: 0;

// Placeholder text
@mixin placeholder($color: $input-color-placeholder) {
// Firefox
&::-moz-placeholder {
&::placeholder {
color: $color;
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
}
&:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
&::-webkit-input-placeholder { color: $color; } // Safari and Chrome
}
}
14 changes: 7 additions & 7 deletions assets/scss/admin/_ajax-loader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ $size: 20;
background-color: $color;
width: #{$size}px;
height: #{$size}px;
@include animation-name(bounce_ajaxLoader);
@include animation-duration(1.5s);
@include animation-iteration-count(infinite);
@include animation-direction(normal);
@include transform(.3);
animation-name: bounce_ajaxLoader;
animation-duration: 1.5s;
animation-iteration-count: infinite;
animation-direction: normal;
@include transform(scale(.3));
}

@for $i from 0 through 7
{
.fs-ajax-loader-bar-#{$i + 1}
{
left: #{$i*($size - 1)}px;
@include animation-delay(#{0.6 + $i*0.15}s);
animation-delay: #{0.6 + $i*0.15}s;
}
}
}
Expand All @@ -46,4 +46,4 @@ $size: 20;
@include transform(scale(.3));
background-color: $bkg-color;
}
}
}
6 changes: 3 additions & 3 deletions assets/scss/admin/_badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
color: white;
text-transform: uppercase;
padding: 5px 10px;
@include border-radius(3px 0 0 3px);
border-radius: 3px 0 0 3px;
font-weight: bold;
border-right: 0;
@include box-shadow(0 2px 1px -1px rgba(0, 0, 0, .3));
}
box-shadow: 0 2px 1px -1px rgba(0, 0, 0, .3);
}
6 changes: 3 additions & 3 deletions assets/scss/admin/_modal-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@
top: 12px;
cursor: pointer;
color: #bbb;
@include border-radius(20px);
border-radius: 20px;
padding: 3px;
@include transition(all 0.2s ease-in-out);
transition: all 0.2s ease-in-out;

&:hover {
color: #fff;
Expand Down Expand Up @@ -209,4 +209,4 @@

body.has-fs-modal {
overflow: hidden;
}
}
10 changes: 5 additions & 5 deletions assets/scss/admin/_switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $switch-on-color: $wp-button-primary-background-color;
background-image: linear-gradient(to bottom, #ececec, #fff);
box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
z-index: 999;
@include transition(0.40s cubic-bezier(0.54, 1.6, 0.5, 1));
transition: 0.40s cubic-bezier(0.54, 1.6, 0.5, 1);
}

&.fs-off .fs-toggle
Expand All @@ -57,14 +57,14 @@ $switch-on-color: $wp-button-primary-background-color;
{
top: math.div($switch-size, 3);
padding: 4px ($switch-size + 1px);
@include border-radius($switch-size);
border-radius: $switch-size;

.fs-toggle
{
top: 0;
width: $switch-size;
height: $switch-size;
@include border-radius($switch-size);
border-radius: $switch-size;
}

&.fs-off .fs-toggle
Expand Down Expand Up @@ -94,7 +94,7 @@ $switch-on-color: $wp-button-primary-background-color;
top: 0;
width: $switch-small-size;
height: $switch-small-size;
@include border-radius($switch-small-size);
border-radius: $switch-small-size;
}

&.fs-on .fs-toggle
Expand All @@ -103,4 +103,4 @@ $switch-on-color: $wp-button-primary-background-color;
}
}
}
}
}
8 changes: 4 additions & 4 deletions assets/scss/admin/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
opacity: 0;
visibility: hidden;
@include transition(opacity 0.3s ease-in-out);
transition: opacity 0.3s ease-in-out;
position: absolute;
background: $tooltip-bkg-color;
color: $tooltip-color !important;
Expand All @@ -29,8 +29,8 @@
margin-bottom: 5px;
left: -17px;
right: 0;
@include border-radius(5px);
@include box-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
border-radius: 5px;
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
line-height: 1.3em;
font-weight: bold;
text-align: left;
Expand Down Expand Up @@ -72,4 +72,4 @@
opacity: 1;
}
}
}
}
Loading
Loading