Skip to content

Commit

Permalink
fix(skeleton): updates skeleton state performance (#7965)
Browse files Browse the repository at this point in the history
* fix(skeleton): updates skeleton state performance

* chore(tests): update snapshots
  • Loading branch information
tw15egan authored Mar 4, 2021
1 parent d944ac5 commit 4a3955e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 66 deletions.
2 changes: 1 addition & 1 deletion config/browserslist-config-carbon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

'use strict';

module.exports = ['last 1 versions', 'ie >= 11', 'Firefox ESR'];
module.exports = ['last 1 version', 'ie >= 11', 'Firefox ESR'];
9 changes: 1 addition & 8 deletions packages/components/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,7 @@ gulp.task('sass:dev', () => {
})
).on('error', sass.logError)
)
.pipe(
postcss([
customProperties(),
autoprefixer({
browsers: ['> 1%', 'last 2 versions'],
}),
])
)
.pipe(postcss([customProperties(), autoprefixer()]))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('demo'))
.pipe(browserSync.stream({ match: '**/*.css' }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,43 +51,34 @@ em {
@keyframes skeleton {
0% {
right: auto;
left: 0;
width: 0%;
transform: scaleX(0);
transform-origin: left;
opacity: 0.3; }
20% {
right: auto;
left: 0;
width: 100%;
transform: scaleX(1);
transform-origin: left;
opacity: 1; }
28% {
right: 0;
left: auto;
width: 100%; }
transform: scaleX(1);
transform-origin: right; }
51% {
right: 0;
left: auto;
width: 0%; }
transform: scaleX(0);
transform-origin: right; }
58% {
right: 0;
left: auto;
width: 0%; }
transform: scaleX(0);
transform-origin: right; }
82% {
right: 0;
left: auto;
width: 100%; }
transform: scaleX(1);
transform-origin: right; }
83% {
right: auto;
left: 0;
width: 100%; }
transform: scaleX(1);
transform-origin: left; }
96% {
right: auto;
left: 0;
width: 0%; }
transform: scaleX(0);
transform-origin: left; }
100% {
right: auto;
left: 0;
width: 0%;
transform: scaleX(0);
transform-origin: left;
opacity: 0.3; } }
.bx--grid {
Expand Down
50 changes: 20 additions & 30 deletions packages/components/src/globals/scss/_helper-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,12 @@

&::before {
position: absolute;
top: 0;
left: 0;
width: 0%;
width: 100%;
height: 100%;
background: $skeleton-02;
animation: 3000ms ease-in-out skeleton infinite;
content: '';
will-change: transform-origin, transform, opacity;

@media (prefers-reduced-motion: reduce) {
animation: none;
Expand All @@ -202,51 +201,42 @@
@include exports('skeleton') {
@keyframes skeleton {
0% {
right: auto;
left: 0;
width: 0%;
transform: scaleX(0);
transform-origin: left;
opacity: 0.3;
}
20% {
right: auto;
left: 0;
width: 100%;
transform: scaleX(1);
transform-origin: left;
opacity: 1;
}
28% {
right: 0;
left: auto;
width: 100%;
transform: scaleX(1);
transform-origin: right;
}
51% {
right: 0;
left: auto;
width: 0%;
transform: scaleX(0);
transform-origin: right;
}
58% {
right: 0;
left: auto;
width: 0%;
transform: scaleX(0);
transform-origin: right;
}
82% {
right: 0;
left: auto;
width: 100%;
transform: scaleX(1);
transform-origin: right;
}
83% {
right: auto;
left: 0;
width: 100%;
transform: scaleX(1);
transform-origin: left;
}
96% {
right: auto;
left: 0;
width: 0%;
transform: scaleX(0);
transform-origin: left;
}
100% {
right: auto;
left: 0;
width: 0%;
transform: scaleX(0);
transform-origin: left;
opacity: 0.3;
}
}
Expand Down

0 comments on commit 4a3955e

Please sign in to comment.