@cwcss/crosswind 0.1.6 → 0.2.1
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 +483 -277
- package/dist/bin/cli.js +13838 -0
- package/dist/build.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/generator.d.ts +4 -24
- package/dist/index.d.ts +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/preflight-forms.d.ts +2 -1
- package/dist/preflight.d.ts +2 -1
- package/dist/rules.d.ts +13 -1
- package/dist/scanner.d.ts +1 -4
- package/dist/{index.js → src/index.js} +1951 -2674
- package/dist/types.d.ts +11 -2
- package/package.json +2 -16
- package/dist/rules-advanced.d.ts +0 -27
- package/dist/rules-effects.d.ts +0 -25
- package/dist/rules-forms.d.ts +0 -7
- package/dist/rules-grid.d.ts +0 -13
- package/dist/rules-interactivity.d.ts +0 -41
- package/dist/rules-layout.d.ts +0 -26
- package/dist/rules-transforms.d.ts +0 -33
- package/dist/rules-typography.d.ts +0 -41
- package/dist/transformer-compile-class.d.ts +0 -37
package/dist/build.d.ts
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import type { CrosswindConfig } from './types';
|
|
|
2
2
|
export declare function getConfig(): Promise<CrosswindConfig>;
|
|
3
3
|
export declare const defaultConfig: CrosswindConfig;
|
|
4
4
|
// For backwards compatibility - synchronous access with default fallback
|
|
5
|
-
export declare const config: CrosswindConfig;
|
|
5
|
+
export declare const config: CrosswindConfig;
|
package/dist/generator.d.ts
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { UtilityRule } from './rules';
|
|
1
|
+
import type { CrosswindConfig } from './types';
|
|
3
2
|
/**
|
|
4
3
|
* Generates CSS rules from parsed utility classes
|
|
5
4
|
*/
|
|
6
5
|
export declare class CSSGenerator {
|
|
7
|
-
private rules: Map<string, CSSRule[]>;
|
|
8
|
-
private classCache: Set<string>;
|
|
9
|
-
private blocklistRegexCache: RegExp[];
|
|
10
|
-
private blocklistExact: Set<string>;
|
|
11
|
-
private selectorCache: Map<string, string>;
|
|
12
|
-
private mediaQueryCache: Map<string, string | undefined>;
|
|
13
|
-
private ruleCache: Map<string, UtilityRule[]>;
|
|
14
|
-
private variantEnabled: Record<string, boolean>;
|
|
15
|
-
private screenBreakpoints: Map<string, string>;
|
|
16
|
-
private noMatchCache: Set<string>;
|
|
17
|
-
private extendColors: Record<string, string | Record<string, string>> | null;
|
|
18
|
-
private config: CrosswindConfig;
|
|
19
6
|
constructor(config: CrosswindConfig);
|
|
20
|
-
|
|
7
|
+
generateBatch(classNames: string[]): void;
|
|
21
8
|
generate(className: string): void;
|
|
22
|
-
|
|
23
|
-
private buildSelector(parsed: ParsedClass): string;
|
|
24
|
-
private getMediaQuery(parsed: ParsedClass): string | undefined;
|
|
25
|
-
private escapeSelector(className: string): string;
|
|
26
|
-
toCSS(includePreflight?: any, minify?: any): string;
|
|
27
|
-
private rulesToCSS(rules: CSSRule[], minify: boolean): string;
|
|
28
|
-
private groupRulesBySelector(rules: CSSRule[]): Map<string, Map<string, string>>;
|
|
29
|
-
private generateCSSVariables(): string | null;
|
|
9
|
+
toCSS(includePreflight?: boolean, minify?: boolean): string;
|
|
30
10
|
reset(): void;
|
|
31
|
-
}
|
|
11
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/parser.d.ts
CHANGED
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Preflight } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* Tailwind Forms preflight styles
|
|
3
4
|
* Provides default styling for form elements to make them easy to customize with utilities
|
|
4
5
|
*/
|
|
5
|
-
export declare const tailwindFormsPreflight: Preflight;
|
|
6
|
+
export declare const tailwindFormsPreflight: Preflight;
|
package/dist/preflight.d.ts
CHANGED
package/dist/rules.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import type { CrosswindConfig, ParsedClass, UtilityRuleResult } from './types';
|
|
2
|
+
// Helper to apply opacity to color
|
|
3
|
+
export declare function applyOpacity(color: string, opacity: number): string;
|
|
4
|
+
/**
|
|
5
|
+
* Shared helper: resolve a color value (with optional opacity) from theme config.
|
|
6
|
+
* Handles: special keywords, direct colors, color-shade, opacity modifiers (/50, /[0.04]).
|
|
7
|
+
* Returns the resolved CSS color string or undefined if not found.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveColorValue(value: string, config: { theme: { colors: Record<string, any> } }): string | undefined;
|
|
2
10
|
/**
|
|
3
11
|
* Built-in utility rules
|
|
4
12
|
* Each rule checks if it matches the parsed class and returns CSS properties
|
|
5
13
|
*/
|
|
6
14
|
// Display utilities
|
|
7
15
|
export declare const displayRule: UtilityRule;
|
|
16
|
+
// Scrollbar utilities
|
|
17
|
+
export declare const scrollbarRule: UtilityRule;
|
|
18
|
+
// Content property for pseudo-elements: content-none, content-empty, content-['hello']
|
|
19
|
+
export declare const contentPropertyRule: UtilityRule;
|
|
8
20
|
// Container utilities (for container queries)
|
|
9
21
|
export declare const containerRule: UtilityRule;
|
|
10
22
|
// Flexbox utilities
|
|
@@ -36,4 +48,4 @@ export declare const borderSideWidthRule: UtilityRule;
|
|
|
36
48
|
export declare const borderRadiusRule: UtilityRule;
|
|
37
49
|
// Export all rules (order matters - more specific rules first)
|
|
38
50
|
export declare const builtInRules: UtilityRule[];
|
|
39
|
-
export type UtilityRule = (
|
|
51
|
+
export type UtilityRule = (_parsed: ParsedClass, _config: CrosswindConfig) => Record<string, string> | UtilityRuleResult | undefined;
|
package/dist/scanner.d.ts
CHANGED
|
@@ -8,11 +8,8 @@ export declare interface ScanResult {
|
|
|
8
8
|
* Scans files for utility classes using Bun's fast Glob API
|
|
9
9
|
*/
|
|
10
10
|
export declare class Scanner {
|
|
11
|
-
private patterns: string[];
|
|
12
|
-
private transformer?: CompileClassTransformer | null | undefined;
|
|
13
|
-
private extractOptions?: ExtractClassesOptions | undefined;
|
|
14
11
|
constructor(patterns: string[], transformer?: CompileClassTransformer | null | undefined, extractOptions?: ExtractClassesOptions | undefined);
|
|
15
12
|
scan(): Promise<ScanResult>;
|
|
16
13
|
scanFile(filePath: string): Promise<Set<string>>;
|
|
17
14
|
scanContent(content: string): Set<string>;
|
|
18
|
-
}
|
|
15
|
+
}
|