@master/css 2.0.0-beta.20 → 2.0.0-beta.201

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.
Files changed (254) hide show
  1. package/README.md +113 -109
  2. package/dist/bin/index.bundle.js +36 -0
  3. package/dist/bin/index.d.ts +2 -0
  4. package/dist/config/animations.d.ts +110 -0
  5. package/dist/config/functions.d.ts +130 -0
  6. package/dist/config/index.d.ts +71 -25
  7. package/dist/config/{breakpoints.d.ts → media-queries.d.ts} +3 -2
  8. package/dist/config/rules.d.ts +279 -3
  9. package/dist/config/selectors.d.ts +3 -2
  10. package/dist/config/semantics.d.ts +189 -80
  11. package/dist/config/styles.d.ts +3 -0
  12. package/dist/config/variables.d.ts +129 -0
  13. package/dist/constants/config-esm-text.d.ts +1 -0
  14. package/dist/constants/config-text.d.ts +1 -0
  15. package/dist/constants/config-ts-text.d.ts +1 -0
  16. package/dist/constants/selector-symbols.d.ts +1 -0
  17. package/dist/constants/start-symbol.d.ts +2 -1
  18. package/dist/core.d.ts +108 -0
  19. package/dist/functions/init-runtime.d.ts +9 -0
  20. package/dist/functions/reorder-for-readable-classes.d.ts +8 -0
  21. package/dist/functions/transform-color-with-opacity.d.ts +1 -0
  22. package/dist/index.bundle.js +35 -0
  23. package/dist/index.bundle.mjs +35 -0
  24. package/dist/index.d.ts +12 -21
  25. package/dist/layer.d.ts +11 -0
  26. package/dist/polyfills/css-escape.d.ts +0 -1
  27. package/dist/rule.d.ts +107 -52
  28. package/dist/runtime.browser.bundle.js +1 -0
  29. package/dist/runtime.browser.d.ts +6 -0
  30. package/dist/runtime.d.ts +29 -0
  31. package/dist/types/css-declarations.d.ts +4 -0
  32. package/dist/utils/flatten-obj.d.ts +4 -0
  33. package/dist/utils/hex-to-rgb.d.ts +1 -1
  34. package/dist/utils/is-plain-object.d.ts +1 -1
  35. package/package.json +1 -162
  36. package/LICENSE +0 -21
  37. package/dist/apis/extend.d.ts +0 -5
  38. package/dist/apis/render-from-html.d.ts +0 -3
  39. package/dist/apis/render-into-html.d.ts +0 -3
  40. package/dist/apis/render.d.ts +0 -3
  41. package/dist/config/colors.d.ts +0 -25
  42. package/dist/config/root-size.d.ts +0 -2
  43. package/dist/config/scheme.d.ts +0 -7
  44. package/dist/config/themes.d.ts +0 -2
  45. package/dist/config/values.d.ts +0 -126
  46. package/dist/css.d.ts +0 -80
  47. package/dist/index.browser.d.ts +0 -1
  48. package/dist/index.browser.js +0 -2
  49. package/dist/index.browser.js.map +0 -7
  50. package/dist/index.cjs +0 -2
  51. package/dist/index.cjs.map +0 -7
  52. package/dist/index.mjs +0 -2
  53. package/dist/index.mjs.map +0 -7
  54. package/dist/rules/accent-color.d.ts +0 -7
  55. package/dist/rules/align-content.d.ts +0 -6
  56. package/dist/rules/align-items.d.ts +0 -6
  57. package/dist/rules/align-self.d.ts +0 -6
  58. package/dist/rules/animation-delay.d.ts +0 -7
  59. package/dist/rules/animation-direction.d.ts +0 -6
  60. package/dist/rules/animation-duration.d.ts +0 -7
  61. package/dist/rules/animation-fill-mode.d.ts +0 -6
  62. package/dist/rules/animation-iteration-count.d.ts +0 -7
  63. package/dist/rules/animation-name.d.ts +0 -6
  64. package/dist/rules/animation-play-state.d.ts +0 -6
  65. package/dist/rules/animation-timing-function.d.ts +0 -6
  66. package/dist/rules/animation.d.ts +0 -8
  67. package/dist/rules/appearance.d.ts +0 -5
  68. package/dist/rules/aspect-radio.d.ts +0 -7
  69. package/dist/rules/backdrop-filter.d.ts +0 -11
  70. package/dist/rules/background-attachment.d.ts +0 -6
  71. package/dist/rules/background-blend-mode.d.ts +0 -5
  72. package/dist/rules/background-clip.d.ts +0 -9
  73. package/dist/rules/background-color.d.ts +0 -8
  74. package/dist/rules/background-image.d.ts +0 -7
  75. package/dist/rules/background-origin.d.ts +0 -6
  76. package/dist/rules/background-position.d.ts +0 -7
  77. package/dist/rules/background-repeat.d.ts +0 -6
  78. package/dist/rules/background-size.d.ts +0 -6
  79. package/dist/rules/background.d.ts +0 -8
  80. package/dist/rules/border-collapse.d.ts +0 -6
  81. package/dist/rules/border-color.d.ts +0 -11
  82. package/dist/rules/border-image-outset.d.ts +0 -5
  83. package/dist/rules/border-image-repeat.d.ts +0 -6
  84. package/dist/rules/border-image-slice.d.ts +0 -6
  85. package/dist/rules/border-image-source.d.ts +0 -6
  86. package/dist/rules/border-image-width.d.ts +0 -6
  87. package/dist/rules/border-image.d.ts +0 -6
  88. package/dist/rules/border-radius.d.ts +0 -9
  89. package/dist/rules/border-spacing.d.ts +0 -5
  90. package/dist/rules/border-style.d.ts +0 -9
  91. package/dist/rules/border-width.d.ts +0 -9
  92. package/dist/rules/border.d.ts +0 -10
  93. package/dist/rules/box-decoration-break.d.ts +0 -9
  94. package/dist/rules/box-shadow.d.ts +0 -7
  95. package/dist/rules/box-sizing.d.ts +0 -6
  96. package/dist/rules/break-after.d.ts +0 -5
  97. package/dist/rules/break-before.d.ts +0 -5
  98. package/dist/rules/break-inside.d.ts +0 -5
  99. package/dist/rules/caret-color.d.ts +0 -7
  100. package/dist/rules/clear.d.ts +0 -5
  101. package/dist/rules/clip-path.d.ts +0 -6
  102. package/dist/rules/color.d.ts +0 -8
  103. package/dist/rules/column-span.d.ts +0 -6
  104. package/dist/rules/columns.d.ts +0 -8
  105. package/dist/rules/contain.d.ts +0 -5
  106. package/dist/rules/content.d.ts +0 -5
  107. package/dist/rules/counter-increment.d.ts +0 -6
  108. package/dist/rules/cursor.d.ts +0 -5
  109. package/dist/rules/cx.d.ts +0 -6
  110. package/dist/rules/cy.d.ts +0 -6
  111. package/dist/rules/direction.d.ts +0 -5
  112. package/dist/rules/display.d.ts +0 -6
  113. package/dist/rules/fill.d.ts +0 -7
  114. package/dist/rules/filter.d.ts +0 -8
  115. package/dist/rules/flex-basis.d.ts +0 -5
  116. package/dist/rules/flex-direction.d.ts +0 -6
  117. package/dist/rules/flex-grow.d.ts +0 -6
  118. package/dist/rules/flex-shrink.d.ts +0 -6
  119. package/dist/rules/flex-wrap.d.ts +0 -6
  120. package/dist/rules/flex.d.ts +0 -7
  121. package/dist/rules/float.d.ts +0 -5
  122. package/dist/rules/font-family.d.ts +0 -6
  123. package/dist/rules/font-size.d.ts +0 -6
  124. package/dist/rules/font-smoothing.d.ts +0 -9
  125. package/dist/rules/font-style.d.ts +0 -7
  126. package/dist/rules/font-variant-numeric.d.ts +0 -6
  127. package/dist/rules/font-weight.d.ts +0 -7
  128. package/dist/rules/font.d.ts +0 -8
  129. package/dist/rules/gap.d.ts +0 -9
  130. package/dist/rules/grid-area.d.ts +0 -7
  131. package/dist/rules/grid-auto-columns.d.ts +0 -6
  132. package/dist/rules/grid-auto-flow.d.ts +0 -6
  133. package/dist/rules/grid-auto-rows.d.ts +0 -5
  134. package/dist/rules/grid-column-end.d.ts +0 -7
  135. package/dist/rules/grid-column-start.d.ts +0 -7
  136. package/dist/rules/grid-column.d.ts +0 -9
  137. package/dist/rules/grid-columns.d.ts +0 -10
  138. package/dist/rules/grid-row-end.d.ts +0 -6
  139. package/dist/rules/grid-row-start.d.ts +0 -6
  140. package/dist/rules/grid-row.d.ts +0 -9
  141. package/dist/rules/grid-rows.d.ts +0 -9
  142. package/dist/rules/grid-template-areas.d.ts +0 -5
  143. package/dist/rules/grid-template-columns.d.ts +0 -6
  144. package/dist/rules/grid-template-rows.d.ts +0 -5
  145. package/dist/rules/grid-template.d.ts +0 -6
  146. package/dist/rules/grid.d.ts +0 -6
  147. package/dist/rules/group.d.ts +0 -9
  148. package/dist/rules/height.d.ts +0 -6
  149. package/dist/rules/inset.d.ts +0 -9
  150. package/dist/rules/isolation.d.ts +0 -5
  151. package/dist/rules/justify-content.d.ts +0 -6
  152. package/dist/rules/justify-items.d.ts +0 -6
  153. package/dist/rules/justify-self.d.ts +0 -6
  154. package/dist/rules/letter-spacing.d.ts +0 -7
  155. package/dist/rules/line-clamp.d.ts +0 -9
  156. package/dist/rules/line-height.d.ts +0 -7
  157. package/dist/rules/lines.d.ts +0 -9
  158. package/dist/rules/list-style-image.d.ts +0 -6
  159. package/dist/rules/list-style-position.d.ts +0 -6
  160. package/dist/rules/list-style-type.d.ts +0 -6
  161. package/dist/rules/list-style.d.ts +0 -6
  162. package/dist/rules/margin.d.ts +0 -9
  163. package/dist/rules/mask-image.d.ts +0 -8
  164. package/dist/rules/max-height.d.ts +0 -6
  165. package/dist/rules/max-width.d.ts +0 -6
  166. package/dist/rules/min-height.d.ts +0 -6
  167. package/dist/rules/min-width.d.ts +0 -6
  168. package/dist/rules/mix-blend-mode.d.ts +0 -6
  169. package/dist/rules/object-fit.d.ts +0 -6
  170. package/dist/rules/object-position.d.ts +0 -6
  171. package/dist/rules/opacity.d.ts +0 -6
  172. package/dist/rules/order.d.ts +0 -7
  173. package/dist/rules/outline-color.d.ts +0 -7
  174. package/dist/rules/outline-offset.d.ts +0 -5
  175. package/dist/rules/outline-style.d.ts +0 -6
  176. package/dist/rules/outline-width.d.ts +0 -6
  177. package/dist/rules/outline.d.ts +0 -7
  178. package/dist/rules/overflow.d.ts +0 -9
  179. package/dist/rules/overscroll-behavior.d.ts +0 -8
  180. package/dist/rules/padding.d.ts +0 -9
  181. package/dist/rules/place-content.d.ts +0 -6
  182. package/dist/rules/place-items.d.ts +0 -6
  183. package/dist/rules/place-self.d.ts +0 -6
  184. package/dist/rules/placement.d.ts +0 -8
  185. package/dist/rules/pointer-events.d.ts +0 -5
  186. package/dist/rules/position.d.ts +0 -5
  187. package/dist/rules/quotes.d.ts +0 -5
  188. package/dist/rules/resize.d.ts +0 -5
  189. package/dist/rules/rx.d.ts +0 -6
  190. package/dist/rules/ry.d.ts +0 -6
  191. package/dist/rules/scroll-behavior.d.ts +0 -5
  192. package/dist/rules/scroll-margin.d.ts +0 -9
  193. package/dist/rules/scroll-padding.d.ts +0 -9
  194. package/dist/rules/scroll-snap-align.d.ts +0 -6
  195. package/dist/rules/scroll-snap-stop.d.ts +0 -6
  196. package/dist/rules/scroll-snap-type.d.ts +0 -6
  197. package/dist/rules/shape-image-threshold.d.ts +0 -6
  198. package/dist/rules/shape-margin.d.ts +0 -6
  199. package/dist/rules/shape-outside.d.ts +0 -6
  200. package/dist/rules/spacing.d.ts +0 -9
  201. package/dist/rules/stroke-dasharray.d.ts +0 -5
  202. package/dist/rules/stroke-dashoffset.d.ts +0 -5
  203. package/dist/rules/stroke-width.d.ts +0 -6
  204. package/dist/rules/stroke.d.ts +0 -6
  205. package/dist/rules/table-layout.d.ts +0 -5
  206. package/dist/rules/text-align.d.ts +0 -6
  207. package/dist/rules/text-decoration-color.d.ts +0 -7
  208. package/dist/rules/text-decoration-line.d.ts +0 -6
  209. package/dist/rules/text-decoration-style.d.ts +0 -6
  210. package/dist/rules/text-decoration-thickness.d.ts +0 -7
  211. package/dist/rules/text-decoration.d.ts +0 -8
  212. package/dist/rules/text-fill-color.d.ts +0 -10
  213. package/dist/rules/text-indent.d.ts +0 -5
  214. package/dist/rules/text-orientation.d.ts +0 -6
  215. package/dist/rules/text-overflow.d.ts +0 -6
  216. package/dist/rules/text-rendering.d.ts +0 -6
  217. package/dist/rules/text-shadow.d.ts +0 -6
  218. package/dist/rules/text-size.d.ts +0 -8
  219. package/dist/rules/text-stroke-color.d.ts +0 -10
  220. package/dist/rules/text-stroke-width.d.ts +0 -8
  221. package/dist/rules/text-stroke.d.ts +0 -8
  222. package/dist/rules/text-transform.d.ts +0 -6
  223. package/dist/rules/text-underline-offset.d.ts +0 -5
  224. package/dist/rules/touch-action.d.ts +0 -5
  225. package/dist/rules/transform-box.d.ts +0 -6
  226. package/dist/rules/transform-origin.d.ts +0 -7
  227. package/dist/rules/transform-style.d.ts +0 -6
  228. package/dist/rules/transform.d.ts +0 -9
  229. package/dist/rules/transition-delay.d.ts +0 -7
  230. package/dist/rules/transition-duration.d.ts +0 -7
  231. package/dist/rules/transition-property.d.ts +0 -6
  232. package/dist/rules/transition-timing-function.d.ts +0 -6
  233. package/dist/rules/transition.d.ts +0 -7
  234. package/dist/rules/user-drag.d.ts +0 -8
  235. package/dist/rules/user-select.d.ts +0 -8
  236. package/dist/rules/variable.d.ts +0 -9
  237. package/dist/rules/vertical-align.d.ts +0 -6
  238. package/dist/rules/visibility.d.ts +0 -5
  239. package/dist/rules/white-space.d.ts +0 -6
  240. package/dist/rules/width.d.ts +0 -6
  241. package/dist/rules/will-change.d.ts +0 -5
  242. package/dist/rules/word-break.d.ts +0 -6
  243. package/dist/rules/word-spacing.d.ts +0 -6
  244. package/dist/rules/writing-mode.d.ts +0 -6
  245. package/dist/rules/x.d.ts +0 -6
  246. package/dist/rules/y.d.ts +0 -6
  247. package/dist/rules/z-index.d.ts +0 -7
  248. package/dist/utils/get-border-props.d.ts +0 -3
  249. package/dist/utils/get-css-property-text.d.ts +0 -5
  250. package/dist/utils/normalize-css-calc-text.d.ts +0 -5
  251. package/dist/utils/parse-value-unit.d.ts +0 -2
  252. package/dist/utils/parse-value.d.ts +0 -6
  253. package/readme.md +0 -118
  254. /package/dist/{apis → functions}/fill-color-scale.d.ts +0 -0
package/README.md CHANGED
@@ -1,118 +1,122 @@
1
- <br><br>
1
+ <br>
2
2
  <div align="center">
3
3
 
4
4
  <p align="center">
5
- <img src="https://raw.githubusercontent.com/master-co/package/document/images/logo-and-text.svg" alt="logo" width="142">
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
- <b><!-- name -->CSS<!----></b>
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
- [![MIT License](https://flat.badgen.net/github/license/master-co/css?color=yellow)](https://github.com/master-co/css/blob/main/LICENSE)
13
- [![Latest Release](https://flat.badgen.net/npm/v/@master/css?icon=npm&label&color=yellow)](https://www.npmjs.com/package/@master/css)
14
- [![Bundle Size](https://flat.badgen.net/bundlephobia/minzip/@master/css?icon=packagephobia&label&color=yellow)](https://bundlephobia.com/package/@master/css 'gzip bundle size (including dependencies)')
15
- [![Package Size](https://flat.badgen.net/badgesize/brotli/https://cdn.jsdelivr.net/npm/@master/css?icon=jsdelivr&label&color=yellow)](https://unpkg.com/@master/css 'brotli package size (without dependencies)')
16
- [![Documentation](https://flat.badgen.net/badge/icon/Documentation?icon=awesome&label&color=yellow)](https://css.master.co)
17
- [![Github](https://flat.badgen.net/badge/icon/master-co%2Fcss?icon=github&label&color=yellow)](https://github.com/master-co/css)
18
- [![Discord](https://flat.badgen.net/badge/icon/discord?icon=discord&label&color=yellow)](https://discord.gg/sZNKpAAAw6)
19
- [![CI](https://flat.badgen.net/github/status/master-co/css/main/ci/circleci?icon=circleci)](https://circleci.com/gh/master-co/workflows/css/tree/main)
20
59
 
21
60
  </div>
22
61
 
23
- ![image](https://raw.githubusercontent.com/master-co/css-language-service/alpha/images/cover.jpg)
24
-
25
- - Visit [css.master.co](https://css.master.co) for full documentation.
26
- - Browse our [discussion community](https://github.com/master-co/css/discussions).
27
- - Join our [discord channel](https://discord.gg/sZNKpAAAw6).
28
- - Follow our [twitter](https://twitter.com/mastercorg).
29
-
30
- ##### On this page
31
-
32
- - [Features](#features)
33
- - [Why Master CSS](#why-master-css)
34
- - [Quick Start](#quick-start)
35
- - [Developer Tools](#developer-tools)
36
- - [Inspiration](#inspiration)
37
- - [Related](#related)
38
-
39
- # Features
40
- Let's have a quick overview of the **groundbreaking features** of Master CSS:
41
-
42
- - 🔥 A whole new **CSS language** instead of utilities/libraries.
43
- - 🔓 Write CSS properties, functions, selectors and even media queries directly in `class="..."`.
44
- - 🧠 Automatically generate corresponding CSS rules based on class names.
45
- - 💖 With enhanced CSS syntax, you can **build UIs with less code**.
46
- - ⚡️ Directly use **performant JIT in production**. **~13KB**
47
- - 🧬 [An enhanced and structured CSS syntax](https://docs.master.co/css/syntax-tutorial) for class names.
48
- - 🌈 [A forerunner to syntax highlighting](https://docs.master.co/css/why-master-css#a-forerunner-to-syntax-highlighting) for class names.
49
- - ✨ [Hybrid Rendering](https://docs.master.co/css/hybrid-rendering) that allows you to **pre-generate CSS from HTML on the server side**, and then continue to **use JIT on the client side**.
50
- - ✨ [Group Styles](https://docs.master.co/css/syntax-tutorial#group-styles) that allows you to extract the same selectors and media query styles and make it short.
51
- - ✨ [Reactive Styles](https://docs.master.co/css/syntax-tutorial#style-an-element-based-on-target-state) that allows you to style an element based on parent/sibling state.
52
-
53
- To learn more, check out the [documentation](https://docs.master.co/css/why-master-css).
54
-
55
- # [Why Master CSS](https://docs.master.co/css/why-master-css)
56
- A brief introduction starts by giving you an understanding of **markup-driven CSS**.
57
-
58
- 😐 Traditional
59
- ```html
60
- <style>
61
- .home-section {
62
- background-color: blue;
63
- padding: 2rem;
64
- text-align: center;
65
- }
66
-
67
- .home-section:hover {
68
- background-color: red;
69
- }
70
-
71
- @media (min-width: 1024px) {
72
- .home-section {
73
- padding: 3rem;
74
- }
75
- }
76
- </style>
77
-
78
- <section class="home-section">...</section>
79
- ```
80
- 🤩 Now, refactor it with a whole new CSS language to make it easier. ↓ 86% code
81
- ```html
82
- <section class="bg:blue bg:red:hover p:32 p:48@md text:center">...</section>
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
+ 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 g=`/** @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 y=`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",y),r&&s("master.css.js",g)});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,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -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;
@@ -0,0 +1,130 @@
1
+ import type { FunctionDefinition } from './';
2
+ declare const functions: {
3
+ $: {
4
+ colored: boolean;
5
+ transform(value: any): {
6
+ type: string;
7
+ name: string;
8
+ fallback: string;
9
+ }[];
10
+ };
11
+ calc: FunctionDefinition;
12
+ translate: {
13
+ unit: string;
14
+ };
15
+ translateX: {
16
+ unit: string;
17
+ };
18
+ translateY: {
19
+ unit: string;
20
+ };
21
+ translateZ: {
22
+ unit: string;
23
+ };
24
+ translate3d: {
25
+ unit: string;
26
+ };
27
+ skew: {
28
+ unit: string;
29
+ };
30
+ skewX: {
31
+ unit: string;
32
+ };
33
+ skewY: {
34
+ unit: string;
35
+ };
36
+ skewZ: {
37
+ unit: string;
38
+ };
39
+ skew3d: {
40
+ unit: string;
41
+ };
42
+ rotate: {
43
+ unit: string;
44
+ };
45
+ rotateX: {
46
+ unit: string;
47
+ };
48
+ rotateY: {
49
+ unit: string;
50
+ };
51
+ rotateZ: {
52
+ unit: string;
53
+ };
54
+ rotate3d: {
55
+ unit: string;
56
+ };
57
+ blur: {
58
+ unit: string;
59
+ };
60
+ 'drop-shadow': {
61
+ unit: string;
62
+ };
63
+ 'hue-rotate': {
64
+ unit: string;
65
+ };
66
+ rgb: {
67
+ unit: string;
68
+ };
69
+ rgba: {
70
+ unit: string;
71
+ };
72
+ hsl: {
73
+ unit: string;
74
+ };
75
+ hsla: {
76
+ unit: string;
77
+ };
78
+ color: {
79
+ unit: string;
80
+ colored: boolean;
81
+ };
82
+ 'color-contrast': {
83
+ unit: string;
84
+ colored: boolean;
85
+ };
86
+ 'color-mix': {
87
+ unit: string;
88
+ colored: boolean;
89
+ };
90
+ hwb: {
91
+ unit: string;
92
+ };
93
+ lab: {
94
+ unit: string;
95
+ };
96
+ lch: {
97
+ unit: string;
98
+ };
99
+ oklab: {
100
+ unit: string;
101
+ };
102
+ oklch: {
103
+ unit: string;
104
+ };
105
+ clamp: {
106
+ unit: string;
107
+ };
108
+ repeat: {
109
+ unit: string;
110
+ };
111
+ 'linear-gradient': {
112
+ colored: boolean;
113
+ };
114
+ 'radial-gradient': {
115
+ colored: boolean;
116
+ };
117
+ 'conic-gradient': {
118
+ colored: boolean;
119
+ };
120
+ 'repeating-linear-gradient': {
121
+ colored: boolean;
122
+ };
123
+ 'repeating-radial-gradient': {
124
+ colored: boolean;
125
+ };
126
+ 'repeating-conic-gradient': {
127
+ colored: boolean;
128
+ };
129
+ };
130
+ export default functions;
@@ -1,27 +1,73 @@
1
- import MasterCSSRule from '../rule';
2
- import MasterCSS from '../css';
3
- declare const defaultConfig: MasterCSSConfig;
4
- export default defaultConfig;
5
- export interface MasterCSSConfig {
6
- classes?: Record<string, string>;
7
- colors?: Record<string, string | Record<string, string>>;
8
- breakpoints?: Record<string, number>;
9
- mediaQueries?: Record<string, string>;
10
- selectors?: Record<string, string | string[]>;
11
- semantics?: Record<string, string | Record<string, string | number>>;
12
- values?: Record<string, Record<string, string | number>>;
13
- Rules?: typeof MasterCSSRule[];
14
- themes?: Record<string, {
15
- classes?: Record<string, string>;
16
- colors?: Record<string, string | Record<string, string>>;
17
- }> | string[];
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 { CSSDeclarations } from '../types/css-declarations';
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 AnimationDefinition = {
19
+ [key in 'from' | 'to']?: CSSDeclarations;
20
+ } & {
21
+ [key: string]: CSSDeclarations;
22
+ };
23
+ export type AnimationDefinitions = {
24
+ [key: string]: AnimationDefinition;
25
+ };
26
+ export type SelectorDefinitions = {
27
+ [key: string]: string | string[] | SelectorDefinitions;
28
+ };
29
+ export type MediaQueryDefinitions = {
30
+ [key: string]: number | string | MediaQueryDefinitions;
31
+ };
32
+ export type StyleDefinitions = {
33
+ [key: string]: string | StyleDefinitions;
34
+ };
35
+ export type RuleDefinitions = {
36
+ [key in keyof typeof rules | string]?: RuleDefinition;
37
+ };
38
+ export type VariableDefinitions = {
39
+ [key in keyof typeof rules]?: VariableDefinition;
40
+ } & {
41
+ [key: string]: VariableDefinition | VariableValue;
42
+ };
43
+ export type SemanticDefinitions = {
44
+ [key in keyof typeof semantics]?: CSSDeclarations;
45
+ } & {
46
+ [key: string]: CSSDeclarations;
47
+ };
48
+ export interface FunctionDefinition {
49
+ unit?: string;
50
+ colored?: boolean;
51
+ transform?(this: Rule, value: string): string | ValueComponent[];
52
+ }
53
+ export type FunctionDefinitions = {
54
+ [key: string]: FunctionDefinition;
55
+ };
56
+ export interface Config {
57
+ extends?: (Config | {
58
+ config: Config;
59
+ })[];
60
+ styles?: StyleDefinitions;
61
+ mediaQueries?: MediaQueryDefinitions;
62
+ selectors?: SelectorDefinitions;
63
+ semantics?: SemanticDefinitions;
64
+ variables?: VariableDefinitions;
65
+ rules?: RuleDefinitions;
18
66
  rootSize?: number;
19
- validateRule?: (rule: MasterCSSRule, css?: MasterCSS) => boolean;
20
- scheme?: {
21
- preference?: string;
22
- storage?: {
23
- sync?: boolean;
24
- key?: string;
25
- };
26
- };
67
+ scope?: string;
68
+ important?: boolean;
69
+ override?: boolean;
70
+ functions?: FunctionDefinitions;
71
+ animations?: AnimationDefinitions;
72
+ themeDriver?: 'class' | 'media' | 'host';
27
73
  }
@@ -1,4 +1,5 @@
1
- declare const defaultBreakpoints: {
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 defaultBreakpoints;
14
+ export default mediaQueries;