Skip to content

Commit

Permalink
fix issue were auto-animate could interfere with inherited line-height
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Aug 14, 2022
1 parent a0e4860 commit b23d15c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions js/controllers/autoanimate.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,14 @@ export default class AutoAnimate {
value = { value: style.to, explicitValue: true };
}
else {
value = computedStyles[style.property];
// Use a unitless value for line-height so that it inherits properly
if( style.property === 'line-height' ) {
value = parseFloat( computedStyles['line-height'] ) / parseFloat( computedStyles['font-size'] );
}

if( isNaN(value) ) {
value = computedStyles[style.property];
}
}

if( value !== '' ) {
Expand Down Expand Up @@ -475,7 +482,6 @@ export default class AutoAnimate {
} );

pairs.forEach( pair => {

// Disable scale transformations on text nodes, we transition
// each individual text property instead
if( matches( pair.from, textNodes ) ) {
Expand Down

0 comments on commit b23d15c

Please sign in to comment.