-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathrules_new.ts
More file actions
30 lines (27 loc) · 855 Bytes
/
rules_new.ts
File metadata and controls
30 lines (27 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { StyleCollection } from "../injection";
import type {
ContainerContextValue,
VariableContextValue,
} from "../reactivity";
import type { GetFunction } from "../tracking";
import type { Config } from "./useNativeCss";
export function updateRulesNew(
get: GetFunction,
originalProps: Record<string, unknown>,
configs: Config[],
inheritedVariables: VariableContextValue,
inheritedContainers: ContainerContextValue,
) {
let inlineVariables: Record<string, unknown> | undefined;
let animated = false;
for (const config of configs) {
const styleRuleSet = [];
const source = originalProps[config.source];
if (typeof source === "string") {
const classNames = source.split(/\s+/);
for (const className of classNames) {
styleRuleSet.push(...get(StyleCollection.styles(className)));
}
}
}
}