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

fix(skeleton): updates skeleton state performance #7965

Merged
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
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