@master/css 2.0.0-beta.40 → 2.0.0-beta.42

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 CHANGED
@@ -1,117 +1,132 @@
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
+ <img src="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg#gh-dark-mode-only" alt="Master CSS" width="100%">
6
+ <img src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg#gh-light-mode-only" alt="Master CSS" width="100%">
6
7
  </p>
8
+ <p align="center"><!-- package.description -->A Virtual CSS language with enhanced syntax ~15KB<!----></p>
9
+
7
10
  <p align="center">
8
- <b><!-- name -->CSS<!----></b>
11
+ <a aria-label="NPM Version" href="https://www.npmjs.com/package/@master/css#gh-dark-mode-only">
12
+ <img alt="NPM Version" src="https://img.shields.io/npm/v/@master/css?color=212022&label=&style=for-the-badge"/>
13
+ </a>
14
+ <a aria-label="NPM Version" href="https://www.npmjs.com/package/@master/css#gh-light-mode-only">
15
+ <img alt="NPM Version" src="https://img.shields.io/npm/v/@master/css?color=f6f7f8&label=&style=for-the-badge"/>
16
+ </a>
17
+ <a aria-label="License" href="https://github.com/master-co/css/blob/main/LICENSE#gh-dark-mode-only">
18
+ <img alt="NPM" src="https://img.shields.io/npm/l/@master/css?color=212022&label=%20&style=for-the-badge">
19
+ </a>
20
+ <a aria-label="License" href="https://github.com/master-co/css/blob/main/LICENSE#gh-light-mode-only">
21
+ <img alt="NPM" src="https://img.shields.io/npm/l/@master/css?color=f6f7f8&label=%20&style=for-the-badge">
22
+ </a>
23
+ <a aria-label="NPM Package" href="https://www.jsdelivr.com/package/npm/@master/css#gh-dark-mode-only">
24
+ <img alt="jsDelivr hits (npm scoped)" src="https://img.shields.io/jsdelivr/npm/hm/@master/css?color=212022&label=%20&logo=jsdelivr&style=for-the-badge">
25
+ </a>
26
+ <a aria-label="NPM Package" href="https://www.jsdelivr.com/package/npm/@master/css#gh-light-mode-only">
27
+ <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">
28
+ </a>
29
+ <a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/css#gh-dark-mode-only">
30
+ <img alt="npm" src="https://img.shields.io/npm/dm/@master/css?color=212022&label=%20&logo=npm&style=for-the-badge">
31
+ </a>
32
+ <a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/css#gh-light-mode-only">
33
+ <img alt="npm" src="https://img.shields.io/npm/dm/@master/css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
34
+ </a>
35
+ <a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6#gh-dark-mode-only">
36
+ <img alt="Discord" src="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge"/>
37
+ </a>
38
+ <a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6#gh-light-mode-only">
39
+ <img alt="Discord" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge"/>
40
+ </a>
41
+ <a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg#gh-dark-mode-only">
42
+ <img alt="Twitter" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
43
+ </a>
44
+ <a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg#gh-light-mode-only">
45
+ <img alt="Twitter" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
46
+ </a>
47
+ <a aria-label="Circle CI" href="https://circleci.com/gh/master-co/workflows/css/tree/main#gh-dark-mode-only">
48
+ <img alt="CircleCI" src="https://img.shields.io/circleci/build/gh/master-co/css?color=212022&label=%20&logo=circleci&style=for-the-badge">
49
+ </a>
50
+ <a aria-label="Circle CI" href="https://circleci.com/gh/master-co/workflows/css/tree/main#gh-light-mode-only">
51
+ <img alt="CircleCI" src="https://img.shields.io/circleci/build/gh/master-co/css?color=f6f7f8&label=%20&logo=circleci&style=for-the-badge&&logoColor=000">
52
+ </a>
9
53
  </p>
10
- <p align="center"><!-- package.description -->A Virtual CSS language with enhanced syntax. ~13KB<!----></p>
11
54
 
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/jsdelivr/hits/npm/@master/css?icon=jsdelivr&label&color=yellow)](https://www.jsdelivr.com/package/npm/@master/css 'hits (per month)')
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
55
  </div>
21
56
 
22
- ![image](https://raw.githubusercontent.com/master-co/css-language-service/alpha/images/cover.jpg)
23
-
24
- - Visit [css.master.co](https://css.master.co) for full documentation.
25
- - Browse our [discussion community](https://github.com/master-co/css/discussions).
26
- - Join our [discord channel](https://discord.gg/sZNKpAAAw6).
27
- - Follow our [twitter](https://twitter.com/mastercorg).
28
-
29
- ##### On this page
30
-
31
- - [Features](#features)
32
- - [Why Master CSS](#why-master-css)
33
- - [Quick Start](#quick-start)
34
- - [Developer Tools](#developer-tools)
35
- - [Inspiration](#inspiration)
36
- - [Related](#related)
37
-
38
- # Features
39
- Let's have a quick overview of the **groundbreaking features** of Master CSS:
40
-
41
- - 🔥 A whole new **CSS language** instead of utilities/libraries.
42
- - 🔓 Write CSS properties, functions, selectors and even media queries directly in `class="..."`.
43
- - 🧠 Automatically generate corresponding CSS rules based on class names.
44
- - 💖 With enhanced CSS syntax, you can **build UIs with less code**.
45
- - ⚡️ Directly use **performant JIT in production**. **~13KB**
46
- - 🧬 [An enhanced and structured CSS syntax](https://docs.master.co/css/syntax-tutorial) for class names.
47
- - 🌈 [A forerunner to syntax highlighting](https://docs.master.co/css/why-master-css#a-forerunner-to-syntax-highlighting) for class names.
48
- - ✨ [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**.
49
- - ✨ [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.
50
- - ✨ [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.
51
-
52
- To learn more, check out the [documentation](https://docs.master.co/css/why-master-css).
53
-
54
- # [Why Master CSS](https://docs.master.co/css/why-master-css)
55
- A brief introduction starts by giving you an understanding of **markup-driven CSS**.
56
-
57
- 😐 Traditional
58
- ```html
59
- <style>
60
- .home-section {
61
- background-color: blue;
62
- padding: 2rem;
63
- text-align: center;
64
- }
65
-
66
- .home-section:hover {
67
- background-color: red;
68
- }
69
-
70
- @media (min-width: 1024px) {
71
- .home-section {
72
- padding: 3rem;
73
- }
74
- }
75
- </style>
76
-
77
- <section class="home-section">...</section>
78
- ```
79
- 🤩 Now, refactor it with a whole new CSS language to make it easier. ↓ 86% code
80
- ```html
81
- <section class="bg:blue bg:red:hover p:32 p:48@md text:center">...</section>
82
- ```
83
- To learn more, check out the [Why Master CSS](https://docs.master.co/css/why-master-css) documentation.
84
-
85
- # Quick Start
86
- 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.
87
-
88
- ```shell
89
- npm install @master/css
90
- ```
91
- ```js
92
- import '@master/css';
93
- ```
94
- or use a CDN
95
- ```html
96
- <script src="https://cdn.master.co/css"></script>
97
- ```
98
- Now, start styling HTML with Master CSS. 🎉
99
- ```html
100
- <h1 class="font:40 font:heavy italic m:50 text:center">Hello World</h1>
101
- ```
102
- To learn more, check out the [Syntax tutorial](https://docs.master.co/css/syntax-tutorial) documentation.
103
-
104
- # Developer Tools
105
- - [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.
106
-
107
- # Inspiration
57
+ ## Documentation
58
+
59
+ Visit [css.master.co](https://css.master.co) to view the full documentation.
60
+
61
+ ## Getting Started
62
+
63
+ Check out the [guides](https://css.master.co/docs/guides) to get started quickly with Master CSS.
64
+
65
+ ## Ecosystem
66
+
67
+ <table layout="fixed">
68
+ <tr>
69
+ <th width="250px" align="left">Master CSS</th>
70
+ <th width="800px" align="left">Introduction</th>
71
+ <th width="250px">Changelog</th>
72
+ </tr>
73
+ <tr>
74
+ <th align="left" colspan="3">Packages</th>
75
+ </tr>
76
+ <tr>
77
+ <th align="left"><a href="https://github.com/master-co/css/tree/beta/packages/css">css</a></th>
78
+ <td>The core engine of the Master CSS language</td>
79
+ <td><a href="https://github.com/master-co/css/tree/beta/packages/css/CHANGELOG.md"><img src="https://img.shields.io/npm/v/@master/css?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
80
+ </tr>
81
+ <tr>
82
+ <th align="left"><a href="https://github.com/master-co/css/tree/beta/packages/compiler">css.compiler</a></th>
83
+ <td>Ahead-of-time compiler for Master CSS</td>
84
+ <td><a href="https://github.com/master-co/css/tree/beta/packages/compiler/CHANGELOG.md"><img src="https://img.shields.io/npm/v/@master/css.compiler?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
85
+ </tr>
86
+ <tr>
87
+ <th align="left"><a href="https://github.com/master-co/css/tree/beta/packages/vite">css.vite</a></th>
88
+ <td>A vite plugin that integrates with the AOT compilation of Master CSS</td>
89
+ <td><a href="https://github.com/master-co/css/tree/beta/packages/vite/CHANGELOG.md"><img src="https://img.shields.io/npm/v/@master/css.vite?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
90
+ </tr>
91
+ <tr>
92
+ <th align="left"><a href="https://github.com/master-co/css/tree/beta/packages/webpack">css.webpack</a></th>
93
+ <td>A webpack plugin that integrates with the AOT compilation of Master CSS</td>
94
+ <td><a href="https://github.com/master-co/css/tree/beta/packages/webpack/CHANGELOG.md"><img src="https://img.shields.io/npm/v/@master/css.webpack?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
95
+ </tr>
96
+ <tr>
97
+ <th align="left"><a href="https://github.com/master-co/css/tree/beta/packages/react">css.react</a></th>
98
+ <td>React hooks for Master CSS</td>
99
+ <td><a href="https://github.com/master-co/css/tree/beta/packages/react/CHANGELOG.md"><img src="https://img.shields.io/npm/v/@master/css.react?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
100
+ </tr>
101
+ <tr>
102
+ <th align="left"><a href="https://github.com/master-co/css/tree/beta/packages/normal.css">normal.css</a></th>
103
+ <td>Normalize browser's styles</td>
104
+ <td><a href="https://github.com/master-co/css/tree/beta/packages/normal.css/CHANGELOG.md"><img src="https://img.shields.io/npm/v/@master/normal.css?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
105
+ </tr>
106
+ <tr>
107
+ <th align="left"><a href="https://github.com/master-co/css/tree/beta/packages/keyframes.css">keyframes.css</a></th>
108
+ <td>Simple and useful CSS keyframes</td>
109
+ <td><a href="https://github.com/master-co/css/tree/beta/packages/keyframes.css/CHANGELOG.md"><img src="https://img.shields.io/npm/v/@master/keyframes.css?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
110
+ </tr>
111
+ <tr>
112
+ <th align="left" colspan="3">Related Packages</th>
113
+ </tr>
114
+ <tr>
115
+ <th align="left"><a href="https://github.com/master-co/style-element/tree/beta/packages/react">style-element.react</a></th>
116
+ <td>Quickly create reusable React elements driven by class names</td>
117
+ <td><a href="https://github.com/master-co/css/tree/beta/packages/react/CHANGELOG.md"><img src="https://img.shields.io/npm/v/@master/style-element.react?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
118
+ </tr>
119
+ <tr>
120
+ <th align="left" colspan="3">Extensions</th>
121
+ </tr>
122
+ <tr>
123
+ <th align="left"><a href="https://github.com/master-co/css-language-service">Language Service<br><sub>Visual Studio Code</sub></a></th>
124
+ <td>Code completion, syntax highlighting, CSS hover preview, inline color decorators</td>
125
+ <td><a href="https://github.com/master-co/css-language-service/releases"><img src="https://img.shields.io/github/v/release/master-co/css-language-service?color=212022&label=&style=for-the-badge" alt="Release Notes" valign="middle"/></a></td>
126
+ </tr>
127
+ </table>
128
+
129
+ ## Inspiration
108
130
  Some of our core concepts and designs are inspired by these giants.
109
- - __Language__ - Master is a language, but it was originally inspired by [ACSS](https://acss.io/)'s concept of atomic classes.
110
- - __Virtual CSS__ - Difference algorithms, virtual models, etc. are inspired by [Virtual DOM](https://reactjs.org/docs/faq-internals.html).
111
-
112
- # Related
113
- - [@master/css.react](https://github.com/master-co/css.react) - React hooks for Master CSS
114
- - [@master/css-compiler](https://github.com/master-co/css-compiler) - Compile Master CSS ahead of time with zero-configuration integration with build tools
115
- - [@master/normal.css](https://github.com/master-co/normal.css) - Normalize browser's styles. ~1KB
116
- - [@master/keyframes.css](https://github.com/master-co/keyframes.css) - Simple and useful CSS keyframes. ~0.4KB
117
- - [@master/style-element.react](https://github.com/master-co/style-element.react) - Quickly create styled React elements with conditional class names. ~800B
131
+ - The concept of enhanced syntax is inspired by [SASS](https://sass-lang.com/) and [Typescript](https://www.typescriptlang.org/).
132
+ - The concept of __Virtual CSS__ is inspired by the [Virtual DOM](https://reactjs.org/docs/faq-internals.html).
@@ -1,4 +1,4 @@
1
- declare type ExpandDeep<T> = T extends Record<string | number | symbol, unknown> ? {
1
+ type ExpandDeep<T> = T extends Record<string | number | symbol, unknown> ? {
2
2
  [K in keyof T]: ExpandDeep<T[K]>;
3
3
  } : T extends Array<infer E> ? Array<ExpandDeep<E>> : T;
4
4
  export default function extend<T extends Record<string, any>>(object: T, ...otherObjects: any[]): ExpandDeep<any>;
@@ -3,19 +3,19 @@ import Rule from '../rule';
3
3
  import MasterCSS from '../css';
4
4
  declare const config: Config;
5
5
  export default config;
6
- declare type Colors = {
6
+ type Colors = {
7
7
  [key: string]: string | Colors;
8
8
  };
9
- declare type Breakpoints = {
9
+ type Breakpoints = {
10
10
  [key: string]: number | Breakpoints;
11
11
  };
12
- declare type Selectors = {
12
+ type Selectors = {
13
13
  [key: string]: string | string[] | Selectors;
14
14
  };
15
- declare type Semantics = {
15
+ type Semantics = {
16
16
  [key: string]: string | Record<string, string | number | Semantics>;
17
17
  };
18
- declare type Values = {
18
+ type Values = {
19
19
  [key: string]: string | number | Values;
20
20
  };
21
21
  export interface Config {