← All changes
|
src/Agent/workflows/theme/components/change-site-design/DesignOption.jsx
+14
-3
3.0.6
→
trunk
View file →
| @@ -56,14 +56,20 @@ | ||
| 56 | 56 | el.remove(); |
| 57 | 57 | }); |
| 58 | 58 | |
| 59 | 59 | clone.querySelector('#block-style-variation-styles-inline-css')?.remove(); |
| 60 | + clone.querySelector('#extendify-palette-preview-css')?.remove(); | |
| 60 | 61 | clone.querySelector('#admin-bar-inline-css')?.remove(); |
| 62 | + clone.querySelector('#admin-bar-css')?.remove(); | |
| 63 | + clone.querySelector('#extendify-toolbar-reset')?.remove(); | |
| 64 | + body.classList.remove('admin-bar'); | |
| 61 | 65 | |
| 62 | 66 | // Inject variation styles |
| 63 | 67 | const styleEl = head.appendChild(document.createElement('style')); |
| 64 | 68 | styleEl.textContent = [ |
| 65 | 69 | styles?.colorAndFontsVariations ?? '', |
| 70 | + // Ties the option on specificity, so it only wins by coming after it. | |
| 71 | + styles?.paletteCss ?? '', | |
| 66 | 72 | styles?.vibes ?? '', |
| 67 | 73 | styles?.blockSupportsCss ?? '', |
| 68 | 74 | ].join('\n'); |
| 69 | 75 | |
| @@ -81,11 +87,15 @@ | ||
| 81 | 87 | |
| 82 | 88 | const duotoneSvgNodes = getDuotoneSvgNodes(styles?.duotoneTheme); |
| 83 | 89 | |
| 84 | 90 | // Set body to header + hero section, then append duotone SVGs |
| 85 | - const headerHtml = | |
| 86 | - removeAnimationClasses(document.querySelector('header'))?.outerHTML ?? ''; | |
| 87 | - body.innerHTML = `${headerHtml}${lowerImageQuality(renderedHtml)}`; | |
| 91 | + body.removeAttribute('style'); | |
| 92 | + | |
| 93 | + const headerNode = removeAnimationClasses(document.querySelector('header')); | |
| 94 | + headerNode?.classList.remove('is-past-hero', 'is-scrolled'); | |
| 95 | + headerNode?.removeAttribute('style'); | |
| 96 | + const headerHtml = headerNode?.outerHTML ?? ''; | |
| 97 | + body.innerHTML = `${headerHtml}<div class="entry-content">${lowerImageQuality(renderedHtml)}</div>`; | |
| 88 | 98 | duotoneSvgNodes.forEach((node) => { |
| 89 | 99 | body.appendChild(node); |
| 90 | 100 | }); |
| 91 | 101 | |
| @@ -101,8 +111,9 @@ | ||
| 101 | 111 | [ |
| 102 | 112 | renderedHtml, |
| 103 | 113 | styles?.linkStyles, |
| 104 | 114 | styles?.colorAndFontsVariations, |
| 115 | + styles?.paletteCss, | |
| 105 | 116 | styles?.duotoneTheme, |
| 106 | 117 | styles?.vibes, |
| 107 | 118 | styles?.blockSupportsCss, |
| 108 | 119 | ], |