@rocket.chat/css-in-js 0.6.3-dev.46 → 0.6.3-dev.460

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 Rocket.Chat
3
+ Copyright (c) 2021 Rocket.Chat
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,131 +1,91 @@
1
- # Welcome to @rocket.chat/css-in-js 👋
1
+ <!--header-->
2
2
 
3
- [![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://github.com/RocketChat/Rocket.Chat.Fuselage#readme)
4
- [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/RocketChat/Rocket.Chat.Fuselage/graphs/commit-activity)
5
- [![License: MIT](https://img.shields.io/github/license/RocketChat/@rocket.chat/css-in-js)](https://github.com/RocketChat/Rocket.Chat.Fuselage/blob/master/LICENSE)
6
- [![Twitter: RocketChat](https://img.shields.io/twitter/follow/RocketChat.svg?style=social)](https://twitter.com/RocketChat)
3
+ <p align="center">
4
+ <a href="https://rocket.chat" title="Rocket.Chat">
5
+ <img src="https://github.com/RocketChat/Rocket.Chat.Artwork/raw/master/Logos/2020/png/logo-horizontal-red.png" alt="Rocket.Chat" />
6
+ </a>
7
+ </p>
7
8
 
8
- > React Hooks for Fuselage, Rocket.Chat's design system
9
+ # `@rocket.chat/css-in-js`
9
10
 
10
- ### 🏠 [Homepage](https://rocket.chat/Rocket.Chat.Fuselage)
11
+ > Toolset to transpile and use CSS on runtime
11
12
 
12
- ## Install
13
-
14
- ```sh
15
- yarn add @rocket.chat/css-in-js
16
- ```
17
-
18
- ## Run tests
19
-
20
- ```sh
21
- yarn test
22
- ```
23
-
24
- ## API Reference
25
-
26
- <!-- Generated by documentation.js. Update this documentation by updating the source code. -->
27
-
28
- #### Table of Contents
29
-
30
- - [css](#css)
31
- - [Parameters](#parameters)
32
- - [keyframes](#keyframes)
33
- - [Parameters](#parameters-1)
34
- - [attachRules](#attachrules)
35
- - [Parameters](#parameters-2)
36
- - [referenceRules](#referencerules)
37
- - [Parameters](#parameters-3)
38
- - [transpile](#transpile)
39
- - [Parameters](#parameters-4)
40
- - [createSelector](#createselector)
41
- - [Parameters](#parameters-5)
42
-
43
- ### css
44
-
45
- Template string tag to declare CSS content chunks.
46
-
47
- #### Parameters
48
-
49
- - `slices` **TemplateStringsArray**
50
- - `values` **...[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**
13
+ ---
51
14
 
52
- Returns **any** a callback to render the CSS content
15
+ [![npm@latest](https://img.shields.io/npm/v/@rocket.chat/css-in-js/latest?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/icons/v/latest) [![npm@next](https://img.shields.io/npm/v/@rocket.chat/css-in-js/next?style=flat-square)](https://www.npmjs.com/package/@rocket.chat/icons/v/next) ![npm downloads](https://img.shields.io/npm/dw/@rocket.chat/css-in-js?style=flat-square) ![License: MIT](https://img.shields.io/npm/l/@rocket.chat/css-in-js?style=flat-square)
53
16
 
54
- ### keyframes
17
+ ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fcss-in-js&style=flat-square) ![peer deps](https://img.shields.io/david/peer/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fcss-in-js&style=flat-square) ![dev deps](https://img.shields.io/david/dev/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fcss-in-js&style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/min/@rocket.chat/css-in-js?style=flat-square)
55
18
 
56
- Template string tag to declare CSS `@keyframe` at-rules.
19
+ <!--/header-->
57
20
 
58
- #### Parameters
59
-
60
- - `slices` **TemplateStringsArray**
61
- - `values` **...[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**
62
-
63
- Returns **any** a callback to render the CSS at-rule content
64
-
65
- ### attachRules
66
-
67
- Imediately attaches CSS rules into the style sheet.
21
+ ## Install
68
22
 
69
- #### Parameters
23
+ <!--install-->
70
24
 
71
- - `rules` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
25
+ Add `@rocket.chat/css-in-js` as a dependency:
72
26
 
73
- Returns **any** a callback to detach the rules
27
+ ```sh
28
+ npm i @rocket.chat/css-in-js
74
29
 
75
- ### referenceRules
30
+ # or, if you are using yarn:
76
31
 
77
- References CSS rules into the style sheet.
32
+ yarn add @rocket.chat/css-in-js
33
+ ```
78
34
 
79
- Each time this function is called with the same rules a internal reference counter for it
80
- is incremented; when the unreference callback returned by this function is called, the reference
81
- counter is decremented. If the counter reaches zero references, the rules are detached from
82
- style sheet.
35
+ <!--/install-->
83
36
 
84
- #### Parameters
37
+ ## Contributing
85
38
 
86
- - `rules` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
39
+ <!--contributing(msg)-->
87
40
 
88
- Returns **any** a callback to unreference the rules
41
+ Contributions, issues, and feature requests are welcome!<br />
42
+ Feel free to check the [issues](https://github.com/RocketChat/Rocket.Chat.Fuselage/issues).
89
43
 
90
- ### transpile
44
+ <!--/contributing(msg)-->
91
45
 
92
- Transpiles CSS Modules content to CSS rules.
46
+ ### Building
93
47
 
94
- #### Parameters
48
+ As this package dependends on others in this monorepo, before anything run the following at the root directory:
95
49
 
96
- - `selector` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
97
- - `content` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
50
+ <!--yarn(build)-->
98
51
 
99
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
52
+ ```sh
53
+ yarn build
54
+ ```
100
55
 
101
- ### createSelector
56
+ <!--/yarn(build)-->
102
57
 
103
- Creates a pair of selector and escaped selector for a CSS Modules content.
58
+ ### Linting
104
59
 
105
- #### Parameters
60
+ To ensure the source is matching our coding style, we perform [linting](<https://en.wikipedia.org/wiki/Lint_(software)>).
61
+ Before commiting, check if your code fits our style by running:
106
62
 
107
- - `content` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
63
+ <!--yarn(lint)-->
108
64
 
109
- Returns **\[[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)]** a pair of selectors in the format `rcx-@<content hash>`; the second element is escaped
110
- for use in CSS content
65
+ ```sh
66
+ yarn lint
67
+ ```
111
68
 
112
- ## Author
69
+ <!--/yarn(lint)-->
113
70
 
114
- 👤 **Rocket.Chat**
71
+ Some linter warnings and errors can be automatically fixed:
115
72
 
116
- - Twitter: [@RocketChat](https://twitter.com/RocketChat)
117
- - Github: [@RocketChat](https://github.com/RocketChat)
73
+ <!--yarn(lint-and-fix)-->
118
74
 
119
- ## 🤝 Contributing
75
+ ```sh
76
+ yarn lint-and-fix
77
+ ```
120
78
 
121
- Contributions, issues and feature requests are welcome!
79
+ <!--/yarn(lint-and-fix)-->
122
80
 
123
- Feel free to check [issues page](https://github.com/RocketChat/Rocket.Chat.Fuselage/issues).
81
+ ### Running tests
124
82
 
125
- ## Show your support
83
+ Whenever possible, add tests to describe exactly what your code do. You can run them by yourself:
126
84
 
127
- Give a ⭐️ if this project helped you!
85
+ <!--yarn(test)-->
128
86
 
129
- * * *
87
+ ```sh
88
+ yarn test
89
+ ```
130
90
 
131
- _This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
91
+ <!--/yarn(test)-->
@@ -0,0 +1,5 @@
1
+ export { createAnimationName, createClassName, escapeName } from './names';
2
+ export { css, keyframes, cssFn, keyframesFn } from './tags';
3
+ export { cssSupports } from '@rocket.chat/css-supports';
4
+ export { attachRules } from './sheet';
5
+ export { transpile } from './transpile';