UNPKG

@100mslive/roomkit-react

Version:

![Banner](https://github.com/100mslive/web-sdks/blob/06c65259912db6ccd8617f2ecb6fef51429251ec/prebuilt-banner.png)

33 lines (30 loc) 1.05 kB
import { useEffect, useRef } from 'react'; export const useEmojiPickerStyles = showing => { const ref = useRef(null); useEffect(() => { if (showing) { setTimeout(() => { const root = ref.current?.querySelector('em-emoji-picker')?.shadowRoot; const style = document.createElement('style'); style.textContent = ` #root { --em-rgb-color: var(--hms-ui-colors-on_surface_high); --em-rgb-input: var(--hms-ui-colors-on_primary_high); --em-color-border: var(--hms-ui-colors-surface_bright); --color-b: var(--hms-ui-colors-on_surface_high); --rgb-background: transparent; color: var(--hms-ui-colors-on_surface_high); font-family: var(--hms-ui-fonts-sans); } .sticky { top: 0.25rem; background-color: var(--hms-ui-colors-surface_bright); margin-top: 0.5rem; } `; root?.appendChild(style); }, 0); } }, [showing]); return ref; };