@master/css 2.0.0-beta.21 → 2.0.0-beta.210
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 +113 -109
- package/dist/bin/index.bundle.js +36 -0
- package/dist/bin/index.d.ts +2 -0
- package/dist/config/animations.d.ts +110 -0
- package/dist/config/functions.d.ts +3 -0
- package/dist/config/index.d.ts +68 -25
- package/dist/config/{breakpoints.d.ts → media-queries.d.ts} +3 -2
- package/dist/config/rules.d.ts +279 -3
- package/dist/config/selectors.d.ts +3 -2
- package/dist/config/semantics.d.ts +189 -80
- package/dist/config/styles.d.ts +3 -0
- package/dist/config/variables.d.ts +113 -0
- package/dist/constants/base-unit-regex.d.ts +1 -0
- package/dist/constants/config-esm-text.d.ts +1 -0
- package/dist/constants/config-text.d.ts +1 -0
- package/dist/constants/config-ts-text.d.ts +1 -0
- package/dist/constants/selector-symbols.d.ts +1 -0
- package/dist/constants/start-symbol.d.ts +2 -1
- package/dist/core.d.ts +96 -0
- package/dist/functions/init-runtime.d.ts +9 -0
- package/dist/functions/reorder-for-readable-classes.d.ts +12 -0
- package/dist/functions/transform-color-with-opacity.d.ts +1 -0
- package/dist/index.bundle.js +35 -0
- package/dist/index.bundle.mjs +35 -0
- package/dist/index.d.ts +13 -21
- package/dist/layer.d.ts +11 -0
- package/dist/polyfills/css-escape.d.ts +0 -1
- package/dist/rule.d.ts +104 -53
- package/dist/runtime.browser.bundle.js +1 -0
- package/dist/runtime.browser.d.ts +4 -0
- package/dist/runtime.d.ts +23 -0
- package/dist/types/global.d.ts +11 -0
- package/dist/utils/extend-config.d.ts +2 -0
- package/dist/utils/flatten-object.d.ts +1 -0
- package/dist/utils/hex-to-rgb.d.ts +1 -1
- package/dist/utils/is-plain-object.d.ts +1 -1
- package/dist/utils/rgb-to-hex.d.ts +1 -1
- package/package.json +1 -162
- package/LICENSE +0 -21
- package/dist/apis/extend.d.ts +0 -5
- 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/colors.d.ts +0 -25
- package/dist/config/root-size.d.ts +0 -2
- package/dist/config/scheme.d.ts +0 -7
- package/dist/config/themes.d.ts +0 -2
- package/dist/config/values.d.ts +0 -126
- package/dist/css.d.ts +0 -80
- package/dist/index.browser.d.ts +0 -1
- package/dist/index.browser.js +0 -2
- 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/counter-reset.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/get-border-props.d.ts +0 -3
- package/dist/utils/get-css-property-text.d.ts +0 -5
- package/dist/utils/normalize-css-calc-text.d.ts +0 -5
- package/dist/utils/parse-value-unit.d.ts +0 -2
- package/dist/utils/parse-value.d.ts +0 -6
- package/readme.md +0 -118
- /package/dist/{apis → functions}/fill-color-scale.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,118 +1,122 @@
|
|
|
1
|
-
<br
|
|
1
|
+
<br>
|
|
2
2
|
<div align="center">
|
|
3
3
|
|
|
4
4
|
<p align="center">
|
|
5
|
-
<
|
|
5
|
+
<a href="https://css.master.co">
|
|
6
|
+
<picture>
|
|
7
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg">
|
|
8
|
+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg">
|
|
9
|
+
<img alt="Master CSS" src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg" width="100%">
|
|
10
|
+
</picture>
|
|
11
|
+
</a>
|
|
6
12
|
</p>
|
|
13
|
+
<p align="center">A markup-driven CSS language with enhanced syntax</p>
|
|
14
|
+
|
|
7
15
|
<p align="center">
|
|
8
|
-
<
|
|
16
|
+
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
|
|
17
|
+
<picture>
|
|
18
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
|
|
19
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
|
|
20
|
+
<img alt="NPM Version" src="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
|
|
21
|
+
</picture>
|
|
22
|
+
</a>
|
|
23
|
+
<a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/css">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/css?color=212022&label=%20&logo=npm&style=for-the-badge">
|
|
26
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
27
|
+
<img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
28
|
+
</picture>
|
|
29
|
+
</a>
|
|
30
|
+
<a aria-label="JSDelivr" href="https://www.jsdelivr.com/package/npm/@master/css">
|
|
31
|
+
<picture>
|
|
32
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/jsdelivr/npm/hm/@master/css?color=212022&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
33
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/jsdelivr/npm/hm/@master/css?color=f6f7f8&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
34
|
+
<img alt="JSDelivr hits (npm scoped)" src="https://img.shields.io/jsdelivr/npm/hm/@master/css?color=f6f7f8&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
35
|
+
</picture>
|
|
36
|
+
</a>
|
|
37
|
+
<a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6">
|
|
38
|
+
<picture>
|
|
39
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge">
|
|
40
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
41
|
+
<img alt="Discord online" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
42
|
+
</picture>
|
|
43
|
+
</a>
|
|
44
|
+
<a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg">
|
|
45
|
+
<picture>
|
|
46
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
|
|
47
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
48
|
+
<img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
49
|
+
</picture>
|
|
50
|
+
</a>
|
|
51
|
+
<a aria-label="Github Actions" href="https://github.com/1aron/repo/actions/workflows/release.yml">
|
|
52
|
+
<picture>
|
|
53
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
|
|
54
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
55
|
+
<img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
56
|
+
</picture>
|
|
57
|
+
</a>
|
|
9
58
|
</p>
|
|
10
|
-
<p align="center"><!-- package.description -->A Virtual CSS language with enhanced syntax. ~13KB<!----></p>
|
|
11
|
-
|
|
12
|
-
[](https://github.com/master-co/css/blob/main/LICENSE)
|
|
13
|
-
[](https://www.npmjs.com/package/@master/css)
|
|
14
|
-
[](https://bundlephobia.com/package/@master/css 'gzip bundle size (including dependencies)')
|
|
15
|
-
[](https://unpkg.com/@master/css 'brotli package size (without dependencies)')
|
|
16
|
-
[](https://css.master.co)
|
|
17
|
-
[](https://github.com/master-co/css)
|
|
18
|
-
[](https://discord.gg/sZNKpAAAw6)
|
|
19
|
-
[](https://circleci.com/gh/master-co/workflows/css/tree/main)
|
|
20
59
|
|
|
21
60
|
</div>
|
|
22
61
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
To learn more, check out the [Why Master CSS](https://docs.master.co/css/why-master-css) documentation.
|
|
85
|
-
|
|
86
|
-
# Quick Start
|
|
87
|
-
This is a quick start guide, check out the [full setup guide](https://docs.master.co/css/setup) to integrate with your build tools and frameworks.
|
|
88
|
-
|
|
89
|
-
```shell
|
|
90
|
-
npm install @master/css
|
|
91
|
-
```
|
|
92
|
-
```js
|
|
93
|
-
import '@master/css';
|
|
94
|
-
```
|
|
95
|
-
or use a CDN
|
|
96
|
-
```html
|
|
97
|
-
<script src="https://cdn.master.co/css"></script>
|
|
98
|
-
```
|
|
99
|
-
Now, start styling HTML with Master CSS. 🎉
|
|
100
|
-
```html
|
|
101
|
-
<h1 class="font:40 font:heavy italic m:50 text:center">Hello World</h1>
|
|
102
|
-
```
|
|
103
|
-
To learn more, check out the [Syntax tutorial](https://docs.master.co/css/syntax-tutorial) documentation.
|
|
104
|
-
|
|
105
|
-
# Developer Tools
|
|
106
|
-
- [Master CSS Language Service](https://marketplace.visualstudio.com/items?itemName=masterco.master-css-language-service) - A Visual Studio Code extension for Master CSS. Provides code-completion and syntax highlighting.
|
|
107
|
-
|
|
108
|
-
# Inspiration
|
|
109
|
-
Some of our core concepts and designs are inspired by these giants.
|
|
110
|
-
- __Language__ - Master is a language, but it was originally inspired by [ACSS](https://acss.io/)'s concept of atomic classes.
|
|
111
|
-
- __Virtual CSS__ - Difference algorithms, virtual models, etc. are inspired by [Virtual DOM](https://reactjs.org/docs/faq-internals.html).
|
|
112
|
-
|
|
113
|
-
# Related
|
|
114
|
-
- [@master/css.react](https://github.com/master-co/css.react) - React hooks for Master CSS
|
|
115
|
-
- [@master/css-compiler](https://github.com/master-co/css-compiler) - Compile Master CSS ahead of time with zero-configuration integration with build tools
|
|
116
|
-
- [@master/normal.css](https://github.com/master-co/normal.css) - Normalize browser's styles. ~1KB
|
|
117
|
-
- [@master/keyframes.css](https://github.com/master-co/keyframes.css) - Simple and useful CSS keyframes. ~0.4KB
|
|
118
|
-
- [@master/style-element.react](https://github.com/master-co/style-element.react) - Quickly create styled React elements with conditional class names. ~800B
|
|
62
|
+
## Documentation
|
|
63
|
+
Visit [beta.css.master.co](https://beta.css.master.co) to view the full documentation
|
|
64
|
+
|
|
65
|
+
## Getting Started
|
|
66
|
+
Check out the [official guides](https://beta.css.master.co/docs) to get started with Master CSS, or walk through the [examples](https://github.com/master-co/css/tree/beta/examples) for a quick overview of integrating with your framework.
|
|
67
|
+
|
|
68
|
+
## Rendering Modes
|
|
69
|
+
Master CSS provides various [rendering modes](https://beta.css.master.co/docs/rendering-modes), allowing you to choose according to the characteristics and needs of different projects.
|
|
70
|
+
|
|
71
|
+
- [Progressive Rendering](https://beta.css.master.co/docs/rendering-modes/progressive-rendering) - Scan the requested HTML on the server side, generate CSS rules, and enable runtime engine on the browser side
|
|
72
|
+
- [Runtime Rendering](https://beta.css.master.co/docs/rendering-modes/runtime-rendering) - Observe the DOM tree, manipulate CSS rules according to the changed class name, and synchronize to the running style sheet at runtime
|
|
73
|
+
- [Static Extraction](https://beta.css.master.co/docs/rendering-modes/static-extraction) - Scan source files for class names at build time, extract class names, and generate CSS files/virtual modules, then import them in the entry file
|
|
74
|
+
|
|
75
|
+
## Ecosystem
|
|
76
|
+
We've built various Master CSS core functionality/integration packages:
|
|
77
|
+
|
|
78
|
+
- [CSS](https://github.com/master-co/css/tree/beta/packages/css) - The core of Master CSS, including the runtime engine
|
|
79
|
+
|
|
80
|
+
##### Frameworks
|
|
81
|
+
- [React](https://github.com/master-co/css/tree/beta/packages/react) - Integrate Master CSS the React way
|
|
82
|
+
- [Svelte](https://github.com/master-co/css/tree/beta/packages/svelte) - Integrate Master CSS the Svelte way
|
|
83
|
+
- [Vue](https://github.com/master-co/css/tree/beta/packages/vue) - Integrate Master CSS the Vue.js way
|
|
84
|
+
|
|
85
|
+
##### Progressive Rendering
|
|
86
|
+
- [Renderer](https://github.com/master-co/css/tree/beta/packages/renderer) - Pre-renders and injects HTML-required CSS
|
|
87
|
+
- [Nitro Server](https://github.com/master-co/css/tree/beta/packages/server.nitro) - Integrate Master CSS Pre-rendering the Nitro way
|
|
88
|
+
|
|
89
|
+
##### Static Extraction
|
|
90
|
+
- [Extractor](https://github.com/master-co/css/tree/beta/packages/extractor) - Master CSS static extractor for various raw text extraction.
|
|
91
|
+
- [Vite](https://github.com/master-co/css/tree/beta/packages/extractor.vite) - Integrate Master CSS Static Extraction in Vite way
|
|
92
|
+
- [Webpack](https://github.com/master-co/css/tree/beta/packages/extractor.webpack) - Integrate Master CSS Static Extraction in Webpack way
|
|
93
|
+
|
|
94
|
+
##### Validation
|
|
95
|
+
- [Validator](https://github.com/master-co/css/tree/beta/packages/validator) for Master CSS class syntax
|
|
96
|
+
|
|
97
|
+
##### Language
|
|
98
|
+
- [Server](https://github.com/master-co/css/tree/beta/packages/language-server) - The core of the Master CSS language server
|
|
99
|
+
- [Service](https://github.com/master-co/css/tree/beta/packages/language-service) - The core of the Master CSS language service
|
|
100
|
+
- [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=masterco.master-css-language-service) - Master CSS Language Service for Visual Studio Code Extension
|
|
101
|
+
|
|
102
|
+
##### Others
|
|
103
|
+
- [Normal CSS](https://github.com/master-co/css/tree/beta/packages/normal.css) - Normalize the browser's styles
|
|
104
|
+
- [Theme Service](https://github.com/master-co/css/tree/beta/packages/theme-service) - A CSS theme-switching service for Master CSS
|
|
105
|
+
- [🚧 Class Variant](https://github.com/master-co/css/tree/beta/packages/class-variant) - Create reusable, extensible, and customizable style class variants
|
|
106
|
+
- 🚧 Resolve Class - Conditionally apply classes and trim it to a non-wrap string
|
|
107
|
+
|
|
108
|
+
## Community
|
|
109
|
+
The Master CSS community can be found here:
|
|
110
|
+
|
|
111
|
+
- [Discuss on GitHub](https://github.com/master-co/css/discussions) - Ask questions, voice ideas, and do any other discussion
|
|
112
|
+
- [Join our Discord Server](https://discord.com/invite/sZNKpAAAw6) - Casually chat with other people using the language <sup><sub>✓ 中文</sub></sup>
|
|
113
|
+
|
|
114
|
+
<sub>Our [《 Code of Conduct 》](https://github.com/master-co/css/blob/main/CODE_OF_CONDUCT.md) applies to all Master CSS community channels.</sub>
|
|
115
|
+
|
|
116
|
+
## Contributing
|
|
117
|
+
Please see our [CONTRIBUTING](https://github.com/master-co/css/blob/beta/.github/CONTRIBUTING.md) for workflow.
|
|
118
|
+
|
|
119
|
+
## Inspiration
|
|
120
|
+
Some of the core concepts and designs are inspired by these giants.
|
|
121
|
+
- The concept of enhanced syntax is inspired by [SASS](https://sass-lang.com/) and [TypeScript](https://www.typescriptlang.org/)
|
|
122
|
+
- The concept of Virtual CSS is inspired by the [Virtual DOM](https://reactjs.org/docs/faq-internals.html)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";var h=Object.create;var d=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var O=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of _(o))!E.call(e,s)&&s!==t&&d(e,s,{get:()=>o[s],enumerable:!(r=C(o,s))||r.enumerable});return e};var p=(e,o,t)=>(t=e!=null?h(x(e)):{},O(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e));var T=require("commander"),m=p(require("path")),a=p(require("fs"));var S=`/** @type {import('@master/css').Config} */
|
|
3
|
+
export default {
|
|
4
|
+
styles: {},
|
|
5
|
+
rules: {},
|
|
6
|
+
variables: {},
|
|
7
|
+
semantics: {},
|
|
8
|
+
mediaQueries: {},
|
|
9
|
+
animations: {},
|
|
10
|
+
selectors: {},
|
|
11
|
+
functions: {}
|
|
12
|
+
}
|
|
13
|
+
`;var y=`/** @type {import('@master/css').Config} */
|
|
14
|
+
module.exports = {
|
|
15
|
+
styles: {},
|
|
16
|
+
rules: {},
|
|
17
|
+
variables: {},
|
|
18
|
+
semantics: {},
|
|
19
|
+
mediaQueries: {},
|
|
20
|
+
animations: {},
|
|
21
|
+
selectors: {},
|
|
22
|
+
functions: {}
|
|
23
|
+
}
|
|
24
|
+
`;var g=`import type { Config } from '@master/css'
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
styles: {},
|
|
28
|
+
rules: {},
|
|
29
|
+
variables: {},
|
|
30
|
+
semantics: {},
|
|
31
|
+
mediaQueries: {},
|
|
32
|
+
animations: {},
|
|
33
|
+
selectors: {},
|
|
34
|
+
functions: {}
|
|
35
|
+
} as Config
|
|
36
|
+
`;var n=p(require("@techor/log")),l=require("@techor/fs"),{version:v,name:j,description:F}=(0,l.readJSONFileSync)(m.default.resolve(__dirname,"../../package.json")),c=new T.Command;c.name(j).description(F).version(v||"0.0.0");c.command("init").description("Initialize definition files for Master CSS").option("-o, --override","Override existing definition file").option("--esm","ES Module .mjs").option("--ts","TypeScript .ts").option("--cjs","CommonJS .js").action(async function(e){let{esm:o,ts:t,cjs:r}=e;if(!o&&!t&&!r)if(a.default.existsSync("tsconfig.json"))t=!0;else{let{type:i}=(0,l.readJSONFileSync)("./package.json")||{};i==="module"?o=!0:r=!0}let s=(i,f)=>{let u=a.default.existsSync(m.default.join(process.cwd(),i));u?u&&e.override?(a.default.writeFileSync(i,f),n.default.ok`**${i}** file is overridden`):n.default.x`**${i}** file already exists`:(a.default.writeFileSync(i,f),n.default.ok`**${i}** file is created`)};o&&s("master.css.mjs",S),t&&s("master.css.ts",g),r&&s("master.css.js",y)});c.command("render").description("Scans HTML and injects generated CSS rules").argument("<source paths>","The path in glob patterns of the source of the HTML file").option("-c --config <path>","The source path of the Master CSS configuration","master.css.*").option("-a --analyze","Analyze injected CSS and HTML size ( brotli ) without writing to file").action(async function(e,o){try{await require("@master/css-renderer/actions/main")(e,o)}catch(t){t.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-renderer** first`:console.error(t)}});c.command("extract").argument("[source paths]","The glob pattern path to extract sources").option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your CSS file output path").option("-v, --verbose","Verbose logging 0~N","1").option("--options <path>","Specify your extractor options sources","master.css-extractor.*").action(async function(e,o){try{await require("@master/css-extractor/actions/main")(e,o)}catch(t){t.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-extractor** first`:console.error(t)}});c.parse();
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
declare const animations: {
|
|
2
|
+
fade: {
|
|
3
|
+
'0%': {
|
|
4
|
+
opacity: number;
|
|
5
|
+
};
|
|
6
|
+
to: {
|
|
7
|
+
opacity: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
flash: {
|
|
11
|
+
'0%,50%,to': {
|
|
12
|
+
opacity: number;
|
|
13
|
+
};
|
|
14
|
+
'25%,75%': {
|
|
15
|
+
opacity: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
float: {
|
|
19
|
+
'0%': {
|
|
20
|
+
transform: string;
|
|
21
|
+
};
|
|
22
|
+
'50%': {
|
|
23
|
+
transform: string;
|
|
24
|
+
};
|
|
25
|
+
to: {
|
|
26
|
+
transform: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
heart: {
|
|
30
|
+
'0%': {
|
|
31
|
+
transform: string;
|
|
32
|
+
};
|
|
33
|
+
'14%': {
|
|
34
|
+
transform: string;
|
|
35
|
+
};
|
|
36
|
+
'28%': {
|
|
37
|
+
transform: string;
|
|
38
|
+
};
|
|
39
|
+
'42%': {
|
|
40
|
+
transform: string;
|
|
41
|
+
};
|
|
42
|
+
'70%': {
|
|
43
|
+
transform: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
jump: {
|
|
47
|
+
'0%,to': {
|
|
48
|
+
transform: string;
|
|
49
|
+
'animation-timing-function': string;
|
|
50
|
+
};
|
|
51
|
+
'50%': {
|
|
52
|
+
transform: string;
|
|
53
|
+
'animation-timing-function': string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
ping: {
|
|
57
|
+
'75%,to': {
|
|
58
|
+
transform: string;
|
|
59
|
+
opacity: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
pulse: {
|
|
63
|
+
'0%': {
|
|
64
|
+
transform: string;
|
|
65
|
+
};
|
|
66
|
+
'50%': {
|
|
67
|
+
transform: string;
|
|
68
|
+
};
|
|
69
|
+
to: {
|
|
70
|
+
transform: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
rotate: {
|
|
74
|
+
'0%': {
|
|
75
|
+
transform: string;
|
|
76
|
+
};
|
|
77
|
+
to: {
|
|
78
|
+
transform: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
shake: {
|
|
82
|
+
'0%': {
|
|
83
|
+
transform: string;
|
|
84
|
+
};
|
|
85
|
+
'6.5%': {
|
|
86
|
+
transform: string;
|
|
87
|
+
};
|
|
88
|
+
'18.5%': {
|
|
89
|
+
transform: string;
|
|
90
|
+
};
|
|
91
|
+
'31.5%': {
|
|
92
|
+
transform: string;
|
|
93
|
+
};
|
|
94
|
+
'43.5%': {
|
|
95
|
+
transform: string;
|
|
96
|
+
};
|
|
97
|
+
'50%': {
|
|
98
|
+
transform: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
zoom: {
|
|
102
|
+
'0%': {
|
|
103
|
+
transform: string;
|
|
104
|
+
};
|
|
105
|
+
to: {
|
|
106
|
+
transform: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export default animations;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,27 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import mediaQueries from './media-queries';
|
|
2
|
+
import selectors from './selectors';
|
|
3
|
+
import semantics from './semantics';
|
|
4
|
+
import animations from './animations';
|
|
5
|
+
import variables from './variables';
|
|
6
|
+
import rules from './rules';
|
|
7
|
+
import functions from './functions';
|
|
8
|
+
import type { PropertiesHyphen } from 'csstype';
|
|
9
|
+
import type { Rule, RuleDefinition, ValueComponent } from '../rule';
|
|
10
|
+
declare const config: Config;
|
|
11
|
+
export { config, mediaQueries, selectors, semantics, rules, functions, animations, variables };
|
|
12
|
+
export type VariableValue = number | string | Array<number | string>;
|
|
13
|
+
export type VariableDefinition = {
|
|
14
|
+
[key in '' | `@${string}`]?: VariableValue;
|
|
15
|
+
} & {
|
|
16
|
+
[key: string]: VariableValue | VariableDefinition;
|
|
17
|
+
};
|
|
18
|
+
export type CSSKeyframes = {
|
|
19
|
+
[key in 'from' | 'to' | string]: PropertiesHyphen;
|
|
20
|
+
};
|
|
21
|
+
export type AnimationDefinitions = {
|
|
22
|
+
[key: string]: CSSKeyframes;
|
|
23
|
+
};
|
|
24
|
+
export type SelectorDefinitions = {
|
|
25
|
+
[key: string]: string | string[] | SelectorDefinitions;
|
|
26
|
+
};
|
|
27
|
+
export type MediaQueryDefinitions = {
|
|
28
|
+
[key: string]: number | string | MediaQueryDefinitions;
|
|
29
|
+
};
|
|
30
|
+
export type StyleDefinitions = {
|
|
31
|
+
[key: string]: string | StyleDefinitions;
|
|
32
|
+
};
|
|
33
|
+
export type RuleDefinitions = {
|
|
34
|
+
[key in keyof typeof rules | string]?: RuleDefinition;
|
|
35
|
+
};
|
|
36
|
+
export type VariableDefinitions = {
|
|
37
|
+
[key in keyof typeof rules]?: VariableDefinition;
|
|
38
|
+
} & {
|
|
39
|
+
[key: string]: VariableDefinition | VariableValue;
|
|
40
|
+
};
|
|
41
|
+
export type SemanticDefinitions = {
|
|
42
|
+
[key in keyof typeof semantics]?: PropertiesHyphen;
|
|
43
|
+
} & {
|
|
44
|
+
[key: string]: PropertiesHyphen;
|
|
45
|
+
};
|
|
46
|
+
export interface FunctionDefinition {
|
|
47
|
+
unit?: string;
|
|
48
|
+
colored?: boolean;
|
|
49
|
+
transform?(this: Rule, value: string, bypassVariableNames: string[]): string | ValueComponent[];
|
|
50
|
+
}
|
|
51
|
+
export type FunctionDefinitions = {
|
|
52
|
+
[key: string]: FunctionDefinition;
|
|
53
|
+
};
|
|
54
|
+
export interface Config {
|
|
55
|
+
extends?: (Config | any)[];
|
|
56
|
+
styles?: StyleDefinitions;
|
|
57
|
+
mediaQueries?: MediaQueryDefinitions;
|
|
58
|
+
selectors?: SelectorDefinitions;
|
|
59
|
+
semantics?: SemanticDefinitions;
|
|
60
|
+
variables?: VariableDefinitions;
|
|
61
|
+
rules?: RuleDefinitions;
|
|
18
62
|
rootSize?: number;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
63
|
+
baseUnit?: number;
|
|
64
|
+
scope?: string;
|
|
65
|
+
important?: boolean;
|
|
66
|
+
override?: boolean;
|
|
67
|
+
functions?: FunctionDefinitions;
|
|
68
|
+
animations?: AnimationDefinitions;
|
|
69
|
+
themeDriver?: 'class' | 'media' | 'host';
|
|
27
70
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const mediaQueries: {
|
|
2
|
+
'4xs': number;
|
|
2
3
|
'3xs': number;
|
|
3
4
|
'2xs': number;
|
|
4
5
|
xs: number;
|
|
@@ -10,4 +11,4 @@ declare const defaultBreakpoints: {
|
|
|
10
11
|
'3xl': number;
|
|
11
12
|
'4xl': number;
|
|
12
13
|
};
|
|
13
|
-
export default
|
|
14
|
+
export default mediaQueries;
|