0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
svelte/test/js/samples/css-media-query/expected.js

57 lines
1.2 KiB
JavaScript
Raw Normal View History

/* generated by Svelte vX.Y.Z */
2017-09-16 21:09:38 +02:00
import { appendNode, assign, createElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
2017-07-25 00:36:22 +02:00
function encapsulateStyles(node) {
setAttribute(node, "svelte-2363328337", "");
}
function add_css() {
var style = createElement("style");
2017-07-25 00:36:22 +02:00
style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head);
2017-07-25 00:36:22 +02:00
}
function create_main_fragment(state, component) {
2017-07-25 00:36:22 +02:00
var div;
return {
2017-09-19 04:00:28 +02:00
c: function create() {
2017-09-03 23:18:59 +02:00
div = createElement("div");
2017-09-19 04:00:28 +02:00
this.h();
2017-07-25 00:36:22 +02:00
},
2017-09-19 04:00:28 +02:00
h: function hydrate() {
2017-09-03 23:18:59 +02:00
encapsulateStyles(div);
2017-07-25 00:36:22 +02:00
},
2017-09-19 04:00:28 +02:00
m: function mount(target, anchor) {
2017-09-03 23:18:59 +02:00
insertNode(div, target, anchor);
2017-07-25 00:36:22 +02:00
},
2017-09-19 04:00:28 +02:00
p: noop,
2017-08-14 04:36:39 +02:00
2017-09-19 04:00:28 +02:00
u: function unmount() {
2017-09-03 23:18:59 +02:00
detachNode(div);
2017-07-25 00:36:22 +02:00
},
2017-09-19 04:00:28 +02:00
d: noop
2017-07-25 00:36:22 +02:00
};
}
function SvelteComponent(options) {
2017-09-16 21:09:38 +02:00
init(this, options);
2017-10-15 22:17:48 +02:00
this._state = assign({}, options.data);
2017-07-25 00:36:22 +02:00
if (!document.getElementById("svelte-2363328337-style")) add_css();
2017-07-25 00:36:22 +02:00
this._fragment = create_main_fragment(this._state, this);
2017-07-25 00:36:22 +02:00
if (options.target) {
2017-09-19 04:00:28 +02:00
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
2017-07-25 00:36:22 +02:00
}
}
2017-09-16 17:08:41 +02:00
assign(SvelteComponent.prototype, proto);
2017-07-25 00:36:22 +02:00
export default SvelteComponent;