Skip to content

Commit 53c45ec

Browse files
crisbetojelbourn
authored andcommitted
refactor: remove css transform utility (#9571)
The applyCssTransform utility is no longer necessary since none of the browser we support need a prefix. This is a resubmit of #6938.
1 parent a5ca9ce commit 53c45ec

File tree

4 files changed

+2
-34
lines changed

4 files changed

+2
-34
lines changed

src/lib/core/public-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export * from './option/index';
1717
export * from './label/label-options';
1818
export * from './ripple/index';
1919
export * from './selection/index';
20-
export * from './style/index';
2120

2221
/**
2322
* @deprecated

src/lib/core/style/apply-transform.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/lib/core/style/index.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/lib/slide-toggle/slide-toggle.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
} from '@angular/core';
2727
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
2828
import {
29-
applyCssTransform,
3029
CanColor,
3130
CanDisable,
3231
CanDisableRipple,
@@ -340,7 +339,7 @@ class SlideToggleRenderer {
340339
this._thumbEl.classList.remove('mat-dragging');
341340

342341
// Reset the transform because the component will take care of the thumb position after drag.
343-
applyCssTransform(this._thumbEl, '');
342+
this._thumbEl.style.transform = '';
344343

345344
return this.dragPercentage > 50;
346345
}
@@ -350,7 +349,7 @@ class SlideToggleRenderer {
350349
this.dragPercentage = this._getDragPercentage(distance);
351350
// Calculate the moved distance based on the thumb bar width.
352351
const dragX = (this.dragPercentage / 100) * this._thumbBarWidth;
353-
applyCssTransform(this._thumbEl, `translate3d(${dragX}px, 0, 0)`);
352+
this._thumbEl.style.transform = `translate3d(${dragX}px, 0, 0)`;
354353
}
355354

356355
/** Retrieves the percentage of thumb from the moved distance. Percentage as fraction of 100. */

0 commit comments

Comments
 (0)