| @@ -1,4 +1,5 @@ | ||
| 1 | +import { useSiteVibesVariations } from '@agent/hooks/useSiteVibesVariations'; | |
| 1 | 2 | import { refreshBlockHighlight } from '@agent/lib/block-highlight'; |
| 2 | 3 | import { isInEditor } from '@agent/lib/util'; |
| 3 | 4 | import { useCallback, useEffect, useRef, useState } from '@wordpress/element'; |
| 4 | 5 | |
| @@ -13,12 +14,14 @@ | ||
| 13 | 14 | |
| 14 | 15 | // update the CSS so that it won't affect the switcher preview area |
| 15 | 16 | const transformVibeCSS = (css, slug) => css.replaceAll(slug, 'natural-1'); |
| 16 | 17 | |
| 17 | -export const useSiteVibesOverride = ({ css, slug }) => { | |
| 18 | +export const useSiteVibesOverride = ({ css: vibeCss, slug }) => { | |
| 18 | 19 | const blockStyles = useRef(null); |
| 19 | 20 | const [theDocument, setDocument] = useState(null); |
| 20 | 21 | const onEditor = isInEditor(); |
| 22 | + const { data } = useSiteVibesVariations(); | |
| 23 | + const css = vibeCss ? `${data?.resets?.[slug] ?? ''}${vibeCss}` : vibeCss; | |
| 21 | 24 | |
| 22 | 25 | useEffect(() => { |
| 23 | 26 | if (!css || onEditor || !slug) return; |
| 24 | 27 | const style = document.getElementById(styleId); |