diff --git a/deno.json b/deno.json index 2fea3a9..d3075e6 100644 --- a/deno.json +++ b/deno.json @@ -3,14 +3,9 @@ "react": "https://esm.sh/preact@10.18.1/compat", "react/": "https://esm.sh/preact@10.18.1/compat/" }, - "tasks": {"go": "deno run -A styles.tsx"}, + "tasks": {"go": "deno run -A styler.tsx"}, "compilerOptions": { "jsx": "react-jsx", - "jsxImportSource": "https://esm.sh/preact@10.18.1", - "lib": [ - "deno.window", - "dom", - "dom.asynciterable" - ] + "lib": ["deno.window","dom","dom.asynciterable"] } } \ No newline at end of file diff --git a/deno.lock b/deno.lock deleted file mode 100644 index c222923..0000000 --- a/deno.lock +++ /dev/null @@ -1,8 +0,0 @@ -{ - "version": "3", - "remote": { - "https://esm.sh/preact@10.18.1/jsx-runtime": "019f849249d70baa9aefb684a8f1fbc350a893beae719a60b6c80adf3463b073", - "https://esm.sh/stable/preact@10.18.1/denonext/jsx-runtime.js": "be3f1ff4c3c03b08ed19d69428e35bf3d90360a8e081a2e60075ddfd38fd86df", - "https://esm.sh/stable/preact@10.18.1/denonext/preact.mjs": "b2ad171554b90f2be0f30b1318f63d0df90420b2bdb727fddd97193daa177f84" - } -} diff --git a/gale-custom.tsx b/gale-custom.tsx new file mode 100644 index 0000000..828f76e --- /dev/null +++ b/gale-custom.tsx @@ -0,0 +1,3 @@ +import {config} from "./gale.tsx"; + +export default config({other:"lol"}); \ No newline at end of file diff --git a/gale.tsx b/gale.tsx new file mode 100644 index 0000000..f7fce67 --- /dev/null +++ b/gale.tsx @@ -0,0 +1,46 @@ + +const typeface = { + sans: "sans serif", + serif: "Times New Roman" +}; +const sizes = { + small: "1rem", + large: "3rem" +}; +const colors = { + red: "#ff2200", + blue: "#0022ff" +}; + + +function Mapper>(property:string, lut:T) +{ + return new Proxy(lut, {get(target, prop){ + console.log("read", prop); + return property + ": " + lut[prop as string] + }}); +} +function Query() +{ + console.log("query start") + return (...args:string[])=> + { + console.log("query stop") + } +} + +export function config(obj:T) +{ + const CSS = { + mq:"", + get MD() + { + return Query(); + }, + Face: Mapper("font-family", {...typeface, ...obj}), + Pad:Mapper("padding", sizes) + }; + return CSS; +} + +export default config({}); \ No newline at end of file diff --git a/scratch.html b/scratch.html deleted file mode 100644 index 31cad86..0000000 --- a/scratch.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -
-hey -
\ No newline at end of file diff --git a/styler.tsx b/styler.tsx index e62884b..778d433 100644 --- a/styler.tsx +++ b/styler.tsx @@ -1,4 +1,3 @@ -import * as Gusto from "./styles.tsx"; - -Gusto.colors["me"] = "#ffaa00"; +import Gale from "./gale-custom.tsx"; +Gale.MD(Gale.Face.other); diff --git a/styles.tsx b/styles.tsx deleted file mode 100644 index 82c6b91..0000000 --- a/styles.tsx +++ /dev/null @@ -1,65 +0,0 @@ - -export const typeface = { - sans: "sans serif", - serif: "Times New Roman" -}; -export const sizes = { - small: "1rem", - large: "3rem" -}; -export const colors = { - red: "#ff2200", - blue: "#0022ff" -}; -export let userFonts = {other:"lol"}; - -const CSS = { - mq:"", - get MD() - { - console.log("media query start") - return (...args:string[])=> - { - console.log("md stop") - } - - }, - get Face() - { - /* - const context = "font-family" - return new Proxy(typeface, {get(target, prop){ - return context + ": " + target[prop] - }}); - */ - return Mapper("font-family", {...typeface, ...userFonts}); - }, - Pad:Mapper("padding", sizes) -}; - -function Mapper>(property:string, lut:T) -{ - return new Proxy(lut, {get(target, prop){ - console.log("read", prop); - return property + ": " + lut[prop as string] - }}); -} -function Query() -{ - console.log("md start") - return (...args:string[])=> - { - CSS.mq = "med"; - //args.forEach(arg=>arg); - CSS.mq = ""; - console.log("md stop") - } - -} - - -CSS.Pad.large; - -CSS.MD(CSS.Pad.large, CSS.Face.sans); - -CSS.Face.serif; \ No newline at end of file