@master/css 2.0.0-beta.99 → 2.0.0-rc.1

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 +38 -20
  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 +3 -0
  6. package/dist/config/index.d.ts +57 -38
  7. package/dist/config/media-queries.d.ts +1 -0
  8. package/dist/config/rules.d.ts +279 -199
  9. package/dist/config/selectors.d.ts +1 -0
  10. package/dist/config/semantics.d.ts +187 -78
  11. package/dist/config/styles.d.ts +3 -0
  12. package/dist/config/variables.d.ts +551 -0
  13. package/dist/constants/base-unit-regex.d.ts +1 -0
  14. package/dist/constants/config-esm-text.d.ts +1 -0
  15. package/dist/constants/config-text.d.ts +1 -0
  16. package/dist/constants/config-ts-text.d.ts +1 -0
  17. package/dist/constants/start-symbol.d.ts +1 -1
  18. package/dist/core.d.ts +96 -0
  19. package/dist/functions/reorder-for-readable-classes.d.ts +12 -0
  20. package/dist/functions/transform-color-with-opacity.d.ts +1 -0
  21. package/dist/index.bundle.js +35 -0
  22. package/dist/index.bundle.mjs +35 -0
  23. package/dist/index.d.ts +10 -21
  24. package/dist/layer.d.ts +11 -0
  25. package/dist/polyfills/css-escape.d.ts +0 -1
  26. package/dist/rule.d.ts +101 -55
  27. package/dist/{config/breakpoints.d.ts → tokens/screen-sizes.d.ts} +3 -2
  28. package/dist/types/global.d.ts +5 -0
  29. package/dist/utils/extend-config.d.ts +2 -0
  30. package/dist/utils/flatten-object.d.ts +1 -0
  31. package/dist/utils/hex-to-rgb.d.ts +1 -1
  32. package/dist/utils/rgb-to-hex.d.ts +1 -1
  33. package/package.json +1 -1
  34. package/dist/apis/fill-color-scale.d.ts +0 -1
  35. package/dist/apis/render-from-html.d.ts +0 -3
  36. package/dist/apis/render-into-html.d.ts +0 -3
  37. package/dist/apis/render.d.ts +0 -3
  38. package/dist/config/colors.d.ts +0 -25
  39. package/dist/config/root-size.d.ts +0 -2
  40. package/dist/config/scheme.d.ts +0 -7
  41. package/dist/config/themes.d.ts +0 -2
  42. package/dist/config/values.d.ts +0 -126
  43. package/dist/css.d.ts +0 -96
  44. package/dist/index.browser.d.ts +0 -1
  45. package/dist/index.browser.js +0 -1
  46. package/dist/index.cjs +0 -1
  47. package/dist/index.mjs +0 -1
  48. package/dist/rules/accent-color.d.ts +0 -6
  49. package/dist/rules/align-content.d.ts +0 -5
  50. package/dist/rules/align-items.d.ts +0 -5
  51. package/dist/rules/align-self.d.ts +0 -5
  52. package/dist/rules/animation-delay.d.ts +0 -6
  53. package/dist/rules/animation-direction.d.ts +0 -5
  54. package/dist/rules/animation-duration.d.ts +0 -6
  55. package/dist/rules/animation-fill-mode.d.ts +0 -5
  56. package/dist/rules/animation-iteration-count.d.ts +0 -6
  57. package/dist/rules/animation-name.d.ts +0 -5
  58. package/dist/rules/animation-play-state.d.ts +0 -5
  59. package/dist/rules/animation-timing-function.d.ts +0 -5
  60. package/dist/rules/animation.d.ts +0 -7
  61. package/dist/rules/appearance.d.ts +0 -4
  62. package/dist/rules/aspect-ratio.d.ts +0 -6
  63. package/dist/rules/backdrop-filter.d.ts +0 -11
  64. package/dist/rules/background-attachment.d.ts +0 -5
  65. package/dist/rules/background-blend-mode.d.ts +0 -4
  66. package/dist/rules/background-clip.d.ts +0 -8
  67. package/dist/rules/background-color.d.ts +0 -7
  68. package/dist/rules/background-image.d.ts +0 -6
  69. package/dist/rules/background-origin.d.ts +0 -5
  70. package/dist/rules/background-position.d.ts +0 -6
  71. package/dist/rules/background-repeat.d.ts +0 -5
  72. package/dist/rules/background-size.d.ts +0 -5
  73. package/dist/rules/background.d.ts +0 -7
  74. package/dist/rules/border-collapse.d.ts +0 -5
  75. package/dist/rules/border-color.d.ts +0 -12
  76. package/dist/rules/border-image-outset.d.ts +0 -4
  77. package/dist/rules/border-image-repeat.d.ts +0 -5
  78. package/dist/rules/border-image-slice.d.ts +0 -5
  79. package/dist/rules/border-image-source.d.ts +0 -5
  80. package/dist/rules/border-image-width.d.ts +0 -5
  81. package/dist/rules/border-image.d.ts +0 -5
  82. package/dist/rules/border-radius.d.ts +0 -10
  83. package/dist/rules/border-spacing.d.ts +0 -4
  84. package/dist/rules/border-style.d.ts +0 -10
  85. package/dist/rules/border-width.d.ts +0 -10
  86. package/dist/rules/border.d.ts +0 -11
  87. package/dist/rules/box-decoration-break.d.ts +0 -8
  88. package/dist/rules/box-shadow.d.ts +0 -6
  89. package/dist/rules/box-sizing.d.ts +0 -5
  90. package/dist/rules/break-after.d.ts +0 -4
  91. package/dist/rules/break-before.d.ts +0 -4
  92. package/dist/rules/break-inside.d.ts +0 -4
  93. package/dist/rules/caret-color.d.ts +0 -6
  94. package/dist/rules/clear.d.ts +0 -4
  95. package/dist/rules/clip-path.d.ts +0 -5
  96. package/dist/rules/color.d.ts +0 -7
  97. package/dist/rules/column-span.d.ts +0 -5
  98. package/dist/rules/columns.d.ts +0 -7
  99. package/dist/rules/contain.d.ts +0 -4
  100. package/dist/rules/content.d.ts +0 -4
  101. package/dist/rules/counter-increment.d.ts +0 -5
  102. package/dist/rules/counter-reset.d.ts +0 -5
  103. package/dist/rules/cursor.d.ts +0 -4
  104. package/dist/rules/cx.d.ts +0 -5
  105. package/dist/rules/cy.d.ts +0 -5
  106. package/dist/rules/direction.d.ts +0 -4
  107. package/dist/rules/display.d.ts +0 -5
  108. package/dist/rules/fill.d.ts +0 -6
  109. package/dist/rules/filter.d.ts +0 -8
  110. package/dist/rules/flex-basis.d.ts +0 -4
  111. package/dist/rules/flex-direction.d.ts +0 -5
  112. package/dist/rules/flex-grow.d.ts +0 -5
  113. package/dist/rules/flex-shrink.d.ts +0 -5
  114. package/dist/rules/flex-wrap.d.ts +0 -5
  115. package/dist/rules/flex.d.ts +0 -6
  116. package/dist/rules/float.d.ts +0 -4
  117. package/dist/rules/font-family.d.ts +0 -5
  118. package/dist/rules/font-feature-settings.d.ts +0 -5
  119. package/dist/rules/font-size.d.ts +0 -5
  120. package/dist/rules/font-smoothing.d.ts +0 -10
  121. package/dist/rules/font-style.d.ts +0 -6
  122. package/dist/rules/font-variant-numeric.d.ts +0 -5
  123. package/dist/rules/font-weight.d.ts +0 -6
  124. package/dist/rules/font.d.ts +0 -7
  125. package/dist/rules/gap.d.ts +0 -10
  126. package/dist/rules/grid-area.d.ts +0 -6
  127. package/dist/rules/grid-auto-columns.d.ts +0 -5
  128. package/dist/rules/grid-auto-flow.d.ts +0 -5
  129. package/dist/rules/grid-auto-rows.d.ts +0 -4
  130. package/dist/rules/grid-column-end.d.ts +0 -6
  131. package/dist/rules/grid-column-start.d.ts +0 -6
  132. package/dist/rules/grid-column.d.ts +0 -8
  133. package/dist/rules/grid-columns.d.ts +0 -9
  134. package/dist/rules/grid-row-end.d.ts +0 -5
  135. package/dist/rules/grid-row-start.d.ts +0 -5
  136. package/dist/rules/grid-row.d.ts +0 -8
  137. package/dist/rules/grid-rows.d.ts +0 -8
  138. package/dist/rules/grid-template-areas.d.ts +0 -4
  139. package/dist/rules/grid-template-columns.d.ts +0 -5
  140. package/dist/rules/grid-template-rows.d.ts +0 -4
  141. package/dist/rules/grid-template.d.ts +0 -5
  142. package/dist/rules/grid.d.ts +0 -5
  143. package/dist/rules/group.d.ts +0 -13
  144. package/dist/rules/height.d.ts +0 -5
  145. package/dist/rules/inset.d.ts +0 -8
  146. package/dist/rules/isolation.d.ts +0 -4
  147. package/dist/rules/justify-content.d.ts +0 -5
  148. package/dist/rules/justify-items.d.ts +0 -5
  149. package/dist/rules/justify-self.d.ts +0 -5
  150. package/dist/rules/letter-spacing.d.ts +0 -6
  151. package/dist/rules/line-clamp.d.ts +0 -8
  152. package/dist/rules/line-height.d.ts +0 -6
  153. package/dist/rules/lines.d.ts +0 -10
  154. package/dist/rules/list-style-image.d.ts +0 -5
  155. package/dist/rules/list-style-position.d.ts +0 -5
  156. package/dist/rules/list-style-type.d.ts +0 -5
  157. package/dist/rules/list-style.d.ts +0 -5
  158. package/dist/rules/margin.d.ts +0 -10
  159. package/dist/rules/mask-image.d.ts +0 -7
  160. package/dist/rules/max-height.d.ts +0 -5
  161. package/dist/rules/max-wh.d.ts +0 -12
  162. package/dist/rules/max-width.d.ts +0 -5
  163. package/dist/rules/min-height.d.ts +0 -5
  164. package/dist/rules/min-wh.d.ts +0 -12
  165. package/dist/rules/min-width.d.ts +0 -5
  166. package/dist/rules/mix-blend-mode.d.ts +0 -5
  167. package/dist/rules/object-fit.d.ts +0 -5
  168. package/dist/rules/object-position.d.ts +0 -5
  169. package/dist/rules/opacity.d.ts +0 -5
  170. package/dist/rules/order.d.ts +0 -6
  171. package/dist/rules/outline-color.d.ts +0 -6
  172. package/dist/rules/outline-offset.d.ts +0 -4
  173. package/dist/rules/outline-style.d.ts +0 -5
  174. package/dist/rules/outline-width.d.ts +0 -5
  175. package/dist/rules/outline.d.ts +0 -6
  176. package/dist/rules/overflow.d.ts +0 -10
  177. package/dist/rules/overscroll-behavior.d.ts +0 -9
  178. package/dist/rules/padding.d.ts +0 -10
  179. package/dist/rules/place-content.d.ts +0 -5
  180. package/dist/rules/place-items.d.ts +0 -5
  181. package/dist/rules/place-self.d.ts +0 -5
  182. package/dist/rules/pointer-events.d.ts +0 -4
  183. package/dist/rules/position.d.ts +0 -4
  184. package/dist/rules/quotes.d.ts +0 -4
  185. package/dist/rules/resize.d.ts +0 -4
  186. package/dist/rules/rx.d.ts +0 -5
  187. package/dist/rules/ry.d.ts +0 -5
  188. package/dist/rules/scroll-behavior.d.ts +0 -4
  189. package/dist/rules/scroll-margin.d.ts +0 -10
  190. package/dist/rules/scroll-padding.d.ts +0 -10
  191. package/dist/rules/scroll-snap-align.d.ts +0 -5
  192. package/dist/rules/scroll-snap-stop.d.ts +0 -5
  193. package/dist/rules/scroll-snap-type.d.ts +0 -5
  194. package/dist/rules/shape-image-threshold.d.ts +0 -5
  195. package/dist/rules/shape-margin.d.ts +0 -5
  196. package/dist/rules/shape-outside.d.ts +0 -5
  197. package/dist/rules/spacing.d.ts +0 -10
  198. package/dist/rules/stroke-dasharray.d.ts +0 -4
  199. package/dist/rules/stroke-dashoffset.d.ts +0 -4
  200. package/dist/rules/stroke-width.d.ts +0 -5
  201. package/dist/rules/stroke.d.ts +0 -5
  202. package/dist/rules/table-layout.d.ts +0 -4
  203. package/dist/rules/text-align.d.ts +0 -5
  204. package/dist/rules/text-decoration-color.d.ts +0 -6
  205. package/dist/rules/text-decoration-line.d.ts +0 -5
  206. package/dist/rules/text-decoration-style.d.ts +0 -5
  207. package/dist/rules/text-decoration-thickness.d.ts +0 -6
  208. package/dist/rules/text-decoration.d.ts +0 -7
  209. package/dist/rules/text-fill-color.d.ts +0 -11
  210. package/dist/rules/text-indent.d.ts +0 -4
  211. package/dist/rules/text-orientation.d.ts +0 -5
  212. package/dist/rules/text-overflow.d.ts +0 -5
  213. package/dist/rules/text-rendering.d.ts +0 -5
  214. package/dist/rules/text-shadow.d.ts +0 -5
  215. package/dist/rules/text-size.d.ts +0 -9
  216. package/dist/rules/text-stroke-color.d.ts +0 -11
  217. package/dist/rules/text-stroke-width.d.ts +0 -9
  218. package/dist/rules/text-stroke.d.ts +0 -9
  219. package/dist/rules/text-transform.d.ts +0 -5
  220. package/dist/rules/text-underline-offset.d.ts +0 -4
  221. package/dist/rules/touch-action.d.ts +0 -4
  222. package/dist/rules/transform-box.d.ts +0 -5
  223. package/dist/rules/transform-origin.d.ts +0 -6
  224. package/dist/rules/transform-style.d.ts +0 -5
  225. package/dist/rules/transform.d.ts +0 -8
  226. package/dist/rules/transition-delay.d.ts +0 -6
  227. package/dist/rules/transition-duration.d.ts +0 -6
  228. package/dist/rules/transition-property.d.ts +0 -5
  229. package/dist/rules/transition-timing-function.d.ts +0 -5
  230. package/dist/rules/transition.d.ts +0 -6
  231. package/dist/rules/user-drag.d.ts +0 -7
  232. package/dist/rules/user-select.d.ts +0 -7
  233. package/dist/rules/variable.d.ts +0 -10
  234. package/dist/rules/vertical-align.d.ts +0 -5
  235. package/dist/rules/visibility.d.ts +0 -4
  236. package/dist/rules/wh.d.ts +0 -12
  237. package/dist/rules/white-space.d.ts +0 -5
  238. package/dist/rules/width.d.ts +0 -5
  239. package/dist/rules/will-change.d.ts +0 -4
  240. package/dist/rules/word-break.d.ts +0 -5
  241. package/dist/rules/word-spacing.d.ts +0 -5
  242. package/dist/rules/writing-mode.d.ts +0 -5
  243. package/dist/rules/x.d.ts +0 -5
  244. package/dist/rules/y.d.ts +0 -5
  245. package/dist/rules/z-index.d.ts +0 -6
  246. package/dist/utils/analyze-unit-value.d.ts +0 -4
  247. package/dist/utils/analyze-value-token.d.ts +0 -3
  248. package/dist/utils/delay.d.ts +0 -2
  249. package/dist/utils/get-border-props.d.ts +0 -3
  250. package/dist/utils/get-css-property-text.d.ts +0 -5
  251. package/dist/utils/normalize-css-calc-text.d.ts +0 -5
  252. package/dist/utils/parse-value-unit.d.ts +0 -2
  253. package/dist/utils/parse-value.d.ts +0 -5
  254. package/dist/utils/test-css.d.ts +0 -3
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  </picture>
11
11
  </a>
12
12
  </p>
13
- <p align="center"><!-- package.description -->A Virtual CSS language with enhanced syntax ~15KB<!----></p>
13
+ <p align="center">A markup-driven CSS language with enhanced syntax</p>
14
14
 
15
15
  <p align="center">
16
16
  <a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
@@ -50,9 +50,9 @@
50
50
  </a>
51
51
  <a aria-label="Github Actions" href="https://github.com/1aron/repo/actions/workflows/release.yml">
52
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">
53
+ <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=rc&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=rc&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=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
56
56
  </picture>
57
57
  </a>
58
58
  </p>
@@ -60,31 +60,49 @@
60
60
  </div>
61
61
 
62
62
  ## Documentation
63
- Visit [css.master.co](https://css.master.co) to view the full documentation
63
+ Visit [rc.css.master.co](https://rc.css.master.co) to view the full documentation
64
64
 
65
65
  ## Getting Started
66
- Check out the [guides](https://css.master.co/docs/guides) to get started with Master CSS
66
+ Check out the [official guides](https://rc.css.master.co/docs) to get started with Master CSS, or walk through the [examples](https://github.com/master-co/css/tree/rc/examples) for a quick overview of integrating with your framework.
67
67
 
68
- ## Ecosystem
69
- We've built various integrations and tools around Master CSS:
68
+ ## Rendering Modes
69
+ Master CSS provides various [rendering modes](https://rc.css.master.co/docs/rendering-modes), allowing you to choose according to the characteristics and needs of different projects.
70
+
71
+ - [Progressive Rendering](https://rc.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://rc.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://rc.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
70
74
 
71
- ##### Build Tools
75
+ ## Ecosystem
76
+ We've built various Master CSS core functionality/integration packages:
72
77
 
73
- - [Vite Plugin](https://github.com/master-co/css/tree/beta/packages/vite) - A vite plugin for integrating Master CSS AOT compilation
74
- - [Webpack Plugin](https://github.com/master-co/css/tree/beta/packages/webpack) - A webpack plugin for integrating Master CSS AOT compilation
75
- - [Compiler](https://github.com/master-co/css/tree/beta/packages/compiler) - The ahead-of-time compiler of Master CSS
78
+ - [CSS](https://github.com/master-co/css/tree/rc/packages/css) - The core of Master CSS, including the runtime engine
76
79
 
77
80
  ##### Frameworks
78
- - [React](https://github.com/master-co/css/tree/beta/packages/react) - React hooks for Master CSS
79
- - [Style Element](https://github.com/master-co/style-element) <sub><sup>React, Vue, ...</sup></sub> - Create reusable style elements using class names in one-linear.
81
+ - [React](https://github.com/master-co/css/tree/rc/packages/react) - Integrate Master CSS the React way
82
+ - [Svelte](https://github.com/master-co/css/tree/rc/packages/svelte) - Integrate Master CSS the Svelte way
83
+ - [Vue](https://github.com/master-co/css/tree/rc/packages/vue) - Integrate Master CSS the Vue.js way
84
+
85
+ ##### Progressive Rendering
86
+ - [Server](https://github.com/master-co/css/tree/rc/packages/server) - Generate Master CSS text from markup on the server
87
+ - [Renderer](https://github.com/master-co/css/tree/rc/packages/renderer) - Pre-renders and injects HTML-required CSS
88
+
89
+ ##### Static Extraction
90
+ - [Extractor](https://github.com/master-co/css/tree/rc/packages/extractor) - Master CSS static extractor for various raw text extraction.
91
+ - [Vite](https://github.com/master-co/css/tree/rc/packages/extractor.vite) - Integrate Master CSS Static Extraction in Vite way
92
+ - [Webpack](https://github.com/master-co/css/tree/rc/packages/extractor.webpack) - Integrate Master CSS Static Extraction in Webpack way
80
93
 
81
- ##### Native Plugins
94
+ ##### Validation
95
+ - [Validator](https://github.com/master-co/css/tree/rc/packages/validator) for Master CSS class syntax
82
96
 
83
- - [Normal CSS](https://github.com/master-co/css/tree/beta/packages/normal.css) - Normalize the browser's styles
84
- - [Keyframes CSS](https://github.com/master-co/css/tree/beta/packages/keyframes.css) - Simple and useful CSS keyframes
97
+ ##### Language
98
+ - [Server](https://github.com/master-co/css/tree/rc/packages/language-server) - The core of the Master CSS language server
99
+ - [Service](https://github.com/master-co/css/tree/rc/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
85
101
 
86
- ##### Extensions
87
- - [Language Service](https://github.com/master-co/css/tree/beta/packages/language-service) <sub><sup>Visual Studio Code</sup></sub> - Includes code completion, syntax highlighting, CSS hover preview, and inline color decorators
102
+ ##### Others
103
+ - [Normal CSS](https://rc.css.master.co/docs/global-styles) - Normalize the browser's styles
104
+ - [Theme Service](https://rc.css.master.co/docs/theme-service) - A CSS theme-switching service for Master CSS
105
+ - [Class Variant](https://rc.css.master.co/docs/class-variant) - Create reusable, extensible, and customizable style class variants
88
106
 
89
107
  ## Community
90
108
  The Master CSS community can be found here:
@@ -95,7 +113,7 @@ The Master CSS community can be found here:
95
113
  <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>
96
114
 
97
115
  ## Contributing
98
- Please see our [CONTRIBUTING.md](https://github.com/master-co/css/blob/beta/.github/CONTRIBUTING.md) for workflow.
116
+ Please see our [CONTRIBUTING](https://github.com/master-co/css/blob/rc/.github/CONTRIBUTING.md) for workflow.
99
117
 
100
118
  ## Inspiration
101
119
  Some of the core concepts and designs are inspired by these giants.
@@ -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,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,3 @@
1
+ import type { FunctionDefinitions } from './';
2
+ declare const functions: FunctionDefinitions;
3
+ export default functions;
@@ -1,49 +1,68 @@
1
- import Rules from './rules';
2
- import Rule from '../rule';
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';
3
10
  declare const config: Config;
4
- export default config;
5
- type Classes = {
6
- [key: string]: string | Classes;
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}` | string]?: VariableValue | VariableDefinition;
7
15
  };
8
- type Colors = {
9
- [key: string]: string | Colors;
16
+ export type CSSKeyframes = {
17
+ [key in 'from' | 'to' | string]: PropertiesHyphen;
10
18
  };
11
- type Breakpoints = {
12
- [key: string]: number | Breakpoints;
19
+ export type AnimationDefinitions = {
20
+ [key: string]: CSSKeyframes;
13
21
  };
14
- type MediaQueries = {
15
- [key: string]: string | MediaQueries;
22
+ export type SelectorDefinitions = {
23
+ [key: string]: string | string[] | SelectorDefinitions;
16
24
  };
17
- type Selectors = {
18
- [key: string]: string | string[] | Selectors;
25
+ export type MediaQueryDefinitions = {
26
+ [key: string]: number | string | MediaQueryDefinitions;
19
27
  };
20
- type Semantics = {
21
- [key: string]: string | number | Record<string, string | number | Semantics>;
28
+ export type StyleDefinitions = {
29
+ [key: string]: string | StyleDefinitions;
22
30
  };
23
- type Values = {
24
- [key: string]: string | number | Values;
31
+ export type RuleDefinitions = {
32
+ [key in keyof typeof rules | string]?: RuleDefinition;
33
+ };
34
+ export type VariableDefinitions = {
35
+ [key in keyof typeof rules]?: VariableDefinition;
36
+ } & {
37
+ [key: string]: VariableDefinition | VariableValue;
38
+ };
39
+ export type SemanticDefinitions = {
40
+ [key in keyof typeof semantics]?: PropertiesHyphen;
41
+ } & {
42
+ [key: string]: PropertiesHyphen;
43
+ };
44
+ export interface FunctionDefinition {
45
+ unit?: string;
46
+ colored?: boolean;
47
+ transform?(this: Rule, value: string, bypassVariableNames: string[]): string | ValueComponent[];
48
+ }
49
+ export type FunctionDefinitions = {
50
+ [key: string]: FunctionDefinition;
25
51
  };
26
52
  export interface Config {
27
- classes?: Classes;
28
- colors?: Colors;
29
- breakpoints?: Breakpoints;
30
- mediaQueries?: MediaQueries;
31
- selectors?: Selectors;
32
- semantics?: Semantics;
33
- values?: {
34
- [id in typeof Rules[number]['id']]?: Values;
35
- } & Values;
36
- Rules?: typeof Rule[];
37
- themes?: Record<string, {
38
- classes?: Classes;
39
- colors?: Colors;
40
- }> | string[];
53
+ extends?: (Config | any)[];
54
+ styles?: StyleDefinitions;
55
+ mediaQueries?: MediaQueryDefinitions;
56
+ selectors?: SelectorDefinitions;
57
+ semantics?: SemanticDefinitions;
58
+ variables?: VariableDefinitions;
59
+ rules?: RuleDefinitions;
41
60
  rootSize?: number;
42
- scheme?: {
43
- preference?: string;
44
- storage?: {
45
- sync?: boolean;
46
- key?: string;
47
- };
48
- };
61
+ baseUnit?: number;
62
+ scope?: string;
63
+ important?: boolean;
64
+ override?: boolean;
65
+ functions?: FunctionDefinitions;
66
+ animations?: AnimationDefinitions;
67
+ themeDriver?: 'class' | 'media' | 'host';
49
68
  }
@@ -0,0 +1 @@
1
+ export { default } from '../tokens/screen-sizes';