@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.
@@ -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;
@@ -1,9 +0,0 @@
1
- import { watchConfiguration } from "../config";
2
-
3
- const __dirname = new URL(".", import.meta.url).pathname;
4
-
5
- (async () => {
6
- const config = await watchConfiguration({ cwd: __dirname });
7
-
8
- console.log(config);
9
- })();
package/src/utils.ts DELETED
@@ -1,10 +0,0 @@
1
- import { stat } from "node:fs/promises";
2
-
3
- export async function directoryExists(path: string) {
4
- try {
5
- const stats = await stat(path);
6
- return stats.isDirectory();
7
- } catch {
8
- return false;
9
- }
10
- }
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
package/tsconfig.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "@styleframe/config-typescript",
3
- "compilerOptions": {
4
- "tsBuildInfoFile": ".tsbuildinfo"
5
- },
6
- "include": ["src/**/*.ts", "tsup.config.ts", "vite.config.ts"]
7
- }
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
- });