1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-10-25 20:26:36 +02:00

Merge pull request #3810 from phwebi/update-display-config

Update `display` config to support `!important` flag.
This commit is contained in:
Hakim El Hattab
2025-08-28 12:01:20 +02:00
committed by GitHub

View File

@@ -52,7 +52,13 @@ export default class SlideContent {
load( slide, options = {} ) {
// Show the slide element
slide.style.display = this.Reveal.getConfig().display;
const displayValue = this.Reveal.getConfig().display;
if( displayValue.includes('!important') ) {
const value = displayValue.replace(/\s*!important\s*$/, '').trim();
slide.style.setProperty('display', value, 'important');
} else {
slide.style.display = displayValue;
}
// Media elements with data-src attributes
queryAll( slide, 'img[data-src], video[data-src], audio[data-src], iframe[data-src]' ).forEach( element => {