@styleframe/loader 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/dist/index.cjs +875 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +874 -0
- package/package.json +19 -9
- package/.tsbuildinfo +0 -1
- package/src/build.ts +0 -34
- package/src/config.ts +0 -36
- package/src/index.ts +0 -3
- package/src/playground/build.ts +0 -13
- package/src/playground/load.ts +0 -9
- package/src/playground/styleframe.config.ts +0 -50
- package/src/playground/watch.ts +0 -9
- package/src/utils.ts +0 -10
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -7
- package/vite.config.ts +0 -13
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { styleframe } from "@styleframe/core";
|
|
2
|
-
|
|
3
|
-
const s = styleframe();
|
|
4
|
-
const { theme, variable, ref, selector, modifier, utility } = s;
|
|
5
|
-
|
|
6
|
-
const colorPrimary = variable("color--primary", "#007bff");
|
|
7
|
-
const colorSecondary = variable("color--secondary", "#6c757d");
|
|
8
|
-
|
|
9
|
-
const cardBackground = variable("card--background", "#ffffff");
|
|
10
|
-
const cardColor = variable("card--color", "#000000");
|
|
11
|
-
|
|
12
|
-
selector(".card", {
|
|
13
|
-
background: ref(cardBackground),
|
|
14
|
-
color: ref(cardColor),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
theme("dark", (ctx) => {
|
|
18
|
-
ctx.variable(cardBackground, "#18181b");
|
|
19
|
-
ctx.variable(cardColor, "#ffffff");
|
|
20
|
-
|
|
21
|
-
ctx.selector(".card", {
|
|
22
|
-
border: ctx.css`1px solid ${ctx.ref(cardBackground)}`,
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
theme("sepia", (ctx) => {
|
|
27
|
-
ctx.variable(cardBackground, "#f5f5dc");
|
|
28
|
-
ctx.variable(cardColor, "#333333");
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const hover = modifier(
|
|
32
|
-
"hover",
|
|
33
|
-
({ declarations, variables, children, selector }) => {
|
|
34
|
-
selector("&:hover", { declarations, variables, children });
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const createBackgroundUtility = utility("background", ({ value }) => ({
|
|
39
|
-
background: value,
|
|
40
|
-
}));
|
|
41
|
-
|
|
42
|
-
createBackgroundUtility(
|
|
43
|
-
{
|
|
44
|
-
primary: ref(colorPrimary),
|
|
45
|
-
secondary: ref(colorSecondary),
|
|
46
|
-
},
|
|
47
|
-
[hover],
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
export default s;
|
package/src/playground/watch.ts
DELETED
package/src/utils.ts
DELETED
package/src/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/tsconfig.json
DELETED
package/vite.config.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createViteConfig } from "@styleframe/config-vite";
|
|
2
|
-
import { VitePluginNode } from "vite-plugin-node";
|
|
3
|
-
|
|
4
|
-
const __dirname = new URL(".", import.meta.url).pathname;
|
|
5
|
-
|
|
6
|
-
export default createViteConfig("loader", __dirname, {
|
|
7
|
-
plugins: [
|
|
8
|
-
VitePluginNode({
|
|
9
|
-
appPath: "./src/index.ts",
|
|
10
|
-
adapter: "express",
|
|
11
|
-
}),
|
|
12
|
-
],
|
|
13
|
-
});
|