```ts filename="src/helpers.ts" renderer="common" language="ts" import { global } from '@storybook/global'; export const clearStyles = (selector: string | string[]) => { const selectors = Array.isArray(selector) ? selector : [selector]; selectors.forEach(clearStyle); }; const clearStyle = (input: string | string[]) => { const selector = typeof input === 'string' ? input : input.join(''); const element = global.document.getElementById(selector); if (element && element.parentElement) { element.parentElement.removeChild(element); } }; export const addOutlineStyles = (selector: string, css: string) => { const existingStyle = global.document.getElementById(selector); if (existingStyle) { if (existingStyle.innerHTML !== css) { existingStyle.innerHTML = css; } } else { const style = global.document.createElement('style'); style.setAttribute('id', selector); style.innerHTML = css; global.document.head.appendChild(style); } }; ```