The parent element containing the slot
Slot element, cloned element, or null if not found
const container = document.createElement('div');
const slotElement = document.createElement('div');
slotElement.setAttribute('slot', 'content');
slotElement.setAttribute('styled', '');
container.appendChild(slotElement);
const result = createStyledSlotOrClone({ element: container, slotRef: 'content' });
// Returns a slot element for styled content
Creates a slot element or clones the element based on 'styled' attribute
If the element has a 'styled' attribute, returns a slot reference. Otherwise, clones the element without the slot attribute.