only add third argument for custom elements

pull/12777/head
Rich Harris 2 years ago
parent 232cf4a599
commit a09f81ff2c

@ -381,7 +381,7 @@ export function client_component(analysis, options) {
component_block.body.unshift(
b.stmt(
b.call('$.append_styles', b.id('$$anchor'), b.id('$$css'), b.literal(options.customElement))
b.call('$.append_styles', b.id('$$anchor'), b.id('$$css'), options.customElement && b.true)
)
);
}

@ -6,9 +6,9 @@ var seen = new Set();
/**
* @param {Node} anchor
* @param {{ hash: string, code: string }} css
* @param {boolean} is_custom_element
* @param {boolean} [is_custom_element]
*/
export function append_styles(anchor, css, is_custom_element) {
export function append_styles(anchor, css, is_custom_element = false) {
// in dev, always check the DOM, so that styles can be replaced with HMR
if (!DEV && !is_custom_element) {
if (seen.has(css)) return;

Loading…
Cancel
Save