Skip to content

Commit b23d15c

Browse files
committed
fix issue were auto-animate could interfere with inherited line-height
1 parent a0e4860 commit b23d15c

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

dist/reveal.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reveal.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reveal.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reveal.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/controllers/autoanimate.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,14 @@ export default class AutoAnimate {
399399
value = { value: style.to, explicitValue: true };
400400
}
401401
else {
402-
value = computedStyles[style.property];
402+
// Use a unitless value for line-height so that it inherits properly
403+
if( style.property === 'line-height' ) {
404+
value = parseFloat( computedStyles['line-height'] ) / parseFloat( computedStyles['font-size'] );
405+
}
406+
407+
if( isNaN(value) ) {
408+
value = computedStyles[style.property];
409+
}
403410
}
404411

405412
if( value !== '' ) {
@@ -475,7 +482,6 @@ export default class AutoAnimate {
475482
} );
476483

477484
pairs.forEach( pair => {
478-
479485
// Disable scale transformations on text nodes, we transition
480486
// each individual text property instead
481487
if( matches( pair.from, textNodes ) ) {

0 commit comments

Comments
 (0)