diff --git a/examples/example.html b/examples/example.html
deleted file mode 100644
index 93a1e8b..0000000
--- a/examples/example.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
Counter
-
Value: {use(this.counter)}
-
-
- is {use(this.counter)} odd?{' '}
- {use(this.counter, (p) => p % 2 == 1)}
-
-
- )
-}
-//
-// function ToDoList() {
-// let css = styled.new`
-// self {
-// color: #e0def4;
-// display:flex;
-// flex-direction:column;
-// }
-//
-// .todoitem {
-// display:flex;
-// }
-// `
-//
-// this.tasks = [];
-// this.text = "Enter a task here...";
-//
-// let addTask = () => {
-// if (!this.text) return;
-// this.tasks = [...this.tasks, this.text];
-// this.text = "";
-// };
-//
-// return (
-//
-//
-// addTask()} />
-//
-//
-//
-//
-// {task}
-//
-//
-// } />
-//
-// )
-// }
-//
-//
-// function Index() {
-// let css = styled.new`
-// h1 {
-// font-size: 40px;
-// text-align:center;
-// }
-// p {
-// text-align:center;
-// font-size:15px;
-// }
-// div {
-// /* margin-bottom:3em; */
-// }
-// examples {
-// display: flex;
-// justify-content: center;
-// flex-direction: column;
-// }
-// `;
-//
-// this.c = 5;
-//
-// this.counterobj;
-//
-// return (
-//
-//
-// {/*
*/}
-// {/*
Dreamland Examples
*/}
-// {/*
Some examples of dreamland.js components. Code is in examples/
*/}
-// {/*
*/}
-// {/*
*/}
-// {/* */}
-// {/* */}
-// {/* */}
-// {/* stuff: {use(this.counterobj.counter)} */}
-// {/*
*/}
-//
-// );
-// }
-
-window.addEventListener('load', () => {
- document.body.appendChild(
)
-})
-
-let a = stateful({
- b: stateful({ c: stateful({ d: 0 }) }),
- array: [
- [1, 2, 3],
- [4, 5, 6],
- [7, 8, 9],
- ],
-}) as any
-let r = use(a.array[a.b.c.d][a.b.c.d])
-
-handle(r, (v) => {
- console.log(v)
-})
diff --git a/src/css.js b/src/css.js
index a8b6fb0..f56787f 100644
--- a/src/css.js
+++ b/src/css.js
@@ -23,23 +23,21 @@ export function css(strings, ...values) {
let selfstr = ''
// compat layer for older browsers. when css nesting stablizes this can be removed
- for (; ;) {
+ for (;;) {
let [first, ...rest] = str.split('\n')
- if (first.trim().endsWith('{')) break;
+ if (first.trim().endsWith('{')) break
selfstr += first + '\n'
str = rest.join('\n')
}
styleElement.textContent = str
-
for (const rule of styleElement.sheet.cssRules) {
rule.selectorText = `.${uid} ${rule.selectorText}`
newstr += rule.cssText + '\n'
}
styleElement.textContent = `.${uid} {${selfstr}}` + '\n' + newstr
- console.log(styleElement.textContent)
cssmap[str] = uid
return uid