@cwcss/crosswind 0.1.5 → 0.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/LICENSE.md +21 -0
- package/README.md +52 -0
- package/dist/bin/cli.js +14615 -0
- package/dist/build.d.ts +24 -0
- package/dist/config.d.ts +5 -0
- package/dist/generator.d.ts +31 -0
- package/dist/index.d.ts +10 -0
- package/dist/parser.d.ts +42 -0
- package/dist/plugin.d.ts +22 -0
- package/dist/preflight-forms.d.ts +5 -0
- package/dist/preflight.d.ts +2 -0
- package/dist/rules-advanced.d.ts +27 -0
- package/dist/rules-effects.d.ts +25 -0
- package/dist/rules-forms.d.ts +7 -0
- package/dist/rules-grid.d.ts +13 -0
- package/dist/rules-interactivity.d.ts +41 -0
- package/dist/rules-layout.d.ts +26 -0
- package/dist/rules-transforms.d.ts +33 -0
- package/dist/rules-typography.d.ts +41 -0
- package/dist/rules.d.ts +39 -0
- package/dist/scanner.d.ts +18 -0
- package/dist/src/index.js +12848 -0
- package/dist/transformer-compile-class.d.ts +37 -0
- package/{src/types.ts → dist/types.d.ts} +17 -86
- package/package.json +2 -16
- package/PLUGIN.md +0 -235
- package/benchmark/framework-comparison.bench.ts +0 -850
- package/bin/cli.ts +0 -365
- package/bin/crosswind +0 -0
- package/bin/headwind +0 -0
- package/build.ts +0 -8
- package/crosswind.config.ts +0 -9
- package/example/comprehensive.html +0 -70
- package/example/index.html +0 -21
- package/example/output.css +0 -236
- package/examples/plugin/README.md +0 -112
- package/examples/plugin/build.ts +0 -32
- package/examples/plugin/src/index.html +0 -34
- package/examples/plugin/src/index.ts +0 -7
- package/headwind +0 -2
- package/src/build.ts +0 -101
- package/src/config.ts +0 -529
- package/src/generator.ts +0 -2173
- package/src/index.ts +0 -10
- package/src/parser.ts +0 -1471
- package/src/plugin.ts +0 -118
- package/src/preflight-forms.ts +0 -229
- package/src/preflight.ts +0 -388
- package/src/rules-advanced.ts +0 -477
- package/src/rules-effects.ts +0 -461
- package/src/rules-forms.ts +0 -103
- package/src/rules-grid.ts +0 -241
- package/src/rules-interactivity.ts +0 -525
- package/src/rules-layout.ts +0 -385
- package/src/rules-transforms.ts +0 -412
- package/src/rules-typography.ts +0 -486
- package/src/rules.ts +0 -809
- package/src/scanner.ts +0 -84
- package/src/transformer-compile-class.ts +0 -275
- package/test/advanced-features.test.ts +0 -911
- package/test/arbitrary.test.ts +0 -396
- package/test/attributify.test.ts +0 -592
- package/test/bracket-syntax.test.ts +0 -1133
- package/test/build.test.ts +0 -99
- package/test/colors.test.ts +0 -934
- package/test/flexbox.test.ts +0 -669
- package/test/generator.test.ts +0 -597
- package/test/grid.test.ts +0 -584
- package/test/layout.test.ts +0 -404
- package/test/modifiers.test.ts +0 -417
- package/test/parser.test.ts +0 -564
- package/test/performance-regression.test.ts +0 -376
- package/test/performance.test.ts +0 -568
- package/test/plugin.test.ts +0 -160
- package/test/scanner.test.ts +0 -94
- package/test/sizing.test.ts +0 -481
- package/test/spacing.test.ts +0 -394
- package/test/transformer-compile-class.test.ts +0 -287
- package/test/transforms.test.ts +0 -448
- package/test/typography.test.ts +0 -632
- package/test/variants-form-states.test.ts +0 -225
- package/test/variants-group-peer.test.ts +0 -66
- package/test/variants-media.test.ts +0 -213
- package/test/variants-positional.test.ts +0 -58
- package/test/variants-pseudo-elements.test.ts +0 -47
- package/test/variants-state.test.ts +0 -62
- package/tsconfig.json +0 -18
package/dist/build.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CrosswindConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Build CSS from content patterns
|
|
4
|
+
*/
|
|
5
|
+
export declare function build(config: CrosswindConfig): Promise<BuildResult>;
|
|
6
|
+
/**
|
|
7
|
+
* Write CSS to output file
|
|
8
|
+
*/
|
|
9
|
+
export declare function writeCSS(css: string, outputPath: string): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Write transformed files to disk
|
|
12
|
+
*/
|
|
13
|
+
export declare function writeTransformedFiles(transformedFiles: Map<string, string>): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Build and write CSS to output file
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildAndWrite(config: CrosswindConfig): Promise<BuildResult>;
|
|
18
|
+
export declare interface BuildResult {
|
|
19
|
+
css: string
|
|
20
|
+
classes: Set<string>
|
|
21
|
+
duration: number
|
|
22
|
+
compiledClasses?: Map<string, { className: string, utilities: string[] }>
|
|
23
|
+
transformedFiles?: Map<string, string>
|
|
24
|
+
}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CrosswindConfig } from './types';
|
|
2
|
+
export declare function getConfig(): Promise<CrosswindConfig>;
|
|
3
|
+
export declare const defaultConfig: CrosswindConfig;
|
|
4
|
+
// For backwards compatibility - synchronous access with default fallback
|
|
5
|
+
export declare const config: CrosswindConfig;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CSSRule, CrosswindConfig, ParsedClass } from './types';
|
|
2
|
+
import type { UtilityRule } from './rules';
|
|
3
|
+
/**
|
|
4
|
+
* Generates CSS rules from parsed utility classes
|
|
5
|
+
*/
|
|
6
|
+
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
|
+
constructor(config: CrosswindConfig);
|
|
20
|
+
private buildRuleLookup(): void;
|
|
21
|
+
generate(className: string): void;
|
|
22
|
+
private addRule(parsed: ParsedClass, properties: Record<string, string>, childSelector?: string, pseudoElement?: string): void;
|
|
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;
|
|
30
|
+
reset(): void;
|
|
31
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './build';
|
|
2
|
+
export * from './config';
|
|
3
|
+
export * from './generator';
|
|
4
|
+
export * from './parser';
|
|
5
|
+
export * from './plugin';
|
|
6
|
+
export * from './preflight';
|
|
7
|
+
export * from './preflight-forms';
|
|
8
|
+
export * from './rules';
|
|
9
|
+
export * from './scanner';
|
|
10
|
+
export * from './types';
|
package/dist/parser.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AttributifyConfig, BracketSyntaxConfig, ParsedClass } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Expand bracket/grouped syntax into individual class names
|
|
4
|
+
* e.g., flex[col jc-center ai-center] -> ['flex-col', 'justify-center', 'items-center']
|
|
5
|
+
* e.g., text[white 2rem 700] -> ['text-white', 'text-[2rem]', 'font-bold']
|
|
6
|
+
* e.g., h[min 100vh] -> ['min-h-[100vh]']
|
|
7
|
+
* e.g., hover:flex[col] -> ['hover:flex-col']
|
|
8
|
+
* e.g., flex[md:col lg:row] -> ['md:flex-col', 'lg:flex-row']
|
|
9
|
+
* e.g., -m[4] or m[-4] -> ['-m-4']
|
|
10
|
+
*/
|
|
11
|
+
export declare function expandBracketSyntax(className: string, config?: BracketSyntaxConfig): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Extract classes from attributify syntax
|
|
14
|
+
* e.g., <div hw-flex hw-items-center hw-bg="blue-500" hw-p="4">
|
|
15
|
+
* Returns classes like: flex, items-center, bg-blue-500, p-4
|
|
16
|
+
*
|
|
17
|
+
* Also supports variant attributes:
|
|
18
|
+
* e.g., <div hw-hover:bg="blue-600" hw-dark:text="white">
|
|
19
|
+
* Returns classes like: hover:bg-blue-600, dark:text-white
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractAttributifyClasses(content: string, config?: AttributifyConfig): Set<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Parses a utility class string into its components
|
|
24
|
+
* Examples: "p-4" -> {raw: "p-4", variants: [], utility: "p", value: "4", important: false, arbitrary: false}
|
|
25
|
+
* "hover:bg-blue-500" -> {raw: "hover:bg-blue-500", variants: ["hover"], utility: "bg", value: "blue-500", important: false, arbitrary: false}
|
|
26
|
+
* "!p-4" -> {raw: "!p-4", variants: [], utility: "p", value: "4", important: true, arbitrary: false}
|
|
27
|
+
* "w-[100px]" -> {raw: "w-[100px]", variants: [], utility: "w", value: "100px", important: false, arbitrary: true}
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseClass(className: string): ParsedClass;
|
|
30
|
+
/**
|
|
31
|
+
* Extracts all utility classes from content
|
|
32
|
+
* Matches class patterns in HTML/JSX attributes and template strings
|
|
33
|
+
* Supports bracket syntax (e.g., flex[col jc-center]) and attributify mode
|
|
34
|
+
*/
|
|
35
|
+
export declare function extractClasses(content: string, options?: ExtractClassesOptions): Set<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Options for class extraction
|
|
38
|
+
*/
|
|
39
|
+
export declare interface ExtractClassesOptions {
|
|
40
|
+
attributify?: AttributifyConfig
|
|
41
|
+
bracketSyntax?: BracketSyntaxConfig
|
|
42
|
+
}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BunPlugin } from 'bun';
|
|
2
|
+
import type { CrosswindOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Crosswind Bun plugin for processing HTML files
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { plugin } from '@cwcss/crosswind'
|
|
9
|
+
*
|
|
10
|
+
* await Bun.build({
|
|
11
|
+
* entrypoints: ['./src/index.ts'],
|
|
12
|
+
* outdir: './dist',
|
|
13
|
+
* plugins: [plugin()],
|
|
14
|
+
* })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function plugin(options?: CrosswindPluginOptions): BunPlugin;
|
|
18
|
+
export declare interface CrosswindPluginOptions {
|
|
19
|
+
config?: CrosswindOptions
|
|
20
|
+
includePreflight?: boolean
|
|
21
|
+
}
|
|
22
|
+
export default plugin;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Advanced utilities
|
|
2
|
+
// Min/Max sizing
|
|
3
|
+
export declare const minMaxSizingRule: UtilityRule;
|
|
4
|
+
// Ring utilities
|
|
5
|
+
export declare const ringRule: UtilityRule;
|
|
6
|
+
// Border opacity utility
|
|
7
|
+
export declare const borderOpacityRule: UtilityRule;
|
|
8
|
+
// Space utilities (child spacing)
|
|
9
|
+
export declare const spaceRule: UtilityRule;
|
|
10
|
+
// Border style utilities
|
|
11
|
+
export declare const borderStyleRule: UtilityRule;
|
|
12
|
+
// Divide utilities (borders between children)
|
|
13
|
+
export declare const divideRule: UtilityRule;
|
|
14
|
+
// Gradient color stops
|
|
15
|
+
export declare const gradientStopsRule: UtilityRule;
|
|
16
|
+
// Flex order
|
|
17
|
+
export declare const flexOrderRule: UtilityRule;
|
|
18
|
+
// Flex basis
|
|
19
|
+
export declare const flexBasisRule: UtilityRule;
|
|
20
|
+
// Justify/Align self
|
|
21
|
+
export declare const justifySelfRule: UtilityRule;
|
|
22
|
+
export declare const alignSelfRule: UtilityRule;
|
|
23
|
+
// Container utility with responsive max-widths
|
|
24
|
+
export declare const containerRule: UtilityRule;
|
|
25
|
+
// Arbitrary properties
|
|
26
|
+
export declare const arbitraryPropertyRule: UtilityRule;
|
|
27
|
+
export declare const advancedRules: UtilityRule[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Backgrounds, Borders, Effects utilities
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Background utilities
|
|
5
|
+
export declare const backgroundAttachmentRule: UtilityRule;
|
|
6
|
+
export declare const backgroundClipRule: UtilityRule;
|
|
7
|
+
export declare const backgroundImageRule: UtilityRule;
|
|
8
|
+
export declare const backgroundOriginRule: UtilityRule;
|
|
9
|
+
export declare const backgroundPositionRule: UtilityRule;
|
|
10
|
+
export declare const backgroundRepeatRule: UtilityRule;
|
|
11
|
+
export declare const backgroundSizeRule: UtilityRule;
|
|
12
|
+
// Border utilities
|
|
13
|
+
export declare const borderStyleRule: UtilityRule;
|
|
14
|
+
export declare const outlineRule: UtilityRule;
|
|
15
|
+
// Effect utilities
|
|
16
|
+
export declare const boxShadowThemeRule: UtilityRule;
|
|
17
|
+
// Shadow color utilities (shadow-{color}, shadow-{color}/{opacity})
|
|
18
|
+
export declare const shadowColorRule: UtilityRule;
|
|
19
|
+
export declare const textShadowRule: UtilityRule;
|
|
20
|
+
export declare const opacityRule: UtilityRule;
|
|
21
|
+
export declare const mixBlendModeRule: UtilityRule;
|
|
22
|
+
export declare const backgroundBlendModeRule: UtilityRule;
|
|
23
|
+
// Mask utilities
|
|
24
|
+
export declare const maskRule: UtilityRule;
|
|
25
|
+
export declare const effectsRules: UtilityRule[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const formInputRule: UtilityRule;
|
|
2
|
+
export declare const formTextareaRule: UtilityRule;
|
|
3
|
+
export declare const formSelectRule: UtilityRule;
|
|
4
|
+
export declare const formMultiselectRule: UtilityRule;
|
|
5
|
+
export declare const formCheckboxRule: UtilityRule;
|
|
6
|
+
export declare const formRadioRule: UtilityRule;
|
|
7
|
+
export declare const formsRules: UtilityRule[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Grid utilities
|
|
2
|
+
export declare const gridTemplateColumnsRule: UtilityRule;
|
|
3
|
+
export declare const gridColumnRule: UtilityRule;
|
|
4
|
+
export declare const gridTemplateRowsRule: UtilityRule;
|
|
5
|
+
export declare const gridRowRule: UtilityRule;
|
|
6
|
+
export declare const gridAutoFlowRule: UtilityRule;
|
|
7
|
+
export declare const gridAutoColumnsRule: UtilityRule;
|
|
8
|
+
export declare const gridAutoRowsRule: UtilityRule;
|
|
9
|
+
export declare const gapRule: UtilityRule;
|
|
10
|
+
export declare const placeContentRule: UtilityRule;
|
|
11
|
+
export declare const placeItemsRule: UtilityRule;
|
|
12
|
+
export declare const placeSelfRule: UtilityRule;
|
|
13
|
+
export declare const gridRules: UtilityRule[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Filters, Tables, Interactivity, SVG, Accessibility utilities
|
|
2
|
+
// Filter utilities
|
|
3
|
+
export declare const filterRule: UtilityRule;
|
|
4
|
+
export declare const backdropFilterRule: UtilityRule;
|
|
5
|
+
// Table utilities
|
|
6
|
+
export declare const borderCollapseRule: UtilityRule;
|
|
7
|
+
export declare const borderSpacingRule: UtilityRule;
|
|
8
|
+
export declare const tableLayoutRule: UtilityRule;
|
|
9
|
+
export declare const captionSideRule: UtilityRule;
|
|
10
|
+
// Interactivity utilities
|
|
11
|
+
export declare const accentColorRule: UtilityRule;
|
|
12
|
+
export declare const appearanceRule: UtilityRule;
|
|
13
|
+
export declare const caretColorRule: UtilityRule;
|
|
14
|
+
export declare const colorSchemeRule: UtilityRule;
|
|
15
|
+
export declare const fieldSizingRule: UtilityRule;
|
|
16
|
+
export declare const cursorRule: UtilityRule;
|
|
17
|
+
export declare const pointerEventsRule: UtilityRule;
|
|
18
|
+
export declare const resizeRule: UtilityRule;
|
|
19
|
+
export declare const scrollBehaviorRule: UtilityRule;
|
|
20
|
+
export declare const scrollMarginRule: UtilityRule;
|
|
21
|
+
export declare const scrollPaddingRule: UtilityRule;
|
|
22
|
+
export declare const scrollSnapRule: UtilityRule;
|
|
23
|
+
export declare const touchActionRule: UtilityRule;
|
|
24
|
+
export declare const userSelectRule: UtilityRule;
|
|
25
|
+
export declare const willChangeRule: UtilityRule;
|
|
26
|
+
// SVG utilities
|
|
27
|
+
export declare const fillRule: UtilityRule;
|
|
28
|
+
export declare const strokeRule: UtilityRule;
|
|
29
|
+
export declare const strokeWidthRule: UtilityRule;
|
|
30
|
+
// SVG stroke-dasharray
|
|
31
|
+
export declare const strokeDasharrayRule: UtilityRule;
|
|
32
|
+
// SVG stroke-dashoffset
|
|
33
|
+
export declare const strokeDashoffsetRule: UtilityRule;
|
|
34
|
+
// SVG stroke-linecap
|
|
35
|
+
export declare const strokeLinecapRule: UtilityRule;
|
|
36
|
+
// SVG stroke-linejoin
|
|
37
|
+
export declare const strokeLinejoinRule: UtilityRule;
|
|
38
|
+
// Accessibility
|
|
39
|
+
export declare const screenReaderRule: UtilityRule;
|
|
40
|
+
export declare const forcedColorAdjustRule: UtilityRule;
|
|
41
|
+
export declare const interactivityRules: UtilityRule[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Layout utilities
|
|
2
|
+
export declare const aspectRatioRule: UtilityRule;
|
|
3
|
+
export declare const columnsRule: UtilityRule;
|
|
4
|
+
// Column fill
|
|
5
|
+
export declare const columnFillRule: UtilityRule;
|
|
6
|
+
// Column gap (different from grid gap)
|
|
7
|
+
export declare const columnGapRule: UtilityRule;
|
|
8
|
+
// Column rule (border between columns)
|
|
9
|
+
export declare const columnRuleRule: UtilityRule;
|
|
10
|
+
// Column span
|
|
11
|
+
export declare const columnSpanRule: UtilityRule;
|
|
12
|
+
export declare const breakRule: UtilityRule;
|
|
13
|
+
export declare const boxDecorationRule: UtilityRule;
|
|
14
|
+
export declare const boxSizingRule: UtilityRule;
|
|
15
|
+
export declare const floatRule: UtilityRule;
|
|
16
|
+
export declare const clearRule: UtilityRule;
|
|
17
|
+
export declare const isolationRule: UtilityRule;
|
|
18
|
+
export declare const objectFitRule: UtilityRule;
|
|
19
|
+
export declare const objectPositionRule: UtilityRule;
|
|
20
|
+
export declare const overflowRule: UtilityRule;
|
|
21
|
+
export declare const overscrollRule: UtilityRule;
|
|
22
|
+
export declare const positionRule: UtilityRule;
|
|
23
|
+
export declare const insetRule: UtilityRule;
|
|
24
|
+
export declare const visibilityRule: UtilityRule;
|
|
25
|
+
export declare const zIndexRule: UtilityRule;
|
|
26
|
+
export declare const layoutRules: UtilityRule[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Transform, Transition, Animation utilities
|
|
2
|
+
export declare const transformRule: UtilityRule;
|
|
3
|
+
export declare const scaleRule: UtilityRule;
|
|
4
|
+
export declare const rotateRule: UtilityRule;
|
|
5
|
+
export declare const translateRule: UtilityRule;
|
|
6
|
+
export declare const skewRule: UtilityRule;
|
|
7
|
+
export declare const transformOriginRule: UtilityRule;
|
|
8
|
+
export declare const perspectiveRule: UtilityRule;
|
|
9
|
+
export declare const perspectiveOriginRule: UtilityRule;
|
|
10
|
+
export declare const backfaceVisibilityRule: UtilityRule;
|
|
11
|
+
export declare const transformStyleRule: UtilityRule;
|
|
12
|
+
// Transition utilities
|
|
13
|
+
export declare const transitionPropertyRule: UtilityRule;
|
|
14
|
+
export declare const transitionDurationRule: UtilityRule;
|
|
15
|
+
export declare const transitionTimingRule: UtilityRule;
|
|
16
|
+
export declare const transitionDelayRule: UtilityRule;
|
|
17
|
+
export declare const transitionBehaviorRule: UtilityRule;
|
|
18
|
+
export declare const animationRule: UtilityRule;
|
|
19
|
+
// Animation play state
|
|
20
|
+
export declare const animationPlayStateRule: UtilityRule;
|
|
21
|
+
// Animation direction
|
|
22
|
+
export declare const animationDirectionRule: UtilityRule;
|
|
23
|
+
// Animation fill mode
|
|
24
|
+
export declare const animationFillModeRule: UtilityRule;
|
|
25
|
+
// Animation iteration count
|
|
26
|
+
export declare const animationIterationRule: UtilityRule;
|
|
27
|
+
// Animation duration
|
|
28
|
+
export declare const animationDurationRule: UtilityRule;
|
|
29
|
+
// Animation delay
|
|
30
|
+
export declare const animationDelayRule: UtilityRule;
|
|
31
|
+
// Animation timing function
|
|
32
|
+
export declare const animationTimingRule: UtilityRule;
|
|
33
|
+
export declare const transformsRules: UtilityRule[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Typography utilities
|
|
2
|
+
export declare const fontFamilyRule: UtilityRule;
|
|
3
|
+
export declare const fontSmoothingRule: UtilityRule;
|
|
4
|
+
export declare const fontStyleRule: UtilityRule;
|
|
5
|
+
export declare const fontStretchRule: UtilityRule;
|
|
6
|
+
export declare const fontVariantNumericRule: UtilityRule;
|
|
7
|
+
export declare const letterSpacingRule: UtilityRule;
|
|
8
|
+
export declare const lineClampRule: UtilityRule;
|
|
9
|
+
export declare const listStyleImageRule: UtilityRule;
|
|
10
|
+
export declare const listStylePositionRule: UtilityRule;
|
|
11
|
+
export declare const listStyleTypeRule: UtilityRule;
|
|
12
|
+
export declare const textDecorationRule: UtilityRule;
|
|
13
|
+
export declare const underlineOffsetRule: UtilityRule;
|
|
14
|
+
export declare const textTransformRule: UtilityRule;
|
|
15
|
+
export declare const textOverflowRule: UtilityRule;
|
|
16
|
+
export declare const textWrapRule: UtilityRule;
|
|
17
|
+
export declare const textIndentRule: UtilityRule;
|
|
18
|
+
export declare const verticalAlignRule: UtilityRule;
|
|
19
|
+
export declare const whiteSpaceRule: UtilityRule;
|
|
20
|
+
export declare const wordBreakRule: UtilityRule;
|
|
21
|
+
export declare const overflowWrapRule: UtilityRule;
|
|
22
|
+
export declare const hyphensRule: UtilityRule;
|
|
23
|
+
export declare const contentRule: UtilityRule;
|
|
24
|
+
export declare const lineHeightRule: UtilityRule;
|
|
25
|
+
// Writing mode
|
|
26
|
+
export declare const writingModeRule: UtilityRule;
|
|
27
|
+
// Text orientation
|
|
28
|
+
export declare const textOrientationRule: UtilityRule;
|
|
29
|
+
// Direction (ltr/rtl)
|
|
30
|
+
export declare const directionRule: UtilityRule;
|
|
31
|
+
// Text emphasis
|
|
32
|
+
export declare const textEmphasisRule: UtilityRule;
|
|
33
|
+
// Text emphasis color
|
|
34
|
+
export declare const textEmphasisColorRule: UtilityRule;
|
|
35
|
+
// Word spacing
|
|
36
|
+
export declare const wordSpacingRule: UtilityRule;
|
|
37
|
+
// Font variant caps
|
|
38
|
+
export declare const fontVariantCapsRule: UtilityRule;
|
|
39
|
+
// Font variant ligatures
|
|
40
|
+
export declare const fontVariantLigaturesRule: UtilityRule;
|
|
41
|
+
export declare const typographyRules: UtilityRule[];
|
package/dist/rules.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { CrosswindConfig, ParsedClass, UtilityRuleResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Built-in utility rules
|
|
4
|
+
* Each rule checks if it matches the parsed class and returns CSS properties
|
|
5
|
+
*/
|
|
6
|
+
// Display utilities
|
|
7
|
+
export declare const displayRule: UtilityRule;
|
|
8
|
+
// Container utilities (for container queries)
|
|
9
|
+
export declare const containerRule: UtilityRule;
|
|
10
|
+
// Flexbox utilities
|
|
11
|
+
export declare const flexDirectionRule: UtilityRule;
|
|
12
|
+
export declare const flexWrapRule: UtilityRule;
|
|
13
|
+
export declare const flexRule: UtilityRule;
|
|
14
|
+
export declare const flexGrowRule: UtilityRule;
|
|
15
|
+
export declare const flexShrinkRule: UtilityRule;
|
|
16
|
+
export declare const justifyContentRule: UtilityRule;
|
|
17
|
+
export declare const alignItemsRule: UtilityRule;
|
|
18
|
+
export declare const justifyItemsRule: UtilityRule;
|
|
19
|
+
export declare const alignContentRule: UtilityRule;
|
|
20
|
+
// Spacing utilities (margin, padding)
|
|
21
|
+
export declare const spacingRule: UtilityRule;
|
|
22
|
+
// Width and height utilities
|
|
23
|
+
export declare const sizingRule: UtilityRule;
|
|
24
|
+
export declare const colorRule: UtilityRule;
|
|
25
|
+
// Placeholder color utilities (placeholder-{color})
|
|
26
|
+
export declare const placeholderColorRule: UtilityRule;
|
|
27
|
+
// Typography utilities
|
|
28
|
+
export declare const fontSizeRule: UtilityRule;
|
|
29
|
+
export declare const fontWeightRule: UtilityRule;
|
|
30
|
+
export declare const leadingRule: UtilityRule;
|
|
31
|
+
export declare const textAlignRule: UtilityRule;
|
|
32
|
+
// Border utilities
|
|
33
|
+
export declare const borderWidthRule: UtilityRule;
|
|
34
|
+
// Border side width utilities (border-t-0, border-r-2, border-x-4, etc.)
|
|
35
|
+
export declare const borderSideWidthRule: UtilityRule;
|
|
36
|
+
export declare const borderRadiusRule: UtilityRule;
|
|
37
|
+
// Export all rules (order matters - more specific rules first)
|
|
38
|
+
export declare const builtInRules: UtilityRule[];
|
|
39
|
+
export type UtilityRule = (_parsed: ParsedClass, _config: CrosswindConfig) => Record<string, string> | UtilityRuleResult | undefined
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CompileClassTransformer } from './transformer-compile-class';
|
|
2
|
+
import type { ExtractClassesOptions } from './parser';
|
|
3
|
+
export declare interface ScanResult {
|
|
4
|
+
classes: Set<string>
|
|
5
|
+
transformedFiles: Map<string, string>
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Scans files for utility classes using Bun's fast Glob API
|
|
9
|
+
*/
|
|
10
|
+
export declare class Scanner {
|
|
11
|
+
private patterns: string[];
|
|
12
|
+
private transformer?: CompileClassTransformer | null | undefined;
|
|
13
|
+
private extractOptions?: ExtractClassesOptions | undefined;
|
|
14
|
+
constructor(patterns: string[], transformer?: CompileClassTransformer | null | undefined, extractOptions?: ExtractClassesOptions | undefined);
|
|
15
|
+
scan(): Promise<ScanResult>;
|
|
16
|
+
scanFile(filePath: string): Promise<Set<string>>;
|
|
17
|
+
scanContent(content: string): Set<string>;
|
|
18
|
+
}
|