styles-config 2.0.0-alpha.7 → 2.0.0-alpha.9
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 +29 -11
- package/lib/types.d.ts +7 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
# styles-config
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
**A shared configuration schema and loader for styling tools (Jess, Less, Sass,
|
|
4
|
+
Tailwind, …).**
|
|
5
|
+
|
|
6
|
+
`styles-config` is part of the [Jess](https://github.com/jesscss/jess) project.
|
|
7
|
+
It is published **unscoped** — the package name is `styles-config`, not
|
|
8
|
+
`@jesscss/config`.
|
|
4
9
|
|
|
5
10
|
## Overview
|
|
6
11
|
|
|
7
|
-
`styles-config` provides a unified configuration format and loading system that
|
|
12
|
+
`styles-config` provides a unified configuration format and loading system that
|
|
13
|
+
works across multiple CSS preprocessors and styling frameworks. It lets you define
|
|
14
|
+
configuration once and use it with different tools, or maintain separate
|
|
15
|
+
configurations for different frameworks. Jess itself reads its compile options
|
|
16
|
+
through this loader.
|
|
8
17
|
|
|
9
18
|
## Features
|
|
10
19
|
|
|
@@ -16,14 +25,12 @@ A general-purpose configuration system for styling frameworks including Jess, Le
|
|
|
16
25
|
|
|
17
26
|
## Installation
|
|
18
27
|
|
|
19
|
-
```
|
|
28
|
+
```sh
|
|
20
29
|
npm install styles-config
|
|
21
|
-
# or
|
|
22
|
-
pnpm add styles-config
|
|
23
|
-
# or
|
|
24
|
-
yarn add styles-config
|
|
25
30
|
```
|
|
26
31
|
|
|
32
|
+
Published to npm under both the `latest` and `alpha` dist-tags.
|
|
33
|
+
|
|
27
34
|
## Configuration File Format
|
|
28
35
|
|
|
29
36
|
Create a configuration file in your project root. Supported file names:
|
|
@@ -39,8 +46,9 @@ interface StylesConfig {
|
|
|
39
46
|
searchPaths?: string[];
|
|
40
47
|
enableJavaScript?: boolean;
|
|
41
48
|
mathMode?: 'always' | 'parens-division' | 'parens' | 'strict';
|
|
42
|
-
unitMode?: 'loose' | 'strict';
|
|
43
|
-
|
|
49
|
+
unitMode?: 'loose' | 'preserve' | 'strict';
|
|
50
|
+
functionMode?: 'preserve' | 'error';
|
|
51
|
+
equalityMode?: 'less' | 'sass' | 'exact';
|
|
44
52
|
};
|
|
45
53
|
input?: InputOptions | InputOptions[];
|
|
46
54
|
output?: OutputOptions | OutputOptions[];
|
|
@@ -78,7 +86,7 @@ export default {
|
|
|
78
86
|
compile: {
|
|
79
87
|
mathMode: 'parens-division',
|
|
80
88
|
unitMode: 'loose',
|
|
81
|
-
equalityMode: '
|
|
89
|
+
equalityMode: 'less',
|
|
82
90
|
searchPaths: ['./src/styles', './node_modules']
|
|
83
91
|
},
|
|
84
92
|
input: [
|
|
@@ -320,6 +328,16 @@ This package is designed to be extensible. To add support for a new framework:
|
|
|
320
328
|
2. Add the extension mapping in `src/options.ts` if needed
|
|
321
329
|
3. Update the documentation
|
|
322
330
|
|
|
331
|
+
## Status
|
|
332
|
+
|
|
333
|
+
Alpha. Part of the Jess monorepo, which is early software under active
|
|
334
|
+
development. Please [report issues](https://github.com/jesscss/jess/issues).
|
|
335
|
+
|
|
336
|
+
## Links
|
|
337
|
+
|
|
338
|
+
- Repository: <https://github.com/jesscss/jess>
|
|
339
|
+
- Documentation: <https://jesscss.github.io/> (currently pre-alpha content)
|
|
340
|
+
|
|
323
341
|
## License
|
|
324
342
|
|
|
325
|
-
MIT
|
|
343
|
+
[MIT](https://github.com/jesscss/jess/blob/dev/LICENSE)
|
package/lib/types.d.ts
CHANGED
|
@@ -7,14 +7,16 @@ export type MathMode = 'always' | 'parens-division' | 'parens' | 'strict';
|
|
|
7
7
|
*/
|
|
8
8
|
export type UnitMode = 'loose' | 'preserve' | 'strict';
|
|
9
9
|
/**
|
|
10
|
-
* Function-call resolution modes —
|
|
11
|
-
* (global) function call that matched a registered function
|
|
12
|
-
* evaluated: `preserve` renders it as-is (+ warning), `error`
|
|
10
|
+
* Function-call resolution modes — compiler input to the shared evaluator.
|
|
11
|
+
* Governs an optional (global) function call that matched a registered function
|
|
12
|
+
* but couldn't be evaluated: `preserve` renders it as-is (+ warning), `error`
|
|
13
|
+
* throws.
|
|
13
14
|
*/
|
|
14
15
|
export type FunctionMode = 'preserve' | 'error';
|
|
15
16
|
/**
|
|
16
|
-
* Equality
|
|
17
|
-
*
|
|
17
|
+
* Equality compatibility modes for the shared guard evaluator. The names retain
|
|
18
|
+
* their source-compatibility meaning (Less 4.x and Sass diverge in opposite
|
|
19
|
+
* directions), not separate runtime semantics:
|
|
18
20
|
* - `less`: Less 4.x equality (numeric coercion; quoted vs unquoted distinct)
|
|
19
21
|
* - `sass`: Dart Sass equality (unit-strict; quote-insensitive strings)
|
|
20
22
|
* - `exact`: no coercion — operands must be the same node type
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.0.0-alpha.
|
|
7
|
+
"version": "2.0.0-alpha.9",
|
|
8
8
|
"description": "General-purpose configuration for styling frameworks (Jess, Less, Sass, Tailwind, etc.)",
|
|
9
9
|
"main": "lib/index.cjs",
|
|
10
10
|
"types": "lib/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"cosmiconfig": "^9.0.0",
|
|
23
23
|
"picomatch": "^4.0.2",
|
|
24
|
-
"@jesscss/core": "2.0.0-alpha.
|
|
24
|
+
"@jesscss/core": "2.0.0-alpha.9"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^22.10.2",
|