@master/css 2.0.0-beta.174 → 2.0.0-beta.175
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/dist/bin/index.bundle.js +3 -6
- package/dist/config/animations.d.ts +2 -7
- package/dist/config/colors.d.ts +2 -4
- package/dist/config/fonts.d.ts +0 -4
- package/dist/config/functions.d.ts +2 -8
- package/dist/config/index.d.ts +78 -29
- package/dist/config/rules.d.ts +265 -270
- package/dist/config/selectors.d.ts +2 -4
- package/dist/config/semantics.d.ts +190 -8
- package/dist/config/viewports.d.ts +2 -4
- package/dist/constants/config-esm-text.d.ts +1 -1
- package/dist/constants/config-text.d.ts +1 -1
- package/dist/constants/config-ts-text.d.ts +1 -1
- package/dist/core.d.ts +14 -11
- package/dist/index.browser.bundle.js +1 -1
- package/dist/index.bundle.js +3 -6
- package/dist/index.bundle.mjs +4 -7
- package/dist/index.d.ts +2 -1
- package/dist/layer.d.ts +12 -0
- package/dist/rule.d.ts +5 -25
- package/dist/types/css-declarations.d.ts +4 -0
- package/package.json +1 -1
- package/dist/config/classes.d.ts +0 -3
- package/dist/config/defaultRules.d.ts +0 -0
- package/dist/config/important.d.ts +0 -2
- package/dist/config/media-queries.d.ts +0 -3
- package/dist/config/override.d.ts +0 -2
- package/dist/config/root-size.d.ts +0 -2
- package/dist/config/scope.d.ts +0 -2
- package/dist/config/theme-driver.d.ts +0 -3
- package/dist/config/values.d.ts +0 -4
- package/dist/types/css-properties.d.ts +0 -4
- package/dist/utils/camel-2-kebab.d.ts +0 -1
|
@@ -1,9 +1,191 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
declare const semantics: {
|
|
2
|
+
readonly square: {
|
|
3
|
+
readonly 'aspect-ratio': "1/1";
|
|
4
|
+
};
|
|
5
|
+
readonly video: {
|
|
6
|
+
readonly 'aspect-ratio': "16/9";
|
|
7
|
+
};
|
|
8
|
+
readonly rounded: {
|
|
9
|
+
readonly 'border-radius': "1e9em";
|
|
10
|
+
};
|
|
11
|
+
readonly round: {
|
|
12
|
+
readonly 'border-radius': "50%";
|
|
13
|
+
};
|
|
14
|
+
readonly hidden: {
|
|
15
|
+
readonly display: "none";
|
|
16
|
+
};
|
|
17
|
+
readonly hide: {
|
|
18
|
+
readonly display: "none";
|
|
19
|
+
};
|
|
20
|
+
readonly block: {
|
|
21
|
+
readonly display: "block";
|
|
22
|
+
};
|
|
23
|
+
readonly table: {
|
|
24
|
+
readonly display: "table";
|
|
25
|
+
};
|
|
26
|
+
readonly flex: {
|
|
27
|
+
readonly display: "flex";
|
|
28
|
+
};
|
|
29
|
+
readonly grid: {
|
|
30
|
+
readonly display: "grid";
|
|
31
|
+
};
|
|
32
|
+
readonly contents: {
|
|
33
|
+
readonly display: "contents";
|
|
34
|
+
};
|
|
35
|
+
readonly inline: {
|
|
36
|
+
readonly display: "inline";
|
|
37
|
+
};
|
|
38
|
+
readonly 'inline-block': {
|
|
39
|
+
readonly display: "inline-block";
|
|
40
|
+
};
|
|
41
|
+
readonly 'inline-flex': {
|
|
42
|
+
readonly display: "inline-flex";
|
|
43
|
+
};
|
|
44
|
+
readonly 'inline-grid': {
|
|
45
|
+
readonly display: "inline-grid";
|
|
46
|
+
};
|
|
47
|
+
readonly 'inline-table': {
|
|
48
|
+
readonly display: "inline-table";
|
|
49
|
+
};
|
|
50
|
+
readonly 'table-cell': {
|
|
51
|
+
readonly display: "table-cell";
|
|
52
|
+
};
|
|
53
|
+
readonly 'table-caption': {
|
|
54
|
+
readonly display: "table-caption";
|
|
55
|
+
};
|
|
56
|
+
readonly 'flow-root': {
|
|
57
|
+
readonly display: "flow-root";
|
|
58
|
+
};
|
|
59
|
+
readonly 'list-item': {
|
|
60
|
+
readonly display: "list-item";
|
|
61
|
+
};
|
|
62
|
+
readonly 'table-row': {
|
|
63
|
+
readonly display: "table-row";
|
|
64
|
+
};
|
|
65
|
+
readonly 'table-column': {
|
|
66
|
+
readonly display: "table-column";
|
|
67
|
+
};
|
|
68
|
+
readonly 'table-row-group': {
|
|
69
|
+
readonly display: "table-row-group";
|
|
70
|
+
};
|
|
71
|
+
readonly 'table-column-group': {
|
|
72
|
+
readonly display: "table-column-group";
|
|
73
|
+
};
|
|
74
|
+
readonly 'table-header-group': {
|
|
75
|
+
readonly display: "table-header-group";
|
|
76
|
+
};
|
|
77
|
+
readonly 'table-footer-group': {
|
|
78
|
+
readonly display: "table-footer-group";
|
|
79
|
+
};
|
|
80
|
+
readonly italic: {
|
|
81
|
+
readonly 'font-style': "italic";
|
|
82
|
+
};
|
|
83
|
+
readonly oblique: {
|
|
84
|
+
readonly 'font-style': "oblique";
|
|
85
|
+
};
|
|
86
|
+
readonly isolate: {
|
|
87
|
+
readonly isolation: "isolate";
|
|
88
|
+
};
|
|
89
|
+
readonly overflowed: {
|
|
90
|
+
readonly overflow: "visible";
|
|
91
|
+
};
|
|
92
|
+
readonly untouchable: {
|
|
93
|
+
readonly 'pointer-events': "none";
|
|
94
|
+
};
|
|
95
|
+
readonly static: {
|
|
96
|
+
readonly position: "static";
|
|
97
|
+
};
|
|
98
|
+
readonly fixed: {
|
|
99
|
+
readonly position: "fixed";
|
|
100
|
+
};
|
|
101
|
+
readonly abs: {
|
|
102
|
+
readonly position: "absolute";
|
|
103
|
+
};
|
|
104
|
+
readonly rel: {
|
|
105
|
+
readonly position: "relative";
|
|
106
|
+
};
|
|
107
|
+
readonly sticky: {
|
|
108
|
+
readonly position: "sticky";
|
|
109
|
+
};
|
|
110
|
+
readonly uppercase: {
|
|
111
|
+
readonly 'text-transform': "uppercase";
|
|
112
|
+
};
|
|
113
|
+
readonly lowercase: {
|
|
114
|
+
readonly 'text-transform': "lowercase";
|
|
115
|
+
};
|
|
116
|
+
readonly capitalize: {
|
|
117
|
+
readonly 'text-transform': "capitalize";
|
|
118
|
+
};
|
|
119
|
+
readonly visible: {
|
|
120
|
+
readonly visibility: "visible";
|
|
121
|
+
};
|
|
122
|
+
readonly invisible: {
|
|
123
|
+
readonly visibility: "hidden";
|
|
124
|
+
};
|
|
125
|
+
readonly vw: {
|
|
126
|
+
readonly width: "100vw";
|
|
127
|
+
};
|
|
128
|
+
readonly vh: {
|
|
129
|
+
readonly height: "100vh";
|
|
130
|
+
};
|
|
131
|
+
readonly 'max-vw': {
|
|
132
|
+
readonly 'max-width': "100vw";
|
|
133
|
+
};
|
|
134
|
+
readonly 'max-vh': {
|
|
135
|
+
readonly 'max-height': "100vh";
|
|
136
|
+
};
|
|
137
|
+
readonly 'min-vw': {
|
|
138
|
+
readonly 'min-width': "100vw";
|
|
139
|
+
};
|
|
140
|
+
readonly 'min-vh': {
|
|
141
|
+
readonly 'min-height': "100vh";
|
|
142
|
+
};
|
|
143
|
+
readonly 'center-content': {
|
|
144
|
+
readonly 'justify-content': "center";
|
|
145
|
+
readonly 'align-items': "center";
|
|
146
|
+
};
|
|
147
|
+
readonly 'sr-only': {
|
|
148
|
+
readonly position: "absolute";
|
|
149
|
+
readonly width: "1px";
|
|
150
|
+
readonly height: "1px";
|
|
151
|
+
readonly padding: "0";
|
|
152
|
+
readonly margin: "-1px";
|
|
153
|
+
readonly overflow: "hidden";
|
|
154
|
+
readonly clip: "rect(0,0,0,0)";
|
|
155
|
+
readonly 'white-space': "nowrap";
|
|
156
|
+
readonly 'border-width': "0";
|
|
157
|
+
};
|
|
158
|
+
readonly full: {
|
|
159
|
+
readonly width: "100%";
|
|
160
|
+
readonly height: "100%";
|
|
161
|
+
};
|
|
162
|
+
readonly center: {
|
|
163
|
+
readonly left: 0;
|
|
164
|
+
readonly right: 0;
|
|
165
|
+
readonly 'margin-left': "auto";
|
|
166
|
+
readonly 'margin-right': "auto";
|
|
167
|
+
};
|
|
168
|
+
readonly middle: {
|
|
169
|
+
readonly top: 0;
|
|
170
|
+
readonly bottom: 0;
|
|
171
|
+
readonly 'margin-top': "auto";
|
|
172
|
+
readonly 'margin-bottom': "auto";
|
|
173
|
+
};
|
|
174
|
+
readonly 'break-spaces': {
|
|
175
|
+
readonly 'white-space': "break-spaces";
|
|
176
|
+
};
|
|
177
|
+
readonly 'break-word': {
|
|
178
|
+
readonly 'overflow-wrap': "break-word";
|
|
179
|
+
readonly overflow: "hidden";
|
|
180
|
+
};
|
|
181
|
+
readonly 'gradient-text': {
|
|
182
|
+
readonly '-webkit-text-fill-color': "transparent";
|
|
183
|
+
readonly '-webkit-background-clip': "text";
|
|
184
|
+
readonly 'background-clip': "text";
|
|
185
|
+
};
|
|
186
|
+
readonly fit: {
|
|
187
|
+
readonly width: "fit-content";
|
|
188
|
+
readonly height: "fit-content";
|
|
189
|
+
};
|
|
9
190
|
};
|
|
191
|
+
export default semantics;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CONFIG_ESM_TEXT = "/** @type {import('@master/css').Config} */\nexport default {\n classes: {},\n colors: {},\n
|
|
1
|
+
export declare const CONFIG_ESM_TEXT = "/** @type {import('@master/css').Config} */\nexport default {\n classes: {},\n colors: {},\n rules: {},\n values: {},\n semantics: {},\n viewports: {},\n mediaQueries: {},\n animations: {},\n selectors: {},\n functions: {}\n}\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CONFIG_TEXT = "/** @type {import('@master/css').Config} */\nmodule.exports = {\n classes: {},\n colors: {},\n
|
|
1
|
+
export declare const CONFIG_TEXT = "/** @type {import('@master/css').Config} */\nmodule.exports = {\n classes: {},\n colors: {},\n rules: {},\n values: {},\n semantics: {},\n viewports: {},\n mediaQueries: {},\n animations: {},\n selectors: {},\n functions: {}\n}\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CONFIG_TS_TEXT = "import type { Config } from '@master/css'\n\nexport default {\n classes: {},\n colors: {},\n
|
|
1
|
+
export declare const CONFIG_TS_TEXT = "import type { Config } from '@master/css'\n\nexport default {\n classes: {},\n colors: {},\n rules: {},\n values: {},\n semantics: {},\n viewports: {},\n mediaQueries: {},\n animations: {},\n selectors: {},\n functions: {}\n} as Config\n";
|
package/dist/core.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Rule,
|
|
2
|
-
import type { Config
|
|
1
|
+
import { Rule, RuleNative } from './rule';
|
|
2
|
+
import type { Config } from './config';
|
|
3
|
+
import { RuleConfig } from './config';
|
|
3
4
|
export interface MasterCSS {
|
|
4
5
|
readonly style: HTMLStyleElement;
|
|
5
6
|
readonly host: Element;
|
|
6
7
|
readonly root: Document | ShadowRoot;
|
|
7
|
-
semantics: [RegExp, [string, string | Record<string, string>]][];
|
|
8
8
|
classes: Record<string, string[]>;
|
|
9
|
-
|
|
9
|
+
colors: Record<string, Record<string, string>>;
|
|
10
10
|
colorNames: string[];
|
|
11
11
|
themeNames: string[];
|
|
12
12
|
classesBy: Record<string, string[]>;
|
|
@@ -16,26 +16,29 @@ export interface MasterCSS {
|
|
|
16
16
|
globalValues: Record<string, string | number>;
|
|
17
17
|
viewports: Record<string, number>;
|
|
18
18
|
mediaQueries: Record<string, string>;
|
|
19
|
-
matches: Record<string, RegExp>;
|
|
20
19
|
keyframesMap: Record<string, {
|
|
21
20
|
native: RuleNative;
|
|
22
21
|
count: number;
|
|
23
22
|
}>;
|
|
24
|
-
animations:
|
|
23
|
+
animations: Config['animations'];
|
|
25
24
|
}
|
|
26
25
|
export declare class MasterCSS {
|
|
27
|
-
|
|
26
|
+
customConfig: Config;
|
|
28
27
|
static root: MasterCSS;
|
|
29
28
|
static config: Config;
|
|
30
29
|
static instances: MasterCSS[];
|
|
31
|
-
static refresh: (
|
|
30
|
+
static refresh: (customConfig: Config) => void;
|
|
32
31
|
readonly rules: Rule[];
|
|
33
32
|
readonly ruleBy: Record<string, Rule>;
|
|
34
33
|
readonly countBy: {};
|
|
35
34
|
readonly observing = false;
|
|
35
|
+
readonly config: Config;
|
|
36
|
+
private readonly _semanticRuleConfigs;
|
|
37
|
+
private readonly _orderedRuleConfigs;
|
|
38
|
+
colorTokenRegExp: RegExp;
|
|
36
39
|
observer: MutationObserver;
|
|
37
40
|
private colorByThemeByColorName;
|
|
38
|
-
constructor(
|
|
41
|
+
constructor(customConfig?: Config);
|
|
39
42
|
resolve(): void;
|
|
40
43
|
/**
|
|
41
44
|
* Observe the DOM for changes and update the running stylesheet. (browser only)
|
|
@@ -50,7 +53,7 @@ export declare class MasterCSS {
|
|
|
50
53
|
* @param syntax class syntax
|
|
51
54
|
* @returns css text
|
|
52
55
|
*/
|
|
53
|
-
match(syntax: string):
|
|
56
|
+
match(syntax: string): RuleConfig;
|
|
54
57
|
/**
|
|
55
58
|
* Create rules from class syntax
|
|
56
59
|
* @param syntax class syntax
|
|
@@ -60,7 +63,7 @@ export declare class MasterCSS {
|
|
|
60
63
|
/**
|
|
61
64
|
* 根據蒐集到的所有 DOM class 重新 create
|
|
62
65
|
*/
|
|
63
|
-
refresh(
|
|
66
|
+
refresh(customConfig?: Config): void;
|
|
64
67
|
destroy(): void;
|
|
65
68
|
/**
|
|
66
69
|
* 透過類名來刪除對應的 rules
|