Added theme archvier and changes to blocks
This commit is contained in:
@ -21,5 +21,22 @@
|
||||
*/
|
||||
|
||||
/* eslint-disable no-console */
|
||||
console.log( 'Hello World! (from create-block-lcp-viewport block)' );
|
||||
/* eslint-enable no-console */
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Get the element with the id "lcp-header-container"
|
||||
var headerContainer = document.getElementById('lcp-header-container');
|
||||
|
||||
// Check if the element exists
|
||||
if (headerContainer) {
|
||||
// Get the height of the header container
|
||||
var headerHeight = headerContainer.offsetHeight;
|
||||
|
||||
// Get the current value of the --lcp--header--height custom property
|
||||
var currentHeaderHeight = getComputedStyle(document.documentElement).getPropertyValue('--lcp--header--height').trim();
|
||||
|
||||
// Compare if the current value is different from the new headerHeight (in px)
|
||||
if (currentHeaderHeight !== headerHeight + 'px') {
|
||||
// If they are different, update the --lcp--header--height custom property
|
||||
document.documentElement.style.setProperty('--lcp--header--height', headerHeight + 'px');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user