simplestyle-js 5.1.0 → 5.2.0
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/README.md +1 -1
- package/dist/cjs/makeStyles.cjs +9 -6
- package/dist/cjs/makeStyles.d.ts +4 -3
- package/dist/esm/makeStyles.d.ts +4 -3
- package/dist/esm/makeStyles.mjs +9 -6
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
An ultra-tiny, neat, easy-to-use CSS-in-JS library with SSR support,
|
|
4
4
|
tiny bundle size and only *one runtime dependency*.
|
|
5
5
|
|
|
6
|
-
`6.
|
|
6
|
+
`6.48kB` / `2.69kB gzip` ([courtesy of bundlejs.com](https://bundlejs.com/?q=simplestyle-js))
|
|
7
7
|
|
|
8
8
|
# Simplestyle-js Reference
|
|
9
9
|
|
package/dist/cjs/makeStyles.cjs
CHANGED
|
@@ -10,19 +10,22 @@ Object.defineProperty(exports, "makeCssFuncs", {
|
|
|
10
10
|
});
|
|
11
11
|
const _createStyles = require("./createStyles.cjs");
|
|
12
12
|
function makeCssFuncs(opts) {
|
|
13
|
-
function wrappedCreateStyles(ruleId, rulesFnc) {
|
|
13
|
+
function wrappedCreateStyles(ruleId, rulesFnc, overrides) {
|
|
14
14
|
return (0, _createStyles.createStyles)(ruleId, ()=>rulesFnc('variables' in opts ? opts.variables : undefined), {
|
|
15
|
-
|
|
15
|
+
...overrides,
|
|
16
|
+
registry: 'registry' in opts ? opts.registry : overrides?.registry
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
function wrappedCreateKeyframes(ruleId, rulesFnc) {
|
|
19
|
+
function wrappedCreateKeyframes(ruleId, rulesFnc, overrides) {
|
|
19
20
|
return (0, _createStyles.keyframes)(ruleId, ()=>rulesFnc('variables' in opts ? opts.variables : undefined), {
|
|
20
|
-
|
|
21
|
+
...overrides,
|
|
22
|
+
registry: 'registry' in opts ? opts.registry : overrides?.registry
|
|
21
23
|
});
|
|
22
24
|
}
|
|
23
|
-
function wrappedRawStyles(ruleId, rulesFnc) {
|
|
25
|
+
function wrappedRawStyles(ruleId, rulesFnc, overrides) {
|
|
24
26
|
return (0, _createStyles.rawStyles)(ruleId, ()=>rulesFnc('variables' in opts ? opts.variables : undefined), {
|
|
25
|
-
|
|
27
|
+
...overrides,
|
|
28
|
+
registry: 'registry' in opts ? opts.registry : overrides?.registry
|
|
26
29
|
});
|
|
27
30
|
}
|
|
28
31
|
return {
|
package/dist/cjs/makeStyles.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Properties } from 'csstype';
|
|
2
|
+
import { type CreateStylesOptions } from './createStyles.js';
|
|
2
3
|
import type { SimpleStyleRegistry } from './simpleStyleRegistry.js';
|
|
3
4
|
import type { SimpleStyleRules } from './types.js';
|
|
4
5
|
type MakeCssFuncsOpts<T extends object> = {} | {
|
|
@@ -17,7 +18,7 @@ type MakeCssFuncsOpts<T extends object> = {} | {
|
|
|
17
18
|
* The function will be provided with your variables
|
|
18
19
|
*/
|
|
19
20
|
export declare function makeCssFuncs<V extends object>(opts: MakeCssFuncsOpts<V>): {
|
|
20
|
-
createStyles: <T extends SimpleStyleRules, K extends keyof T, O extends Record<K, string>>(ruleId: string, rulesFnc: (vars?: V) => T) => {
|
|
21
|
+
createStyles: <T extends SimpleStyleRules, K extends keyof T, O extends Record<K, string>>(ruleId: string, rulesFnc: (vars?: V) => T, overrides?: CreateStylesOptions) => {
|
|
21
22
|
classes: O;
|
|
22
23
|
stylesheet: string;
|
|
23
24
|
updateSheet: <T2 extends SimpleStyleRules>(updatedRulesFnc: () => Partial<T2>) => {
|
|
@@ -25,10 +26,10 @@ export declare function makeCssFuncs<V extends object>(opts: MakeCssFuncsOpts<V>
|
|
|
25
26
|
stylesheet: string;
|
|
26
27
|
} | null;
|
|
27
28
|
};
|
|
28
|
-
keyframes: <T extends Record<string, Properties>>(ruleId: string, rulesFnc: (vars?: V) => T) => {
|
|
29
|
+
keyframes: <T extends Record<string, Properties>>(ruleId: string, rulesFnc: (vars?: V) => T, overrides?: CreateStylesOptions) => {
|
|
29
30
|
keyframe: string;
|
|
30
31
|
stylesheet: string;
|
|
31
32
|
};
|
|
32
|
-
rawStyles: <T extends SimpleStyleRules>(ruleId: string, rulesFnc: (vars?: V) => T) => string;
|
|
33
|
+
rawStyles: <T extends SimpleStyleRules>(ruleId: string, rulesFnc: (vars?: V) => T, overrides?: CreateStylesOptions) => string;
|
|
33
34
|
};
|
|
34
35
|
export {};
|
package/dist/esm/makeStyles.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Properties } from 'csstype';
|
|
2
|
+
import { type CreateStylesOptions } from './createStyles.js';
|
|
2
3
|
import type { SimpleStyleRegistry } from './simpleStyleRegistry.js';
|
|
3
4
|
import type { SimpleStyleRules } from './types.js';
|
|
4
5
|
type MakeCssFuncsOpts<T extends object> = {} | {
|
|
@@ -17,7 +18,7 @@ type MakeCssFuncsOpts<T extends object> = {} | {
|
|
|
17
18
|
* The function will be provided with your variables
|
|
18
19
|
*/
|
|
19
20
|
export declare function makeCssFuncs<V extends object>(opts: MakeCssFuncsOpts<V>): {
|
|
20
|
-
createStyles: <T extends SimpleStyleRules, K extends keyof T, O extends Record<K, string>>(ruleId: string, rulesFnc: (vars?: V) => T) => {
|
|
21
|
+
createStyles: <T extends SimpleStyleRules, K extends keyof T, O extends Record<K, string>>(ruleId: string, rulesFnc: (vars?: V) => T, overrides?: CreateStylesOptions) => {
|
|
21
22
|
classes: O;
|
|
22
23
|
stylesheet: string;
|
|
23
24
|
updateSheet: <T2 extends SimpleStyleRules>(updatedRulesFnc: () => Partial<T2>) => {
|
|
@@ -25,10 +26,10 @@ export declare function makeCssFuncs<V extends object>(opts: MakeCssFuncsOpts<V>
|
|
|
25
26
|
stylesheet: string;
|
|
26
27
|
} | null;
|
|
27
28
|
};
|
|
28
|
-
keyframes: <T extends Record<string, Properties>>(ruleId: string, rulesFnc: (vars?: V) => T) => {
|
|
29
|
+
keyframes: <T extends Record<string, Properties>>(ruleId: string, rulesFnc: (vars?: V) => T, overrides?: CreateStylesOptions) => {
|
|
29
30
|
keyframe: string;
|
|
30
31
|
stylesheet: string;
|
|
31
32
|
};
|
|
32
|
-
rawStyles: <T extends SimpleStyleRules>(ruleId: string, rulesFnc: (vars?: V) => T) => string;
|
|
33
|
+
rawStyles: <T extends SimpleStyleRules>(ruleId: string, rulesFnc: (vars?: V) => T, overrides?: CreateStylesOptions) => string;
|
|
33
34
|
};
|
|
34
35
|
export {};
|
package/dist/esm/makeStyles.mjs
CHANGED
|
@@ -6,19 +6,22 @@ import { createStyles, keyframes, rawStyles } from './createStyles.mjs';
|
|
|
6
6
|
* they accept a function as the 2nd parameter, instead of the usual object.
|
|
7
7
|
* The function will be provided with your variables
|
|
8
8
|
*/ export function makeCssFuncs(opts) {
|
|
9
|
-
function wrappedCreateStyles(ruleId, rulesFnc) {
|
|
9
|
+
function wrappedCreateStyles(ruleId, rulesFnc, overrides) {
|
|
10
10
|
return createStyles(ruleId, ()=>rulesFnc('variables' in opts ? opts.variables : undefined), {
|
|
11
|
-
|
|
11
|
+
...overrides,
|
|
12
|
+
registry: 'registry' in opts ? opts.registry : overrides?.registry
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
|
-
function wrappedCreateKeyframes(ruleId, rulesFnc) {
|
|
15
|
+
function wrappedCreateKeyframes(ruleId, rulesFnc, overrides) {
|
|
15
16
|
return keyframes(ruleId, ()=>rulesFnc('variables' in opts ? opts.variables : undefined), {
|
|
16
|
-
|
|
17
|
+
...overrides,
|
|
18
|
+
registry: 'registry' in opts ? opts.registry : overrides?.registry
|
|
17
19
|
});
|
|
18
20
|
}
|
|
19
|
-
function wrappedRawStyles(ruleId, rulesFnc) {
|
|
21
|
+
function wrappedRawStyles(ruleId, rulesFnc, overrides) {
|
|
20
22
|
return rawStyles(ruleId, ()=>rulesFnc('variables' in opts ? opts.variables : undefined), {
|
|
21
|
-
|
|
23
|
+
...overrides,
|
|
24
|
+
registry: 'registry' in opts ? opts.registry : overrides?.registry
|
|
22
25
|
});
|
|
23
26
|
}
|
|
24
27
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simplestyle-js",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "An incredibly straightforward and simple CSS-in-JS solution with zero runtime dependencies, and out-of-the-box TypeScript support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -40,24 +40,23 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"astro": ">=5",
|
|
42
42
|
"@better-builds/lets-version": "^1.6.0",
|
|
43
|
-
"@testing-library/react": "^16.3.
|
|
43
|
+
"@testing-library/react": "^16.3.1",
|
|
44
44
|
"@types/autoprefixer": "^10.2.4",
|
|
45
45
|
"@types/react": ">=18",
|
|
46
46
|
"@types/react-dom": ">=18",
|
|
47
|
-
"@vitejs/plugin-react": "^5.1.
|
|
48
|
-
"autoprefixer": "^10.4.
|
|
49
|
-
"@biomejs/biome": "^2.3.
|
|
47
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
48
|
+
"autoprefixer": "^10.4.23",
|
|
49
|
+
"@biomejs/biome": "^2.3.10",
|
|
50
50
|
"coveralls": "^3.1.1",
|
|
51
|
-
"eslint-config-react-yas": "^6.0.11",
|
|
52
51
|
"husky": "^9.1.7",
|
|
53
|
-
"jsdom": "^27.
|
|
52
|
+
"jsdom": "^27.3.0",
|
|
54
53
|
"postcss": "^8.5.6",
|
|
55
54
|
"react": ">=18",
|
|
56
55
|
"react-dom": ">=18",
|
|
57
|
-
"@better-builds/ts-duality": "^
|
|
56
|
+
"@better-builds/ts-duality": "^1.1.0",
|
|
58
57
|
"typescript": "^5.9.3",
|
|
59
|
-
"vite": "^7.
|
|
60
|
-
"vitest": "^4.0.
|
|
58
|
+
"vite": "^7.3.0",
|
|
59
|
+
"vitest": "^4.0.16"
|
|
61
60
|
},
|
|
62
61
|
"dependencies": {
|
|
63
62
|
"csstype": "^3.2.3",
|
|
@@ -200,4 +199,4 @@
|
|
|
200
199
|
"trustedDependencies": [
|
|
201
200
|
"@swc/core"
|
|
202
201
|
]
|
|
203
|
-
}
|
|
202
|
+
}
|