@csslit/core 0.0.2
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/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gabriel Valfridsson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# csslit
|
|
2
|
+
|
|
3
|
+
Compile-time CSS template literals for Vite.
|
|
4
|
+
|
|
5
|
+
Install `@csslit/core` together with `@csslit/vite-plugin`:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @csslit/core @csslit/vite-plugin
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
See the [project README](https://github.com/csslit/csslit#readme) for configuration and usage.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
type CssTag = ((_strings: TemplateStringsArray, ..._values: unknown[]) => string) & {
|
|
3
|
+
global: (_strings: TemplateStringsArray, ..._values: unknown[]) => void;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* A compile-time CSS template literal tag.
|
|
7
|
+
* The `csslit` Vite plugin intercepts this tag and statically extracts the styling at build time.
|
|
8
|
+
*/
|
|
9
|
+
declare const css: CssTag;
|
|
10
|
+
declare function comptime<T>(value: T): T;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { CssTag, comptime, css };
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/index.ts
|
|
2
|
+
function cssTag(_strings, ..._values) {
|
|
3
|
+
throw new Error("csslit: The `css` template tag was executed at runtime! This means the `@csslit/vite-plugin` is missing from your Vite configuration or failed to parse this file. Please ensure the plugin is added to your vite.config.ts plugins array.");
|
|
4
|
+
}
|
|
5
|
+
function globalCssTag(_strings, ..._values) {
|
|
6
|
+
throw new Error("csslit: The `css.global` template tag was executed at runtime! This means the `@csslit/vite-plugin` is missing from your Vite configuration or failed to parse this file. Please ensure the plugin is added to your vite.config.ts plugins array.");
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A compile-time CSS template literal tag.
|
|
10
|
+
* The `csslit` Vite plugin intercepts this tag and statically extracts the styling at build time.
|
|
11
|
+
*/
|
|
12
|
+
const css = Object.assign(cssTag, { global: globalCssTag });
|
|
13
|
+
function comptime(value) {
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { comptime, css };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["function cssTag(_strings: TemplateStringsArray, ..._values: unknown[]): string {\n throw new Error(\n \"csslit: The `css` template tag was executed at runtime! \" +\n \"This means the `@csslit/vite-plugin` is missing from your Vite configuration or failed to parse this file. \" +\n \"Please ensure the plugin is added to your vite.config.ts plugins array.\",\n );\n}\n\nfunction globalCssTag(_strings: TemplateStringsArray, ..._values: unknown[]): void {\n throw new Error(\n \"csslit: The `css.global` template tag was executed at runtime! \" +\n \"This means the `@csslit/vite-plugin` is missing from your Vite configuration or failed to parse this file. \" +\n \"Please ensure the plugin is added to your vite.config.ts plugins array.\",\n );\n}\n\nexport type CssTag = ((_strings: TemplateStringsArray, ..._values: unknown[]) => string) & {\n global: (_strings: TemplateStringsArray, ..._values: unknown[]) => void;\n};\n\n/**\n * A compile-time CSS template literal tag.\n * The `csslit` Vite plugin intercepts this tag and statically extracts the styling at build time.\n */\nexport const css: CssTag = Object.assign(cssTag, {\n global: globalCssTag,\n});\n\nexport function comptime<T>(value: T): T {\n return value;\n}\n"],"mappings":";AAAA,SAAS,OAAO,UAAgC,GAAG,SAA4B;CAC7E,MAAM,IAAI,MACR,4OAGF;AACF;AAEA,SAAS,aAAa,UAAgC,GAAG,SAA0B;CACjF,MAAM,IAAI,MACR,mPAGF;AACF;;;;;AAUA,MAAa,MAAc,OAAO,OAAO,QAAQ,EAC/C,QAAQ,aACV,CAAC;AAED,SAAgB,SAAY,OAAa;CACvC,OAAO;AACT"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@csslit/core",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Compile-time CSS template literals for Vite.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"css",
|
|
7
|
+
"css-in-js",
|
|
8
|
+
"vite"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/csslit/csslit#readme",
|
|
11
|
+
"bugs": "https://github.com/csslit/csslit/issues",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Gabriel Valfridsson",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/csslit/csslit.git",
|
|
17
|
+
"directory": "packages/core"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public",
|
|
32
|
+
"registry": "https://registry.npmjs.org/"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@typescript/native-preview": "^7.0.0-dev.20260510.1",
|
|
36
|
+
"vite-plus": "^0.2.0"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=24.11.0"
|
|
40
|
+
}
|
|
41
|
+
}
|