@master/css 2.0.0-beta.12 → 2.0.0-beta.121
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 +102 -109
- package/dist/bin/index.d.ts +2 -0
- package/dist/cjs/bin/index.js +2 -0
- package/dist/cjs/config/breakpoints.js +1 -0
- package/dist/cjs/config/colors.js +1 -0
- package/dist/cjs/config/important.js +1 -0
- package/dist/cjs/config/index.js +1 -0
- package/dist/cjs/config/observe.js +1 -0
- package/dist/cjs/config/override.js +1 -0
- package/dist/cjs/config/root-size.js +1 -0
- package/dist/cjs/config/rules.js +1 -0
- package/dist/cjs/config/scope.js +1 -0
- package/dist/cjs/config/selectors.js +1 -0
- package/dist/cjs/config/semantics.js +1 -0
- package/dist/cjs/config/theme.js +1 -0
- package/dist/cjs/config/themes.js +1 -0
- package/dist/cjs/constants/box-underneath.js +1 -0
- package/dist/cjs/constants/content-extrema.js +1 -0
- package/dist/cjs/constants/selector-symbols.js +1 -0
- package/dist/cjs/constants/sizing-values.js +1 -0
- package/dist/cjs/constants/sorted-selectors.js +1 -0
- package/dist/cjs/constants/start-symbol.js +1 -0
- package/dist/cjs/css.js +1 -0
- package/dist/cjs/index.browser.js +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.node.js +1 -0
- package/dist/cjs/methods/define-content.js +25 -0
- package/dist/cjs/methods/fill-color-scale.js +1 -0
- package/dist/cjs/methods/get-sync-with-stored-theme-script.js +1 -0
- package/dist/cjs/methods/index.js +1 -0
- package/dist/cjs/methods/render-from-html.js +1 -0
- package/dist/cjs/methods/render-into-html.js +1 -0
- package/dist/cjs/methods/render.js +1 -0
- package/dist/cjs/polyfills/css-escape.js +1 -0
- package/dist/cjs/rule.js +1 -0
- package/dist/cjs/theme.js +1 -0
- package/dist/cjs/utils/analyze-unit-value.js +1 -0
- package/dist/cjs/utils/analyze-value-token.js +1 -0
- package/dist/cjs/utils/concat-arrays.js +1 -0
- package/dist/cjs/utils/css-escape.js +1 -0
- package/dist/cjs/utils/delay.js +1 -0
- package/dist/cjs/utils/get-border-props.js +1 -0
- package/dist/cjs/utils/get-css-property-text.js +1 -0
- package/dist/cjs/utils/get-type.js +1 -0
- package/dist/cjs/utils/hex-to-rgb.js +1 -0
- package/dist/cjs/utils/is-plain-object.js +1 -0
- package/dist/cjs/utils/is-symbol.js +1 -0
- package/dist/cjs/utils/normalize-css-calc-text.js +1 -0
- package/dist/cjs/utils/parse-rule-value.js +1 -0
- package/dist/cjs/utils/parse-value-unit.js +1 -0
- package/dist/cjs/utils/read-package.js +1 -0
- package/dist/cjs/utils/rgb-to-hex.js +1 -0
- package/dist/config/breakpoints.d.ts +1 -2
- package/dist/config/colors.d.ts +3 -4
- package/dist/config/important.d.ts +1 -0
- package/dist/config/index.d.ts +299 -23
- package/dist/config/observe.d.ts +1 -0
- package/dist/config/override.d.ts +1 -0
- package/dist/config/root-size.d.ts +1 -2
- package/dist/config/rules.d.ts +3 -3
- package/dist/config/scope.d.ts +1 -0
- package/dist/config/selectors.d.ts +1 -2
- package/dist/config/semantics.d.ts +142 -43
- package/dist/config/theme.d.ts +2 -0
- package/dist/config/themes.d.ts +1 -2
- package/dist/constants/box-underneath.d.ts +5 -0
- package/dist/constants/content-extrema.d.ts +4 -0
- package/dist/constants/selector-symbols.d.ts +1 -0
- package/dist/constants/sizing-values.d.ts +7 -0
- package/dist/constants/sorted-selectors.d.ts +1 -0
- package/dist/constants/start-symbol.d.ts +1 -0
- package/dist/css.d.ts +54 -55
- package/dist/esm/bin/index.js +2 -0
- package/dist/esm/config/breakpoints.js +1 -0
- package/dist/esm/config/colors.js +1 -0
- package/dist/esm/config/important.js +1 -0
- package/dist/esm/config/index.js +1 -0
- package/dist/esm/config/observe.js +1 -0
- package/dist/esm/config/override.js +1 -0
- package/dist/esm/config/root-size.js +1 -0
- package/dist/esm/config/rules.js +1 -0
- package/dist/esm/config/scope.js +1 -0
- package/dist/esm/config/selectors.js +1 -0
- package/dist/esm/config/semantics.js +1 -0
- package/dist/esm/config/theme.js +1 -0
- package/dist/esm/config/themes.js +1 -0
- package/dist/esm/constants/box-underneath.js +1 -0
- package/dist/esm/constants/content-extrema.js +1 -0
- package/dist/esm/constants/selector-symbols.js +1 -0
- package/dist/esm/constants/sizing-values.js +1 -0
- package/dist/esm/constants/sorted-selectors.js +1 -0
- package/dist/esm/constants/start-symbol.js +1 -0
- package/dist/esm/css.js +1 -0
- package/dist/esm/index.browser.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.node.js +1 -0
- package/dist/esm/methods/define-content.js +25 -0
- package/dist/esm/methods/fill-color-scale.js +1 -0
- package/dist/esm/methods/get-sync-with-stored-theme-script.js +1 -0
- package/dist/esm/methods/index.js +1 -0
- package/dist/esm/methods/render-from-html.js +1 -0
- package/dist/esm/methods/render-into-html.js +1 -0
- package/dist/esm/methods/render.js +1 -0
- package/dist/esm/polyfills/css-escape.js +1 -0
- package/dist/esm/rule.js +1 -0
- package/dist/esm/theme.js +1 -0
- package/dist/esm/utils/analyze-unit-value.js +1 -0
- package/dist/esm/utils/analyze-value-token.js +1 -0
- package/dist/esm/utils/concat-arrays.js +1 -0
- package/dist/esm/utils/css-escape.js +1 -0
- package/dist/esm/utils/delay.js +1 -0
- package/dist/esm/utils/get-border-props.js +1 -0
- package/dist/esm/utils/get-css-property-text.js +1 -0
- package/dist/esm/utils/get-type.js +1 -0
- package/dist/esm/utils/hex-to-rgb.js +1 -0
- package/dist/esm/utils/is-plain-object.js +1 -0
- package/dist/esm/utils/is-symbol.js +1 -0
- package/dist/esm/utils/normalize-css-calc-text.js +1 -0
- package/dist/esm/utils/parse-rule-value.js +1 -0
- package/dist/esm/utils/parse-value-unit.js +1 -0
- package/dist/esm/utils/read-package.js +1 -0
- package/dist/esm/utils/rgb-to-hex.js +1 -0
- package/dist/index.browser.d.ts +6 -1
- package/dist/index.browser.js +1 -2
- package/dist/index.d.ts +9 -20
- package/dist/index.node.d.ts +2 -0
- package/dist/methods/define-content.d.ts +5 -0
- package/dist/methods/fill-color-scale.d.ts +1 -0
- package/dist/methods/get-sync-with-stored-theme-script.d.ts +1 -0
- package/dist/methods/index.d.ts +5 -0
- package/dist/methods/render-from-html.d.ts +2 -0
- package/dist/methods/render-into-html.d.ts +2 -0
- package/dist/methods/render.d.ts +2 -0
- package/dist/polyfills/css-escape.d.ts +0 -1
- package/dist/rule.d.ts +53 -38
- package/dist/theme.d.ts +22 -0
- package/dist/utils/analyze-unit-value.d.ts +4 -0
- package/dist/utils/analyze-value-token.d.ts +3 -0
- package/dist/utils/css-escape.d.ts +1 -0
- package/dist/utils/delay.d.ts +2 -0
- package/dist/utils/get-css-property-text.d.ts +1 -1
- package/dist/utils/is-plain-object.d.ts +1 -1
- package/dist/utils/normalize-css-calc-text.d.ts +1 -1
- package/dist/utils/parse-rule-value.d.ts +5 -0
- package/dist/utils/parse-value-unit.d.ts +2 -2
- package/dist/utils/read-package.d.ts +2 -0
- package/package.json +1 -162
- package/LICENSE +0 -21
- package/dist/apis/extend.d.ts +0 -5
- package/dist/apis/fill-color-scale.d.ts +0 -1
- package/dist/apis/init.d.ts +0 -3
- package/dist/apis/render-from-html.d.ts +0 -3
- package/dist/apis/render-into-html.d.ts +0 -3
- package/dist/apis/render.d.ts +0 -3
- package/dist/config/scheme.d.ts +0 -7
- package/dist/config/values.d.ts +0 -126
- package/dist/index.browser.js.map +0 -7
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -7
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -7
- package/dist/rules/accent-color.d.ts +0 -7
- package/dist/rules/align-content.d.ts +0 -6
- package/dist/rules/align-items.d.ts +0 -6
- package/dist/rules/align-self.d.ts +0 -6
- package/dist/rules/animation-delay.d.ts +0 -7
- package/dist/rules/animation-direction.d.ts +0 -6
- package/dist/rules/animation-duration.d.ts +0 -7
- package/dist/rules/animation-fill-mode.d.ts +0 -6
- package/dist/rules/animation-iteration-count.d.ts +0 -7
- package/dist/rules/animation-name.d.ts +0 -6
- package/dist/rules/animation-play-state.d.ts +0 -6
- package/dist/rules/animation-timing-function.d.ts +0 -6
- package/dist/rules/animation.d.ts +0 -8
- package/dist/rules/appearance.d.ts +0 -5
- package/dist/rules/aspect-radio.d.ts +0 -7
- package/dist/rules/backdrop-filter.d.ts +0 -11
- package/dist/rules/background-attachment.d.ts +0 -6
- package/dist/rules/background-blend-mode.d.ts +0 -5
- package/dist/rules/background-clip.d.ts +0 -9
- package/dist/rules/background-color.d.ts +0 -8
- package/dist/rules/background-image.d.ts +0 -7
- package/dist/rules/background-origin.d.ts +0 -6
- package/dist/rules/background-position.d.ts +0 -7
- package/dist/rules/background-repeat.d.ts +0 -6
- package/dist/rules/background-size.d.ts +0 -6
- package/dist/rules/background.d.ts +0 -8
- package/dist/rules/border-collapse.d.ts +0 -6
- package/dist/rules/border-color.d.ts +0 -11
- package/dist/rules/border-image-outset.d.ts +0 -5
- package/dist/rules/border-image-repeat.d.ts +0 -6
- package/dist/rules/border-image-slice.d.ts +0 -6
- package/dist/rules/border-image-source.d.ts +0 -6
- package/dist/rules/border-image-width.d.ts +0 -6
- package/dist/rules/border-image.d.ts +0 -6
- package/dist/rules/border-radius.d.ts +0 -9
- package/dist/rules/border-spacing.d.ts +0 -5
- package/dist/rules/border-style.d.ts +0 -9
- package/dist/rules/border-width.d.ts +0 -9
- package/dist/rules/border.d.ts +0 -10
- package/dist/rules/box-decoration-break.d.ts +0 -9
- package/dist/rules/box-shadow.d.ts +0 -7
- package/dist/rules/box-sizing.d.ts +0 -6
- package/dist/rules/break-after.d.ts +0 -5
- package/dist/rules/break-before.d.ts +0 -5
- package/dist/rules/break-inside.d.ts +0 -5
- package/dist/rules/caret-color.d.ts +0 -7
- package/dist/rules/clear.d.ts +0 -5
- package/dist/rules/clip-path.d.ts +0 -6
- package/dist/rules/color.d.ts +0 -8
- package/dist/rules/column-span.d.ts +0 -6
- package/dist/rules/columns.d.ts +0 -8
- package/dist/rules/contain.d.ts +0 -5
- package/dist/rules/content.d.ts +0 -5
- package/dist/rules/counter-increment.d.ts +0 -6
- package/dist/rules/cursor.d.ts +0 -5
- package/dist/rules/cx.d.ts +0 -6
- package/dist/rules/cy.d.ts +0 -6
- package/dist/rules/direction.d.ts +0 -5
- package/dist/rules/display.d.ts +0 -6
- package/dist/rules/fill.d.ts +0 -7
- package/dist/rules/filter.d.ts +0 -8
- package/dist/rules/flex-basis.d.ts +0 -5
- package/dist/rules/flex-direction.d.ts +0 -6
- package/dist/rules/flex-grow.d.ts +0 -6
- package/dist/rules/flex-shrink.d.ts +0 -6
- package/dist/rules/flex-wrap.d.ts +0 -6
- package/dist/rules/flex.d.ts +0 -7
- package/dist/rules/float.d.ts +0 -5
- package/dist/rules/font-family.d.ts +0 -6
- package/dist/rules/font-size.d.ts +0 -6
- package/dist/rules/font-smoothing.d.ts +0 -9
- package/dist/rules/font-style.d.ts +0 -7
- package/dist/rules/font-variant-numeric.d.ts +0 -6
- package/dist/rules/font-weight.d.ts +0 -7
- package/dist/rules/font.d.ts +0 -8
- package/dist/rules/gap.d.ts +0 -9
- package/dist/rules/grid-area.d.ts +0 -7
- package/dist/rules/grid-auto-columns.d.ts +0 -6
- package/dist/rules/grid-auto-flow.d.ts +0 -6
- package/dist/rules/grid-auto-rows.d.ts +0 -5
- package/dist/rules/grid-column-end.d.ts +0 -7
- package/dist/rules/grid-column-start.d.ts +0 -7
- package/dist/rules/grid-column.d.ts +0 -9
- package/dist/rules/grid-columns.d.ts +0 -10
- package/dist/rules/grid-row-end.d.ts +0 -6
- package/dist/rules/grid-row-start.d.ts +0 -6
- package/dist/rules/grid-row.d.ts +0 -9
- package/dist/rules/grid-rows.d.ts +0 -9
- package/dist/rules/grid-template-areas.d.ts +0 -5
- package/dist/rules/grid-template-columns.d.ts +0 -6
- package/dist/rules/grid-template-rows.d.ts +0 -5
- package/dist/rules/grid-template.d.ts +0 -6
- package/dist/rules/grid.d.ts +0 -6
- package/dist/rules/group.d.ts +0 -9
- package/dist/rules/height.d.ts +0 -6
- package/dist/rules/inset.d.ts +0 -9
- package/dist/rules/isolation.d.ts +0 -5
- package/dist/rules/justify-content.d.ts +0 -6
- package/dist/rules/justify-items.d.ts +0 -6
- package/dist/rules/justify-self.d.ts +0 -6
- package/dist/rules/letter-spacing.d.ts +0 -7
- package/dist/rules/line-clamp.d.ts +0 -9
- package/dist/rules/line-height.d.ts +0 -7
- package/dist/rules/lines.d.ts +0 -9
- package/dist/rules/list-style-image.d.ts +0 -6
- package/dist/rules/list-style-position.d.ts +0 -6
- package/dist/rules/list-style-type.d.ts +0 -6
- package/dist/rules/list-style.d.ts +0 -6
- package/dist/rules/margin.d.ts +0 -9
- package/dist/rules/mask-image.d.ts +0 -8
- package/dist/rules/max-height.d.ts +0 -6
- package/dist/rules/max-width.d.ts +0 -6
- package/dist/rules/min-height.d.ts +0 -6
- package/dist/rules/min-width.d.ts +0 -6
- package/dist/rules/mix-blend-mode.d.ts +0 -6
- package/dist/rules/object-fit.d.ts +0 -6
- package/dist/rules/object-position.d.ts +0 -6
- package/dist/rules/opacity.d.ts +0 -6
- package/dist/rules/order.d.ts +0 -7
- package/dist/rules/outline-color.d.ts +0 -7
- package/dist/rules/outline-offset.d.ts +0 -5
- package/dist/rules/outline-style.d.ts +0 -6
- package/dist/rules/outline-width.d.ts +0 -6
- package/dist/rules/outline.d.ts +0 -7
- package/dist/rules/overflow.d.ts +0 -9
- package/dist/rules/overscroll-behavior.d.ts +0 -8
- package/dist/rules/padding.d.ts +0 -9
- package/dist/rules/place-content.d.ts +0 -6
- package/dist/rules/place-items.d.ts +0 -6
- package/dist/rules/place-self.d.ts +0 -6
- package/dist/rules/placement.d.ts +0 -8
- package/dist/rules/pointer-events.d.ts +0 -5
- package/dist/rules/position.d.ts +0 -5
- package/dist/rules/quotes.d.ts +0 -5
- package/dist/rules/resize.d.ts +0 -5
- package/dist/rules/rx.d.ts +0 -6
- package/dist/rules/ry.d.ts +0 -6
- package/dist/rules/scroll-behavior.d.ts +0 -5
- package/dist/rules/scroll-margin.d.ts +0 -9
- package/dist/rules/scroll-padding.d.ts +0 -9
- package/dist/rules/scroll-snap-align.d.ts +0 -6
- package/dist/rules/scroll-snap-stop.d.ts +0 -6
- package/dist/rules/scroll-snap-type.d.ts +0 -6
- package/dist/rules/shape-image-threshold.d.ts +0 -6
- package/dist/rules/shape-margin.d.ts +0 -6
- package/dist/rules/shape-outside.d.ts +0 -6
- package/dist/rules/spacing.d.ts +0 -9
- package/dist/rules/stroke-dasharray.d.ts +0 -5
- package/dist/rules/stroke-dashoffset.d.ts +0 -5
- package/dist/rules/stroke-width.d.ts +0 -6
- package/dist/rules/stroke.d.ts +0 -6
- package/dist/rules/table-layout.d.ts +0 -5
- package/dist/rules/text-align.d.ts +0 -6
- package/dist/rules/text-decoration-color.d.ts +0 -7
- package/dist/rules/text-decoration-line.d.ts +0 -6
- package/dist/rules/text-decoration-style.d.ts +0 -6
- package/dist/rules/text-decoration-thickness.d.ts +0 -7
- package/dist/rules/text-decoration.d.ts +0 -8
- package/dist/rules/text-fill-color.d.ts +0 -10
- package/dist/rules/text-indent.d.ts +0 -5
- package/dist/rules/text-orientation.d.ts +0 -6
- package/dist/rules/text-overflow.d.ts +0 -6
- package/dist/rules/text-rendering.d.ts +0 -6
- package/dist/rules/text-shadow.d.ts +0 -6
- package/dist/rules/text-size.d.ts +0 -8
- package/dist/rules/text-stroke-color.d.ts +0 -10
- package/dist/rules/text-stroke-width.d.ts +0 -8
- package/dist/rules/text-stroke.d.ts +0 -8
- package/dist/rules/text-transform.d.ts +0 -6
- package/dist/rules/text-underline-offset.d.ts +0 -5
- package/dist/rules/touch-action.d.ts +0 -5
- package/dist/rules/transform-box.d.ts +0 -6
- package/dist/rules/transform-origin.d.ts +0 -7
- package/dist/rules/transform-style.d.ts +0 -6
- package/dist/rules/transform.d.ts +0 -9
- package/dist/rules/transition-delay.d.ts +0 -7
- package/dist/rules/transition-duration.d.ts +0 -7
- package/dist/rules/transition-property.d.ts +0 -6
- package/dist/rules/transition-timing-function.d.ts +0 -6
- package/dist/rules/transition.d.ts +0 -7
- package/dist/rules/user-drag.d.ts +0 -8
- package/dist/rules/user-select.d.ts +0 -8
- package/dist/rules/variable.d.ts +0 -9
- package/dist/rules/vertical-align.d.ts +0 -6
- package/dist/rules/visibility.d.ts +0 -5
- package/dist/rules/white-space.d.ts +0 -6
- package/dist/rules/width.d.ts +0 -6
- package/dist/rules/will-change.d.ts +0 -5
- package/dist/rules/word-break.d.ts +0 -6
- package/dist/rules/word-spacing.d.ts +0 -6
- package/dist/rules/writing-mode.d.ts +0 -6
- package/dist/rules/x.d.ts +0 -6
- package/dist/rules/y.d.ts +0 -6
- package/dist/rules/z-index.d.ts +0 -7
- package/dist/utils/parse-value.d.ts +0 -6
- package/readme.md +0 -118
package/dist/css.d.ts
CHANGED
|
@@ -1,74 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
prototype: MutationObserver;
|
|
6
|
-
};
|
|
7
|
-
export default class MasterCSS extends MutationObserver {
|
|
8
|
-
#private;
|
|
9
|
-
config?: MasterCSSConfig;
|
|
10
|
-
root?: Document | ShadowRoot;
|
|
11
|
-
static instances: MasterCSS[];
|
|
12
|
-
static root: MasterCSS;
|
|
13
|
-
/**
|
|
14
|
-
* 全部 sheet 根據目前蒐集到的所有 DOM class 重新 findAndNew
|
|
15
|
-
*/
|
|
16
|
-
static refresh(config: MasterCSSConfig): void;
|
|
1
|
+
import { Rule, RuleMeta } from './rule';
|
|
2
|
+
import type { Config } from './config';
|
|
3
|
+
import { Theme } from './theme';
|
|
4
|
+
export interface MasterCSS {
|
|
17
5
|
readonly style: HTMLStyleElement;
|
|
18
|
-
readonly rules: MasterCSSRule[];
|
|
19
|
-
readonly ruleOfClass: Record<string, MasterCSSRule>;
|
|
20
|
-
readonly countOfClass: {};
|
|
21
6
|
readonly host: Element;
|
|
22
|
-
readonly
|
|
23
|
-
semantics: [RegExp, string][];
|
|
7
|
+
readonly root: Document | ShadowRoot;
|
|
8
|
+
semantics: [RegExp, [string, string | Record<string, string>]][];
|
|
24
9
|
classes: Record<string, string[]>;
|
|
25
|
-
|
|
10
|
+
colorThemesMap: Record<string, Record<string, string>>;
|
|
26
11
|
colorNames: string[];
|
|
27
12
|
themeNames: string[];
|
|
28
13
|
relationThemesMap: Record<string, Record<string, string[]>>;
|
|
29
14
|
relations: Record<string, string[]>;
|
|
30
15
|
selectors: Record<string, [RegExp, string[]][]>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
16
|
+
values: Record<string, Record<string, string | number>>;
|
|
17
|
+
globalValues: Record<string, string | number>;
|
|
18
|
+
breakpoints: Record<string, number>;
|
|
19
|
+
mediaQueries: Record<string, string>;
|
|
20
|
+
matches: Record<string, RegExp>;
|
|
21
|
+
theme: Theme | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare class MasterCSS {
|
|
24
|
+
config?: Config;
|
|
25
|
+
static root: MasterCSS;
|
|
26
|
+
static instances: MasterCSS[];
|
|
27
|
+
static refresh: (config: Config) => void;
|
|
28
|
+
readonly rules: Rule[];
|
|
29
|
+
readonly ruleOfClass: Record<string, Rule>;
|
|
30
|
+
readonly countOfClass: {};
|
|
31
|
+
readonly ready: boolean;
|
|
32
|
+
_observer: MutationObserver;
|
|
33
|
+
constructor(config?: Config);
|
|
34
|
+
cache(): void;
|
|
35
|
+
observe(targetRoot: Document | ShadowRoot | null, options?: MutationObserverInit): this;
|
|
42
36
|
disconnect(): void;
|
|
43
37
|
/**
|
|
44
|
-
*
|
|
38
|
+
* 比對是否為 Master CSS 的類名語法
|
|
45
39
|
*/
|
|
46
|
-
|
|
40
|
+
match(className: string): RuleMeta;
|
|
47
41
|
/**
|
|
48
|
-
*
|
|
42
|
+
* 透過類名 ( 包含 .classes ) 生成 rules[]
|
|
49
43
|
*/
|
|
50
|
-
|
|
44
|
+
create(className: string): Rule[];
|
|
45
|
+
/**
|
|
46
|
+
* 根據蒐集到的所有 DOM class 重新 create
|
|
47
|
+
*/
|
|
48
|
+
refresh(config: Config): void;
|
|
51
49
|
destroy(): void;
|
|
52
50
|
/**
|
|
53
|
-
*
|
|
54
|
-
* 2. normal
|
|
55
|
-
* 3. where selectors
|
|
56
|
-
* 4. normal selectors
|
|
57
|
-
* 5. media where
|
|
58
|
-
* 6. media normal
|
|
59
|
-
* 7. media selectors
|
|
60
|
-
* 8. media width where
|
|
61
|
-
* 9. media width
|
|
62
|
-
* 10. media width selectors
|
|
51
|
+
* 透過類名來刪除對應的 rules
|
|
63
52
|
*/
|
|
64
|
-
insert(rule: MasterCSSRule): void;
|
|
65
53
|
delete(className: string): void;
|
|
66
|
-
|
|
54
|
+
/**
|
|
55
|
+
* 依類名插入規則
|
|
56
|
+
*/
|
|
57
|
+
insert(eachClassName: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 加工插入規則
|
|
60
|
+
* 1. where
|
|
61
|
+
* 2. normal
|
|
62
|
+
* 3. where selectors
|
|
63
|
+
* 4. normal selectors
|
|
64
|
+
* 5. media where
|
|
65
|
+
* 6. media normal
|
|
66
|
+
* 7. media selectors
|
|
67
|
+
* 8. media width where
|
|
68
|
+
* 9. media width
|
|
69
|
+
* 10. media width selectors
|
|
70
|
+
*/
|
|
71
|
+
insertRules(rules: Rule[]): void;
|
|
67
72
|
get text(): string;
|
|
68
73
|
}
|
|
69
|
-
declare global {
|
|
70
|
-
interface Window {
|
|
71
|
-
MasterCSS: typeof MasterCSS;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{program as c}from"commander";import w from"path";import{readPackage as S}from"../utils/read-package";import m from"chokidar";import a from"fs";import{defineContent as x}from"../methods/define-content";import t from"@techor/log";c.command("init").description("Create a Master CSS definition file with configuration").allowUnknownOption().option("--jit","With initialization of the just-in-time program").option("-c, --compiler","With compiler options").option("-o, --override","Override the existing definition file").option("--ext <extension>","Definition extension `ts`, `js`, `mjs`").action(function(l){let{ext:e}=l;if(!e)if(a.existsSync("tsconfig.json"))e="ts";else{let{type:d}=S();d==="module"?e="mjs":e="js"}let i=x({...l,ext:e}),n=`master.css.${e}`,s=a.existsSync(w.join(process.cwd(),n));s?s&&l.override?(a.writeFileSync(n,i),t.ok`**${n}** definition file is overridden`):t.x`**${n}** definition file already exists`:(a.writeFileSync(n,i),t.ok`**${n}** definition file is created`)});c.command("build",{isDefault:!0}).allowUnknownOption().option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your master CSS file output path","master.css").action(async function({watch:l,output:e}){let i=await new(await import("@master/css-compiler")).default().compile(),n=r=>i.insert(r,a.readFileSync(r,{encoding:"utf-8"})),s=()=>a.writeFileSync(e,i.css.text),d=i.sources;if(console.log(""),t`[sources] ${d}`,l){let r=[],p=async()=>{let{include:o,exclude:y,sources:u}=i.options;o?.length&&g(m.watch(o,{ignored:y,ignoreInitial:!0})),u?.length&&g(m.watch(u,{ignoreInitial:!0})),s(),t.tree(i.options)},h=async o=>{n(o),s()},g=o=>{r.push(o.on("add",h).on("change",h))};await p(),console.log(""),t.t`Start watching source changes`,t.tree(i.options);let f=async()=>{await Promise.all(r.map(o=>o.close())),r.length=0,await i.refresh(),await p()};m.watch([i.resolvedConfigPath],{ignoreInitial:!0}).on("add",f).on("change",f).on("unlink",f)}else s()});var{version:j,name:k,description:v}=S(w.join(__dirname,"../../package.json"));c.name(k);c.description(v);c.version(j);c.parse();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var x={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560};export{x as breakpoints};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fillColorScale as f}from"../methods/fill-color-scale";var a={black:"#000000",white:"#ffffff",slate:f({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:f({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:f({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:f({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:f({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:f({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:f({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:f({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:f({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:f({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:f({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:f({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:f({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:f({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:f({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:f({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:f({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:f({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:f({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:f({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};export{a as colors};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=!1;export{t as important};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{breakpoints as e}from"./breakpoints";import{colors as r}from"./colors";import{rootSize as s}from"./root-size";import{scope as o}from"./scope";import{selectors as t}from"./selectors";import{semantics as i}from"./semantics";import{themes as m}from"./themes";import{theme as n}from"./theme";import{rules as p}from"./rules";import{override as a}from"./override";import{observe as l}from"./observe";import{important as g}from"./important";var Q={breakpoints:e,colors:r,rootSize:s,scope:o,selectors:t,semantics:i,themes:m,theme:n,rules:p,override:a,observe:l,important:g};export{e as breakpoints,r as colors,Q as config,g as important,l as observe,a as override,s as rootSize,p as rules,o as scope,t as selectors,i as semantics,n as theme,m as themes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=!0;export{e as observe};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=!1;export{e as override};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=16;export{o as rootSize};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{analyzeValueToken as f}from"../utils/analyze-value-token";import{getBorderProps as b}from"../utils/get-border-props";import{parseValueUnit as y}from"../utils/parse-value-unit";import{START_SYMBOL as v}from"../constants/start-symbol";import{BOX_UNDERNEATH as d}from"../constants/box-underneath";import{CONTENT_EXTREMA as x}from"../constants/content-extrema";import{SIZING_VALUES as h}from"../constants/sizing-values";import"../polyfills/css-escape";import{cssEscape as w}from"../utils/css-escape";var P={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,r,t){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...f(e.slice(s),r,t)]},getThemeProps(e,r){let t={},s=(o,a)=>{let i=a.indexOf(":");if(i!==-1){o in t||(t[o]={});let c=t[o],g=a.slice(0,i);g in c||(c[g]=a.slice(i+1))}},l=o=>{let a=(i,c)=>{let g=c.slice(w(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let k of g)s(i,k)};if(this.theme){let i=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);i&&a(this.theme,i.text)}else for(let i of o.natives)a(i.theme,i.text)},u=[],n="",p=()=>{n&&(u.push(n.replace(/ /g,"")),n="")},m=1;(function o(a){for(;m<e.value.length;m++){let i=e.value[m];if(!a){if(i===";"){p();continue}if(i==="}")break}if(n+=i,a===i){if(a==="'"||a==='"'){let c=0;for(let g=n.length-2;n[g]==="\\";g--)c++;if(c%2)continue}break}else i in v&&a!=="'"&&a!=='"'&&(m++,o(v[i]))}})(void 0),p();for(let o of u){let a=r.create(o);if(Array.isArray(a))for(let i of a)l(i);else a?l(a):s(this.theme??"",o)}return t}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:"",values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)",values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let r={};switch(e.value){case"subpixel-antialiased":r["-webkit-font-smoothing"]=r["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":r["-webkit-font-smoothing"]={...e,value:"antialiased"},r["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return r}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},spacing:{matches:"^[pm][xytblr]?:.",prop:!1,get(e){let t=this.prefix[0]==="m"?"margin":"padding",s=t+"-left",l=t+"-right",u=t+"-top",n=t+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[l]:e};case"y":return{[u]:e,[n]:e};case"l":return{[s]:e};case"r":return{[l]:e};case"t":return{[u]:e};case"b":return{[n]:e};default:return{[t]:e}}},get order(){return this.prefix==="p:"||this.prefix==="m:"?-1:0}},margin:{matches:"^margin(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="margin:"?-1:0}},padding:{matches:"^padding(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="padding:"?-1:0}},flexBasis:{values:h},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",values:{col:"column","col-reverse":"column-reverse"}},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:.",values:h},height:{matches:"^h:.",values:h},minWidth:{matches:"^min-w:.",values:h},minHeight:{matches:"^min-h:.",values:h},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e,r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{width:{...e,value:r},height:{...e,value:t}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e.slice(4),r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{"min-width":{...e,value:r},"min-height":{...e,value:t}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e.slice(4),r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{"max-width":{...e,value:r},"max-height":{...e,value:t}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:.",values:h},maxWidth:{matches:"^max-w:.",values:h},boxSizing:{matches:"^box:(?:$values)(?!\\|)",values:{content:"content-box",border:"border-box"}},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{values:{abs:"absolute",rel:"relative"}},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:r,value:t}=e,s=.75;return{"font-size":e,"line-height":{...e,value:r==="em"?t+s+r:`calc(${t}${r} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)",values:{...d,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:r}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(t,s,l,u)=>{let n,p;switch(s){case"translate":n="rem";break;case"skew":n="deg";break;case"rotate":l==="3d"&&(p=!0),n="deg";break;default:return t}let m=u.split(",");return t.replace(u,m.map((o,a)=>!p||m.length-1===a?Number.isNaN(+o)?o:o/(n==="rem"?r:1)+n:o).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return b(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let t="",s=this.prefix.split("-");if(s.length>1)for(let l=1;l<s.length-1;l++)t+=s[l][0];else t=this.prefix.slice(1,-1);switch(t){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return b(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return b(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return b(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}},values:d},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)",values:d},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,r){return y(e,t=>{switch(t){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},r)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,r){return y(e,t=>{switch(t){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},r)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:.",values:x},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{values:x},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:.",values:x},gridTemplateRows:{values:x},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:"",values:{first:-999999,last:999999}},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",values:{...d,margin:"margin-box"}},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:.",values:{...d,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};export{P as rules};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o="";export{o as scope};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={"::scrollbar":"::-webkit-scrollbar","::scrollbar-button":"::-webkit-scrollbar-button","::scrollbar-thumb":"::-webkit-scrollbar-thumb","::scrollbar-track":"::-webkit-scrollbar-track","::scrollbar-track-piece":"::-webkit-scrollbar-track-piece","::scrollbar-corner":"::-webkit-scrollbar-corner","::slider-thumb":["::-webkit-slider-thumb","::-moz-range-thumb"],"::slider-runnable-track":["::-webkit-slider-runnable-track","::-moz-range-track"],"::meter":"::-webkit-meter","::resizer":"::-webkit-resizer","::progress":"::-webkit-progress",":first":":first-child",":last":":last-child",":even":":nth-child(2n)",":odd":":nth-child(odd)",":nth(":":nth-child("};export{r as selectors};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i={square:{"aspect-ratio":"1/1"},video:{"aspect-ratio":"16/9"},rounded:{"border-radius":"1e9em"},round:{"border-radius":"50%"},hidden:{display:"none"},hide:{display:"none"},block:{display:"block"},table:{display:"table"},flex:{display:"flex"},grid:{display:"grid"},contents:{display:"contents"},inline:{display:"inline"},"inline-block":{display:"inline-block"},"inline-flex":{display:"inline-flex"},"inline-grid":{display:"inline-grid"},"inline-table":{display:"inline-table"},"table-cell":{display:"table-cell"},"table-caption":{display:"table-caption"},"flow-root":{display:"flow-root"},"list-item":{display:"list-item"},"table-row":{display:"table-row"},"table-column":{display:"table-column"},"table-row-group":{display:"table-row-group"},"table-column-group":{display:"table-column-group"},"table-header-group":{display:"table-header-group"},"table-footer-group":{display:"table-footer-group"},italic:{"font-style":"italic"},oblique:{"font-style":"oblique"},isolate:{isolation:"isolate"},overflow:{overflow:"visible"},untouchable:{"pointer-events":"none"},static:{position:"static"},fixed:{position:"fixed"},abs:{position:"absolute"},rel:{position:"relative"},sticky:{position:"sticky"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},visible:{visibility:"visible"},invisible:{visibility:"hidden"},vw:{width:"100vw"},vh:{height:"100vh"},"max-vw":{"max-width":"100vw"},"max-vh":{"max-height":"100vh"},"min-vw":{"min-width":"100vw"},"min-vh":{"min-height":"100vh"},"center-content":{"justify-content":"center","align-items":"center"},"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap","border-width":"0"},full:{width:"100%",height:"100%"},center:{left:0,right:0,"margin-left":"auto","margin-right":"auto"},middle:{top:0,bottom:0,"margin-top":"auto","margin-bottom":"auto"},"break-spaces":{"white-space":"break-spaces"},"break-word":{"overflow-wrap":"break-word",overflow:"hidden"}};export{i as semantics};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={store:"theme"};export{e as theme};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=["dark","light"];export{t as themes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={content:"content-box",border:"border-box",padding:"padding-box"};export{o as BOX_UNDERNEATH};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n={min:"min-content",max:"max-content"};export{n as CONTENT_EXTREMA};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var S=[",",".","#","[","!","*",">","+","~",":","@"];export{S as SELECTOR_SYMBOLS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{breakpoints as n}from"../config";var o={full:"100%",fit:"fit-content",max:"max-content",min:"min-content"};for(let t in n)o[t]=n[t]/16+"rem";export{o as SIZING_VALUES};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[":disabled",":active",":focus",":hover"];export{e as SORTED_SELECTORS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={"(":")","'":"'",'"':'"',"{":"}"};export{o as START_SYMBOL};
|
package/dist/esm/css.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var $=Object.defineProperty;var D=(O,e,t)=>e in O?$(O,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):O[e]=t;var S=(O,e,t)=>(D(O,typeof e!="symbol"?e+"":e,t),t);function L(O){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&O instanceof e||O instanceof Date||O instanceof RegExp)}function N(O){if(typeof Buffer<"u"&&Buffer&&O instanceof Buffer){let e=Buffer.alloc(O.length);return O.copy(e),e}else{if(O instanceof Date)return new Date(O.getTime());if(O instanceof RegExp)return new RegExp(O);throw new Error("Unexpected situation")}}function I(O){let e=[];return O.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=I(t):L(t)?e[s]=N(t):e[s]=W({},t):e[s]=t}),e}function F(O,e){return e==="__proto__"?void 0:O[e]}function W(...O){let e={},t,s;return O.forEach(function(d){typeof d!="object"||d===null||Array.isArray(d)||Object.keys(d).forEach(function(x){if(s=F(e,x),t=F(d,x),t!==e)if(typeof t!="object"||t===null){e[x]=t;return}else if(Array.isArray(t)){e[x]=I(t);return}else if(L(t)){e[x]=N(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[x]=W({},t);return}else{e[x]=W(s,t);return}})}),e}import{Rule as H}from"./rule";import{config as B}from"./config";import{Theme as Q}from"./theme";import{rgbToHex as z}from"./utils/rgb-to-hex";import{SELECTOR_SYMBOLS as _}from"./constants/selector-symbols";var A=typeof window<"u",j=class{constructor(e){this.config=e;this.config?.override||(this.config=W(B,e)),this.cache(),A&&this.config.observe&&this.observe(document),j.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=A?new MutationObserver(e=>{let t={},s=[],d=[],x=[],w=(c,n)=>{n?c.classList.forEach(y):c.classList.forEach(g);let l=c.children;for(let m=0;m<l.length;m++){let f=l[m];f.classList&&(d.push(f),w(f,n))}},g=c=>{c in t?t[c]++:t[c]=1},y=c=>{c in t?t[c]--:c in this.countOfClass&&(t[c]=-1)},M=(c,n)=>{for(let l=0;l<c.length;l++){let m=c[l];m.classList&&!d.includes(m)&&!x.includes(m)&&(m.isConnected!==n?(d.push(m),w(m,n)):x.push(m))}};for(let c=0;c<e.length;c++){let n=e[c],{addedNodes:l,removedNodes:m,type:f,target:h}=n;if(f==="attributes"){if(s.find(C=>C.target===h))continue;s.push(n)}else M(l,!1),(!h.isConnected||!d.includes(h))&&M(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:c,target:n}of s){let l=d.includes(n),m=n.classList,f=c?c.split(" "):[];if(l){if(n.isConnected)continue;for(let h of f)m.contains(h)||y(h)}else if(n.isConnected){m.forEach(h=>{f.includes(h)||g(h)});for(let h of f)m.contains(h)||y(h)}}for(let c in t){let n=t[c],l=(this.countOfClass[c]||0)+n;l===0?(delete this.countOfClass[c],this.delete(c)):(c in this.countOfClass||this.insert(c),this.countOfClass[c]=l)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.relationThemesMap={},this.relations={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:e,classes:t,selectors:s,themes:d,colors:x,values:w,breakpoints:g,mediaQueries:y,rules:M}=this.config;function c(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i="",u={}){let a=R=>R?(i?i+"-":"")+R:i,b=Object.entries(r),p=[],T=[];for(let R of b){let E=R[1];(typeof E=="object"&&!Array.isArray(E)?p:T).push(R)}for(let[R,E]of p)n(E,o,a(R),u);if(o&&i)T.length&&(u[i]=T.reduce((R,[E,V])=>(R[E]=V,R),{}));else for(let[R,E]of T)u[a(R)]=E;return u}if(e)for(let[r,o]of Object.entries(n(e,!0)))this.semantics.push([new RegExp("^"+c(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,o]]);if(s)for(let[r,o]of Object.entries(n(s,!1))){let i=new RegExp(c(r)+"(?![a-z-])");for(let u of Array.isArray(o)?o:[o]){let a=u.match(/^::-[a-z]+-/m)?.[0]??"",b=this.selectors[a];b||(b=this.selectors[a]=[]);let p=b.find(([T])=>T===i);p||(p=[i,[]],b.push(p)),p[1].push(u)}}w&&(this.globalValues=n(w,!1)),g&&(this.breakpoints=n(g,!1)),y&&(this.mediaQueries=n(y,!1));let l=t?n(t,!1):{},m=d&&!Array.isArray(d)?Object.entries(d).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:i}])=>(r[o]=n(i,!1),r),{}):{},f=[...Object.keys(l),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],h=r=>{if(r in this.classes)return;let o=this.classes[r]=[],i=(u,a)=>{if(!a)return;let b=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of b){let T=R=>{R in this.relationThemesMap?u in this.relationThemesMap[R]?this.relationThemesMap[R][u].push(r):this.relationThemesMap[R][u]=[r]:this.relationThemesMap[R]={[u]:[r]},o.includes(R)||o.push(R)};if(f.includes(p)){h(p);for(let R of this.classes[p])T(R)}else T(p)}};i("",l?.[r]);for(let[u,a]of Object.entries(m))i(u,a?.[r])};for(let r of f)h(r);for(let r in this.relationThemesMap){let o=this.relations[r]=[];for(let i of Object.values(this.relationThemesMap[r]))for(let u of i)o.includes(u)||o.push(u)}let C=(r,o)=>{if(!o)return;let i=n(o,!0);for(let[u,a]of Object.entries(i)){let b=typeof a=="string"?{"":a}:a;for(let[p,T]of Object.entries(b)){let R=u+(p?"-"+p:"");R in this.colorThemesMap?this.colorThemesMap[R][r]=T:this.colorThemesMap[R]={[r]:T}}}for(let u in o)this.colorNames.includes(u)||this.colorNames.push(u)};if(C("",x),d)if(Array.isArray(d))this.themeNames.push(...d);else for(let r in d){let o=d[r];C(r,o.colors),this.themeNames.push(r)}let v=r=>{for(let[o,i]of Object.entries(this.colorThemesMap))for(let[u,a]of Object.entries(i))a.startsWith("#")||r(o,i,u,a)};if(v((r,o,i,u)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(u);if(a){let b="#"+z(+a[1],+a[2],+a[3]);a[4]&&(b+=Math.round(255*+a[4]).toString(16)),o[i]=b}}),v((r,o,i,u)=>{let[a,b]=u.split("/"),p=this.colorThemesMap[a];if(p){let T=(i?p[i]:void 0)??p[""];o[i]=b?T.slice(0,7)+Math.round(255*+b).toString(16):T}else console.warn(`\`${u}\` doesn't exist in the extended config \`.colors\``),delete o[i],Object.keys(o).length||delete this.colorThemesMap[r]}),M)for(let r in M){let o=M[r],{matches:i,prop:u,values:a}=o;if(o.id=r,o.prop=u===!1?"":r.replace(/(?!^)[A-Z]/g,b=>"-"+b).toLowerCase(),a&&(this.values[r]=n(a,!1)),i){let b=Object.keys(this.values[r]??{}),p=i.indexOf("$values");this.matches[r]=new RegExp(p===-1?i:b.length?i.slice(0,p)+b.join("|")+i.slice(p+7):i.slice(0,p-(i[p-1]==="|"?1:0))+i.slice(p+7+(i[p+7]==="|"?1:0)))}}}observe(e,t={subtree:!0,childList:!0}){if(A&&e){this.root=e;let s=e===document;s&&(j.root=this),this.host=s?document.documentElement:root.host,this.theme=new Q(this.host,this.config.theme);let d=s?document.head:e,x=s?document.styleSheets:e.styleSheets;for(let g of x){let{title:y,href:M,ownerNode:c}=g;(y==="master"||M&&M.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(M))&&(this.style=c)}if(this.style)for(let g=0;g<this.style.sheet.cssRules.length;g++){let y=c=>{if(c.selectorText){let l=c.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let f=l[m];if(f[0]==="."){let h=f.slice(1),C="";for(let v=0;v<h.length;v++){let r=h[v],o=h[v+1];if(r==="\\"){if(v++,o!=="\\"){C+=o;continue}}else if(_.includes(r))break;C+=r}if(!(C in this.ruleOfClass)&&!(C in this.classes)){let v=this.create(C)[0];if(v)return v}}}}else if(c.cssRules)for(let n=0;n<c.cssRules.length;n++){let l=y(c.cssRules[n]);if(l)return l}},M=y(this.style.sheet.cssRules[g]);if(M){this.rules.push(M),this.ruleOfClass[M.className]=M;for(let c=0;c<M.natives.length;c++)M.natives[c].cssRule=this.style.sheet.cssRules[g+c];g+=M.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let g=d.querySelector('link[rel="styleSheet"], style');g?g.before(this.style):d.append(this.style)}let w=g=>{g.forEach(y=>{y in this.countOfClass?this.countOfClass[y]++:(this.countOfClass[y]=1,this.insert(y))})};w(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(g=>w(g.classList)),this.e.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleOfClass={},this.countOfClass={},this.rules.length=0;let e=this.style.sheet;if(e)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style.remove(),this.style=null,this.theme?.destroy(),this.theme=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],d=this.matches[t],{colorStarts:x,symbol:w,prop:g}=s,{colorNames:y,colorThemesMap:M}=this;if(d&&d.test(e))return{origin:"matches",config:s};if(x){if(e.match("^"+x+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(y.length&&e.indexOf("|")===-1){let c=e.match("^"+x+"((?:"+y.join("|")+")[0-9a-zA-Z-]*)");if(c&&c[1]in M)return{origin:"matches",config:s}}}if(w&&e.startsWith(w))return{origin:"symbol",config:s};if(g&&e.startsWith(g+":"))return{origin:"matches",config:s}}for(let t of this.semantics)if(e.match(t[0]))return{origin:"semantics",value:t[1]}}create(e){let t=s=>{if(s in this.ruleOfClass)return this.ruleOfClass[s];let d=this.match(s);if(d)return new H(s,d,this)};return(e in this.classes?this.classes[e].map(s=>t(s)):[t(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=W(B,e),this.cache(),!this.style)return;let t=document.createElement("style");t.title="master",this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleOfClass={};for(let s in this.countOfClass)this.insert(s)}destroy(){let e=j.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style.sheet,s=d=>{let x=this.ruleOfClass[d];if(!(!x||d in this.relations&&this.relations[d].some(w=>w in this.countOfClass))){if(x.natives.length){let w=x.natives[0];for(let g=0;g<t.cssRules.length;g++)if(t.cssRules[g]===w.cssRule){for(let M=0;M<x.natives.length;M++)t.deleteRule(g);this.rules.splice(this.rules.indexOf(x),1);break}}delete this.ruleOfClass[d]}};if(e in this.classes){for(let d of this.classes[e])d in this.countOfClass||s(d);delete this.ruleOfClass[e]}else s(e)}insert(e){let t=this.create(e);return t.length?(this.insertRules(t),!0):!1}insertRules(e){for(let t of e){if(this.ruleOfClass[t.className])continue;let s,d=this.rules.length-1,{media:x,order:w,priority:g,hasWhere:y,className:M}=t,c=(n,l,m,f)=>{let h=0,C;l&&(h=n.findIndex(l)),m&&(C=n.findIndex(m)),h===-1&&(h=n.length),(C===void 0||C===-1)&&(C=n.length);let v=n.slice(h,C);for(let r=0;r<v.length;r++){let o=v[r];if(!(o.priority===-1||f&&f(o))&&(o.priority<g||o.priority===g&&(y&&!o.hasWhere||o.order>=w)))return h+r}return h+v.length};if(x){let n=this.rules.findIndex(l=>l.media);if(n!==-1){let l=x.features["max-width"],m=x.features["min-width"];if(l&&m){let f=l.value-m.value;for(let h=d;h>=n;h--){s=h;let C=this.rules[h],v=C.media,r=v.features["max-width"],o=v.features["min-width"];if(!r||!o){s++;break}let i=r.value-o.value;if(i===f){if(y!==C.hasWhere)continue;if(g!==-1){let u=[this.rules[h]];for(let a=h-1;a>=n;a--){let b=this.rules[a];if(b.hasWhere!==y)break;let p=b.media,T=p.features["max-width"],R=p.features["min-width"];if(!T||!R||T.value-R.value!==i)break;u.unshift(this.rules[a])}s=c(this.rules,a=>a.media&&a.priority!==-1&&a.media.features["min-width"]&&a.media.features["max-width"])}break}else if(i>f)break}}else if(m)for(let f=n;f<=d;f++){s=f;let h=this.rules[f],C=h.media,v=C.features["max-width"],r=C.features["min-width"];if(v){if(r)break;continue}let o=r?.value;if(o===m.value){if(!y&&h.hasWhere){s++;continue}if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else for(let i=f;i<=d;i++){let u=this.rules[i],a=u.media,b=a.features["min-width"];if(!a.features["max-width"]){if(u.hasWhere!==y||b.value!==o||u.order>=w)break;s=i+1}}break}else{if(o>m.value)break;s++}}else if(l)for(let f=d;f>=n;f--){s=f;let h=this.rules[f],C=h.media,v=C.features["max-width"];if(C.features["min-width"])continue;let o=v?.value;if(!o||o>l.value){s++;break}else if(o===l.value){if(y&&!h.hasWhere)continue;if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else{let i=[this.rules[f]];for(let u=f-1;u>=n;u--){let a=this.rules[u],b=a.media,p=b.features["min-width"],T=b.features["max-width"];if(!p&&(!T||T.value!==o||a.hasWhere!==y))break;i.unshift(a)}for(let u=0;u<i.length;u++){let a=i[u];if(!a.media.features["min-width"]){if(a.order>=w)break;s=f-i.length+2+u}}}break}}}if(s===void 0)if(n===-1)s=d+1;else if(g!==-1)s=n+c(this.rules.slice(n),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(y){let l=n;for(;l<this.rules.length;l++){let m=this.rules[l];if(m.priority!==-1||!m.hasWhere||m.order>=w){s=l;break}}s===void 0&&(s=l)}else for(let l=n;l<=d;l++){s=l;let m=this.rules[l],f=m.media;if(m.priority!==-1||f.features["max-width"]||f.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=w)break}}else if(g===-1)if(y)s=this.rules.findIndex(n=>!n.hasWhere||n.media||n.priority!==-1||n.order>=w),s===-1&&(s=d+1);else{let n=0;for(;n<this.rules.length;n++){let l=this.rules[n];if(l.media||!l.hasWhere&&(l.order>=w||l.priority!==-1)){s=n;break}}s===void 0&&(s=n)}else s=c(this.rules,void 0,n=>n.media);if(this.rules.splice(s,0,t),this.ruleOfClass[M]=t,this.style){let n=this.style.sheet,l=0,m=f=>{let h=this.rules[f];if(h){if(!h.natives.length)return m(f-1);let C=h.natives[h.natives.length-1].cssRule;for(let v=0;v<n.cssRules.length;v++)if(n.cssRules[v]===C){l=v+1;break}}};m(s-1);for(let f=0;f<t.natives.length;)try{let h=t.natives[f];n.insertRule(h.text,l),h.cssRule=n.cssRules[l++],f++}catch(h){console.error(h),t.natives.splice(f,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},k=j;S(k,"root"),S(k,"instances",[]),S(k,"refresh",e=>{for(let t of j.instances)t.refresh(e)});A&&(window.MasterCSS=k);export{k as MasterCSS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MasterCSS as e}from"./css";new e(window.masterCSSConfig);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./css";export*from"./rule";export*from"./theme";import{MasterCSS as h}from"./css";function i(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function l(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function c(t){let e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=c(r):i(r)?e[n]=l(r):e[n]=u({},r):e[n]=r}),e}function a(t,e){return e==="__proto__"?void 0:t[e]}function u(...t){let e={},r,n;return t.forEach(function(f){typeof f!="object"||f===null||Array.isArray(f)||Object.keys(f).forEach(function(o){if(n=a(e,o),r=a(f,o),r!==e)if(typeof r!="object"||r===null){e[o]=r;return}else if(Array.isArray(r)){e[o]=c(r);return}else if(i(r)){e[o]=l(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){e[o]=u({},r);return}else{e[o]=u(n,r);return}})}),e}export*from"./methods";export*from"./config";export{h as default,u as extend};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MasterCSS as o}from"./css";export*from".";export{o as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var y=Object.create;var $=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var O=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var b=(n,t,s,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of x(t))!M.call(n,r)&&r!==s&&$(n,r,{get:()=>t[r],enumerable:!(e=S(t,r))||e.enumerable});return n};var j=(n,t,s)=>(s=n!=null?y(C(n)):{},b(t||!n||!n.__esModule?$(s,"default",{value:n,enumerable:!0}):s,n));var h=O(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.dedent=void 0;function v(n){for(var t=[],s=1;s<arguments.length;s++)t[s-1]=arguments[s];var e=Array.from(typeof n=="string"?[n]:n);e[e.length-1]=e[e.length-1].replace(/\r?\n([\t ]*)$/,"");var r=e.reduce(function(o,u){var a=u.match(/\n([\t ]+|(?!\s).)/g);return a?o.concat(a.map(function(d){var i,c;return(c=(i=d.match(/[\t ]/g))===null||i===void 0?void 0:i.length)!==null&&c!==void 0?c:0})):o},[]);if(r.length){var f=new RegExp(`
|
|
2
|
+
[ ]{`+Math.min.apply(Math,r)+"}","g");e=e.map(function(o){return o.replace(f,`
|
|
3
|
+
`)})}e[0]=e[0].replace(/^\r?\n/,"");var p=e[0];return t.forEach(function(o,u){var a=p.match(/(?:^|\n)( *)$/),d=a?a[1]:"",i=o;typeof o=="string"&&o.includes(`
|
|
4
|
+
`)&&(i=String(o).split(`
|
|
5
|
+
`).map(function(c,m){return m===0?c:""+d+c}).join(`
|
|
6
|
+
`)),p+=i+e[u+1]}),p}g.dedent=v;g.default=v});var l=j(h());function k({compiler:n,jit:t,ext:s}={}){let e=(i,c=", ")=>i.filter(m=>m).join(c),r=s==="ts",f=s==="js",p=s!=="ts",o=f?"":"export ",u=f?"const":"import",a=f?" = require(":" from ",d=f?")":"";return[(r||t)&&`${u} ${e([t&&(f?"{ MasterCSS }":"MasterCSS"),r?"{ Config }":""])}${a}'@master/css'${d}`,r&&n&&`${u} { Options }${a}'@master/css-compiler'${d}`,(r||t||r&&n)&&"",p&&"/** @type {import('@master/css').Config} */",l.default`${o}const config${r?": Config":""} = {
|
|
7
|
+
themes: {},
|
|
8
|
+
colors: {},
|
|
9
|
+
classes: {},
|
|
10
|
+
values: {},
|
|
11
|
+
semantics: {},
|
|
12
|
+
breakpoints: {},
|
|
13
|
+
selectors: {},
|
|
14
|
+
mediaQueries: {}
|
|
15
|
+
}`,n&&"",n&&p&&"/** @type {import('@master/css-compiler').Options} */",n&&l.default`${o}const compilerOptions${r?": Options":""} = {
|
|
16
|
+
sources: [],
|
|
17
|
+
classes: {
|
|
18
|
+
fixed: [],
|
|
19
|
+
ignored: []
|
|
20
|
+
}
|
|
21
|
+
}`,t&&`
|
|
22
|
+
${o}const css = new MasterCSS(config)`,!o&&`
|
|
23
|
+
module.exports = { ${e(["config",t&&"css",n&&"compilerOptions"])} }`].filter(i=>typeof i=="string").join(`
|
|
24
|
+
`)+`
|
|
25
|
+
`}export{k as defineContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hexToRgb as s}from"../utils/hex-to-rgb";import{rgbToHex as L}from"../utils/rgb-to-hex";function x(e){typeof e=="string"&&(e={"":e});let h=""in e,t=!1;for(let o in e)if(o&&+o>=100){t=!0;break}if(!t&&(!h||Object.keys(e).length>1)){let o=0,i="0"in e?s(e[0]):[0,0,0],c,r,l=[],b=()=>{let n=c-o,v=r.map((f,g)=>(f-i[g])/n);for(let f of l){let g=f-o,p=i.map((m,u)=>Math.round(m+v[u]*g));e[f]="#"+L.call(this,...p)}};for(let n=1;n<100;n++)n in e?(l.length?(c=n,r=s(e[n]),b(),l.length=0,i=r):i=s(e[n]),o=n):l.push(n);l.length&&(c=100,r="100"in e?s(e[100]):[255,255,255],b())}return h||(e[""]=e[t?"500":"50"]),e}export{x as fillColorScale};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(e="theme"){return`let storage=localStorage.getItem("${e}");if("system"===storage&&(storage=window.matchMedia("(prefers-color-scheme:dark)").matches?"dark":"light")||storage){const a=document.documentElement;a.classList.add(storage),a.style.colorScheme=storage}`}export{t as getSyncWithStoredThemeScript};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./render";export*from"./render-from-html";export*from"./render-into-html";export*from"./fill-color-scale";export*from"./define-content";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MasterCSS as c}from"../css";function a(r,n){if(!r)return;let e=new c({...n,observe:!1}),o=/\sclass="([^"]*)"/gm,t;for(;t=o.exec(r);){let i=t[1].replace(/\n/g,"").split(" ").filter(s=>s);for(let s of i)s in e.countOfClass||(e.insert(s),e.countOfClass[s]=1)}return e.text}export{a as renderFromHTML};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderFromHTML as t}from"./render-from-html";function i(e,r){if(e)return e.replace(/(<link[^>]*?rel="styleSheet".*?>|<style.*?>|<\/head>)/,`<style title="master">${t(e,r)}</style>$1`)}export{i as renderIntoHTML};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MasterCSS as e}from"../css";function i(r,o){if(!r?.length)return;let n=new e({...o,observe:!1});for(let t of r)t in n.countOfClass||n.insert(t)&&(n.countOfClass[t]=1);return n.text}export{i as render};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{let i=typeof global<"u"?global:window;if(!i.CSS&&!i.CSS?.escape){let r=function(s){if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let t=String(s),c=t.length,n=-1,o="",e,x=t.charCodeAt(0);if(c==1&&x==45)return"\\"+t;for(;++n<c;){if(e=t.charCodeAt(n),e==0){o+="\uFFFD";continue}if(e>=1&&e<=31||e==127||n==0&&e>=48&&e<=57||n==1&&e>=48&&e<=57&&x==45){o+="\\"+e.toString(16)+" ";continue}if(e>=128||e==45||e==95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122){o+=t.charAt(n);continue}o+="\\"+t.charAt(n)}return o};i.CSS||(i.CSS={}),i.CSS.escape=r,globalThis.CSS.escape=r}})();
|
package/dist/esm/rule.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCssPropertyText as N}from"./utils/get-css-property-text";import{analyzeValueToken as ie}from"./utils/analyze-value-token";import{parseRuleValue as E}from"./utils/parse-rule-value";import{SORTED_SELECTORS as G}from"./constants/sorted-selectors";import{cssEscape as se}from"./utils/css-escape";var H=class{constructor(y,v,b){this.className=y;this.meta=v;this.css=b;let{id:J,unit:K="rem",order:X=0,colorful:x,prop:Y,analyzeToken:z,getThemeProps:T,parseValue:D,get:F}=v.config||{},{rootSize:Z,scope:P,important:j}=b.config,{themeNames:_,colorNames:$,colorThemesMap:ee,selectors:O,globalValues:Q,breakpoints:q,mediaQueries:M}=b,I=b.values[J],U=b.relationThemesMap[y],h=y;this.order=X;let A,C,m,S;if(v.origin==="semantics"){let[l,r]=v.value;m=h.slice(l.length),A=r}else if(z)[C,S,m]=z.call(this,h,I,Q);else{let l;if(v.origin==="matches"){let r=h.indexOf(":");this.prefix=h.slice(0,r+1),this.prefix.includes("(")?(this.prefix=void 0,l=h):l=h.slice(r+1)}else v.origin==="symbol"&&(this.symbol=h[0],l=h.slice(1));[S,m]=ie(l,I,Q)}m[0]==="!"&&(this.important=!0,m=m.slice(1));let B=l=>{let r=l.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,i)=>i%3?t:t.replace(/_/g," ")).join(""),s=[],o="",u=0;for(let t=0;t<r.length;t++){let i=r[t];if(i==="\\"){o+=i+r[++t];continue}!u&&i===","?(s.push(o),o=""):(o+=i,u&&i===")"?u--:i==="("&&u++)}return o&&s.push(o),s};this.prefixSelectors=C?B(C):[""];let w=m.split("@"),V=w[0];if(V){this.vendorSuffixSelectors={};let l=(t,i,e,n)=>{for(let[a,f]of i)if(a.test(t)){for(let g of f)l(t.replace(a,g),i,e,!0);return}n&&e.push(t)},r=[];""in O?l(V,O[""],r,!0):r.push(V);let s={};for(let[t,i]of Object.entries(O)){if(!t)continue;let e=[];for(let n of r)l(n,i,e,!1);e.length&&(s[t]=e)}let o=(t,i)=>{let e=i.reduce((n,a)=>(n.push(...B(a)),n),[]);t in this.vendorSuffixSelectors?this.vendorSuffixSelectors[t].push(...e):this.vendorSuffixSelectors[t]=e},u=Object.keys(s);if(u.length)for(let t of u)o(t,s[t]);else o("",r);for(let t of Object.values(this.vendorSuffixSelectors))for(let i of t){this.hasWhere!==!1&&(this.hasWhere=i.includes(":where("));for(let e=0;e<G.length;e++)if(i.includes(G[e])){(this.priority===-1||this.priority>e)&&(this.priority=e);break}}}else this.vendorSuffixSelectors={"":[""]};for(let l=1;l<w.length;l++){let r=w[l];if(r)if(_.includes(r))this.theme=r;else if(r==="rtl"||r==="ltr")this.direction=r;else{let s,o,u=r.indexOf("_");if(u!==-1)s=r.slice(0,u),o=r.slice(u);else{let t=r.indexOf("(");t!==-1&&(s=r.slice(0,t),o=r.slice(t))}if(!s){s="media";let t=[];this.media={token:r,features:{}};let i=r.split("&");for(let e of i)if(e==="all"||e==="print"||e==="screen"||e==="speech")this.media.type=e;else if(e==="\u{1F5A8}")this.media.type="print";else if(e==="landscape"||e==="portrait")t.push("(orientation:"+e+")");else if(e==="motion"||e==="reduced-motion")t.push("(prefers-reduced-motion:"+(e==="motion"?"no-preference":"reduce")+")");else if(M&&e in M)t.push(M[e]);else{let n={token:e},a="",f="",g=0;e.startsWith("<=")?(f="<=",a="max-width"):e.startsWith(">=")||q[e]?(f=">=",a="min-width"):e.startsWith(">")?(f=">",a="min-width",g=.02):e.startsWith("<")&&(f="<",a="max-width",g=-.02);let p=f?e.replace(f,""):e,c=q[p];switch(a){case"max-width":case"min-width":c?Object.assign(n,E(c,"px")):Object.assign(n,E(p,"px")),n.unit==="px"&&(n.value+=g),this.media.features[a]=n,t.push("("+a+":"+(n.value+n.unit)+")");break}}o="",this.media.type&&(o=this.media.type),t.length&&(o+=(o?" and ":"")+t.join(" and "))}o&&(this.at[s]=(s in this.at?this.at[s]+" and ":"")+o.replace(/_/g," "))}}let k=(l,r)=>{let s,o,u=(i,e,n)=>{let a="";this.direction&&(a+="[dir="+this.direction+"] ");let f=this.prefixSelectors.map(c=>c+a),g=(c,R)=>f.map(d=>(c?"."+c+" ":"")+(P?P+" ":"")+d).reduce((d,W)=>(d.push(n.reduce((L,te)=>(L.push(W+"."+se(R)+te),L),[]).join(",")),d),[]).join(","),p=g(e,y)+(U?Object.entries(U).filter(([c])=>this.theme||!x||!e||!c||c===e).map(([c,R])=>R.reduce((d,W)=>d+","+g(this.theme??((x||T)&&e||c),W),"")).join(""):"")+"{"+i+"}";for(let c of Object.keys(this.at).sort((R,d)=>d==="supports"?-1:1))p="@"+c+" "+this.at[c]+"{"+p+"}";return p},t=[];if(S){let i,e;for(let n of S)typeof n=="string"?t.push(n):(i=E(n.value,K,x&&$,x&&ee,Z,this.theme?[this.theme,""]:[l]),i.colorMatched!==void 0&&e!==!0&&(e=i.colorMatched),t.push(i.value+i.unit));if(r&&(e===void 0?l:!e))return;if(t.length===1?i?(s=i.value,o=i.unit):s=t[0]:s=t.reduce((n,a,f)=>n+a+(a===","||S[f+1]===","||f===S.length-1?"":" "),""),typeof s!="object"){D&&(s=D.call(this,s,this.css.config)),x&&s==="current"&&(s="currentColor");let n={unit:o,value:s,important:this.important};if(T){let a=T.call(this,n,b);for(let f in a)for(let g of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:o,value:s,text:u(Object.entries(a[f]).map(([p,c])=>N(p,{important:(this.important||j)&&!c.endsWith("!important"),unit:"",value:c})).join(";"),f,g),theme:f});return}else F&&(s=F.call(this,n))}}else s=A;for(let i of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:o,value:s,text:u(typeof s=="object"?Object.entries(s).map(([e,n])=>N(e,{...typeof n=="object"?n:{unit:"",value:n},important:this.important||j})).join(";"):N(Y,{unit:o,value:s,important:this.important||j}),l,i),theme:l})};if(T)k(void 0,!1);else if(this.theme)k(this.theme,!1);else if(x)for(let l of _)k(l,!0);else k("",!1)}at={};priority=-1;natives=[];get text(){return this.natives.map(y=>y.text).join("")}};export{H as Rule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function h(s){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&s instanceof e||s instanceof Date||s instanceof RegExp)}function f(s){if(typeof Buffer<"u"&&Buffer&&s instanceof Buffer){let e=Buffer.alloc(s.length);return s.copy(e),e}else{if(s instanceof Date)return new Date(s.getTime());if(s instanceof RegExp)return new RegExp(s);throw new Error("Unexpected situation")}}function l(s){let e=[];return s.forEach(function(t,i){typeof t=="object"&&t!==null?Array.isArray(t)?e[i]=l(t):h(t)?e[i]=f(t):e[i]=n({},t):e[i]=t}),e}function a(s,e){return e==="__proto__"?void 0:s[e]}function n(...s){let e={},t,i;return s.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(r){if(i=a(e,r),t=a(o,r),t!==e)if(typeof t!="object"||t===null){e[r]=t;return}else if(Array.isArray(t)){e[r]=l(t);return}else if(h(t)){e[r]=f(t);return}else if(typeof i!="object"||i===null||Array.isArray(i)){e[r]=n({},t);return}else{e[r]=n(i,t);return}})}),e}import{theme as u}from"./config/theme";var c=class{constructor(e=typeof document<"u"?document.documentElement:null,t){this.host=e;this.options=t;this.options=n(u,t),this.options.store&&this.storage?this.syncWithStorage():this.options.default&&this.set(this.options.default,{emit:!1,store:!1})}darkMQL=typeof window<"u"?window.matchMedia?.("(prefers-color-scheme:dark)"):void 0;get storage(){let{store:e}=this.options;if(e)return localStorage.getItem(e)}current;value;set(e,t={store:!0,emit:!0}){if(e!==this.value){let i;e==="system"?(this.darkMQL?.addEventListener?.("change",this.onThemeChange),i=this.darkMQL?.matches?"dark":"light"):(this.removeDarkMQLListener(),i=e),i&&(this.host.classList.remove(this.current),this.host.classList.add(i),this.host.style&&(this.host.style.colorScheme=i)),this.current=i,this.value=e,t.store,this.storage,this.options.store&&localStorage.setItem(this.options.store,e),t.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this}))}}syncWithStorage(){if(typeof window<"u"&&this.options.store){let e=this.storage;(e==="system"&&(e=this.darkMQL?.matches?"dark":"light")||e)&&(this.host.classList.add(e),this.host.style.colorScheme=e,this.set(e,{emit:!1,store:!1}))}}removeDarkMQLListener(){this.darkMQL?.removeEventListener("change",this.onThemeChange)}onThemeChange=e=>{this.set(e.matches?"dark":"light")};destroy(){this.darkMQL?.removeEventListener("change",this.onThemeChange)}};export{c as Theme};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function l(r,t,n){if(n){let i="",s=r.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(s)if(r.includes("/")){let[e,u]=r.split("/");return{value:+e/+u*100+"%",unit:i}}else{let e=+s[1];return i=s[3]||"",i||((n==="rem"||n==="em")&&(e=e/t),i=n||""),{value:e,unit:i}}}}export{l as analyzeUnitValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{START_SYMBOL as a}from"../constants/start-symbol";function R(x,h,S,b=[]){let A=[",",...b],f=[],n="",e=0;return function p(r,t,g,l="",o=[],d=[]){let u,c=!1;t&&(t===")"&&n.slice(-1)==="$"?u=n.length-1:(t==="'"||t==='"')&&(c=!0),n+=r[e++]);let m=()=>{let i=n;if(n="",h&&i in h&&!o.includes(i)){let s=e;e=0,p(h[i].toString(),void 0,void 0,void 0,[...o,i],d),e=s}else if(S&&i in S&&!d.includes(i)){let s=e;e=0,p(S[i].toString(),void 0,void 0,void 0,o,[...d,i]),e=s}else f.push({value:i})};for(;e<r.length;e++){let i=r[e];if(i===t){if(n+=i,c){let s=0;for(let y=n.length-2;n[y]==="\\";y--)s++;if(s%2)continue}u!==void 0&&(n=n.slice(0,u)+n.slice(u).replace(/\$\((.*)\)/,"var(--$1)")),g||(c?f.push(n):m(),l="",n="");break}else if(!c&&i in a)p(r,a[i],g===void 0?0:g+1,l,o,d);else if((i==="|"||i===" ")&&t!=="}"&&(!c||l==="path"))t?n+=" ":m();else{if(!t){if(i==="."){if(isNaN(+r[e+1]))break;r[e-1]==="-"&&(n+="0")}else if(A.includes(i)){n&&m(),f.push(i);continue}else if(i==="#"&&(n||f.length&&r[e-1]!=="|"&&f[e-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(i))break;l+=i}n+=i}}g===void 0&&n&&m()}(x),[f,x.slice(e)]}export{R as analyzeValueToken};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(y,r){return Array.isArray(y)&&Array.isArray(r)?y.concat(r):r}export{a as concatArrays};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(x){if(typeof CSS<"u")return CSS.escape(x);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let t=String(x),i=t.length,n=-1,r="",e,c=t.charCodeAt(0);if(i==1&&c==45)return"\\"+t;for(;++n<i;){if(e=t.charCodeAt(n),e==0){r+="\uFFFD";continue}if(e>=1&&e<=31||e==127||n==0&&e>=48&&e<=57||n==1&&e>=48&&e<=57&&c==45){r+="\\"+e.toString(16)+" ";continue}if(e>=128||e==45||e==95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122){r+=t.charAt(n);continue}r+="\\"+t.charAt(n)}return r}export{o as cssEscape};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return setTimeout(()=>{})}export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function B(s,r,t=""){let e="border-";t&&(t="-"+t);let O=/^b(order)?-?(.)?/.exec(s)[2],R=e+"left"+t,n=e+"right"+t,o=e+"top"+t,c=e+"bottom"+t;switch(O){case"x":return{[R]:r,[n]:r};case"y":return{[o]:r,[c]:r};case"l":return{[R]:r};case"r":return{[n]:r};case"t":return{[o]:r};case"b":return{[c]:r};default:return{["border"+t]:r}}}export{B as getBorderProps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(n,t){return(n?n+":":"")+(t.unit?t.value+t.unit:t.value)+(t.important?"!important":"")}export{i as getCssPropertyText};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(t){return Object.prototype.toString.call(t).slice(8,-1)}export{e as getType};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(t){t.startsWith("#")&&(t=t.slice(1));let n=t.match(/.{1,2}/g);return[parseInt(n[0],16),parseInt(n[1],16),parseInt(n[2],16)]}export{r as hexToRgb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getType as e}from"./get-type";function n(t){return e(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}export{n as isPlainObject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getType as y}from"./get-type";function r(o){return y(o)==="Symbol"}export{r as isSymbol};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{analyzeUnitValue as k}from"./analyze-unit-value";function p(a,c,g){let u=t=>t==="+"||t==="-"||t==="*"||t==="/",s="",n,i="",o=!1,l=!1;function r(t,e="",b=""){if(n===2&&!l){let f=k(i,c,g);f&&(i=f.value+f.unit)}s+=i+e+t+b,n=null,l=!1,i=""}for(let t=0;t<a.length;t++){let e=a[t];if(e==="("||e===")")o=e===")",r(e);else if(e===",")r(e,""," ");else{switch(n){case 1:break;case 2:if(u(e)){r(e," "," ");continue}else/[0-9]/.test(e)||(l=!0);break;default:o&&(s+=" "),isNaN(+e)?u(e)||(n=1):n=2;break}n?i+=e:s+=e}}return i&&(s+=i),s}export{p as normalizeCssCalcText};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{analyzeUnitValue as C}from"./analyze-unit-value";import{normalizeCssCalcText as R}from"./normalize-css-calc-text";function w(e,n,p,s,o,d){let l="",u="",f;if(typeof e=="number")l=e,u=n||"";else{if(s){let g=!1,m=!1;e=e.replace(new RegExp(`(^|,| |\\()((?:${p.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(b,M,x,r)=>{m=!0;let h=s[x];if(h){let i;for(let a of d)if(i=h[a])break;if(i){g=!0;let a=i;if(r){let t=r.endsWith("%")?parseFloat(r)/100:+r;t=isNaN(t)?1:Math.min(Math.max(t,0),1),a+=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")}return M+a}}return b}),m&&(f=g)}let c=C(e,o,n);if(c)return c;l=(e.indexOf("calc(")===-1?e:R(e,o,n)).replace(/\$\(((\w|-)+)\)/g,"var(--$1)")}return{value:l,unit:u,colorMatched:f}}export{w as parseRuleValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(i,g,{rootSize:c}){let n="",r=0;return function o(l,u){let t="",s=u?g(u):"",f=()=>{t&&(n+=!s||Number.isNaN(+t)?t:+t/(s==="rem"?c:1)+s,t="")};for(;r<i.length;r++){let e=i[r];if(e===l&&(l!=="'"||i[r+1]===")")){f(),n+=e;break}else e===","||e===" "?(f(),n+=e):!t&&e==="'"?(n+=e,r++,o(e),t=""):t&&e==="("?(n+=t+e,r++,o(")",t),t=""):t+=e}f()}(),n}export{a as parseValueUnit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"fs-extra";function r(a="./package.json"){return e.readJSONSync(a,{throws:!1})||{}}export{r as readPackage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(r,t,e){return((1<<24)+(r<<16)+(t<<8)+e).toString(16).slice(1)}export{n as rgbToHex};
|