|
|
@ -37,7 +37,13 @@ export default function dom(
|
|
|
|
|
|
|
|
|
|
|
|
const add_css = component.get_unique_name('add_css');
|
|
|
|
const add_css = component.get_unique_name('add_css');
|
|
|
|
|
|
|
|
|
|
|
|
if (styles && component.compile_options.css !== false && !options.customElement) {
|
|
|
|
const should_add_css = (
|
|
|
|
|
|
|
|
!options.customElement &&
|
|
|
|
|
|
|
|
styles.length > 0 &&
|
|
|
|
|
|
|
|
options.css !== false
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (should_add_css) {
|
|
|
|
body.push(b`
|
|
|
|
body.push(b`
|
|
|
|
function ${add_css}() {
|
|
|
|
function ${add_css}() {
|
|
|
|
var style = @element("style");
|
|
|
|
var style = @element("style");
|
|
|
@ -65,14 +71,6 @@ export default function dom(
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO injecting CSS this way is kinda dirty. Maybe it should be an
|
|
|
|
|
|
|
|
// explicit opt-in, or something?
|
|
|
|
|
|
|
|
const should_add_css = (
|
|
|
|
|
|
|
|
!options.customElement &&
|
|
|
|
|
|
|
|
component.stylesheet.has_styles &&
|
|
|
|
|
|
|
|
options.css !== false
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const uses_props = component.var_lookup.has('$$props');
|
|
|
|
const uses_props = component.var_lookup.has('$$props');
|
|
|
|
const $$props = uses_props ? `$$new_props` : `$$props`;
|
|
|
|
const $$props = uses_props ? `$$new_props` : `$$props`;
|
|
|
|
const props = component.vars.filter(variable => !variable.module && variable.export_name);
|
|
|
|
const props = component.vars.filter(variable => !variable.module && variable.export_name);
|
|
|
|