Skip to content

Commit 046b98f

Browse files
committed
0.2 WIP
This is a major version : anterior versions to 0.2 used an old mechanism to retrieve group of styles in class attributes. Nowadays, regular expressions are used instead.
1 parent c2cc93f commit 046b98f

File tree

15 files changed

+473
-1092
lines changed

15 files changed

+473
-1092
lines changed

.github/workflows/deploy-image.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
node_modules
2-
index.min.js
3-
*.map
42
pacakge-lock.json

README.md

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ CSS-in-JS-in-HTML is a JavaScript library which permits you to apply CSS propert
8686

8787
### Prerequisites
8888

89+
> ⚠️ The following prerequisites were tested with the version 0.1.6 of the library and not the current version. However, the compatibility should be the same.
90+
8991
The followed prerequisites are the minimum requirements to use the library. The library may work with older browsers with the polyfills but it's not guaranteed (and recommended).
9092

9193
__Modern browers__
@@ -107,53 +109,27 @@ __Older browsers__
107109

108110
#### From CDN
109111

110-
1. Import `index.min.js` (or `index.js`) in your HTML file
112+
1. Import `main.js` in your HTML file
111113
```html
112-
<script src="https://cdn.jsdelivr.net/gh/ulyssear/css-in-js-in-html@0.1.6/build/index.min.js"></script>
114+
<script src="https://cdn.jsdelivr.net/gh/ulyssear/css-in-js-in-html@0.2.0/main.js"></script>
113115
```
114116

115117
2. Add one line of CSS to hide the page while building (and permits to hide elements with hidden attribute)
116118
```css
117119
html[aria-busy="true"], [hidden] { display: none!important; }
118120
```
119121

120-
3. Call `CSS_IN_JS_IN_HTML.init(document,null)` to start the library. The optimal use case is to call it in the `DOMContentLoaded` event.
121-
```js
122-
document.addEventListener('DOMContentLoaded', () => CSS_IN_JS_IN_HTML.init(document, null));
123-
```
124-
125122
#### Manual installation
126123

127124
1. Clone the repo
128125
```sh
129126
git clone https://github.com/ulyssear/css-in-js-in-html.git
130127
```
131-
2. Import `index.min.js` (or `index.js`) in your HTML file
128+
2. Import `main.js` in your HTML file
132129
```html
133-
<script src="path/to/css-in-js-in-html/build/index.min.js"></script>
130+
<script src="path/to/css-in-js-in-html/main.js"></script>
134131
```
135132

136-
#### (Optional) Add polyfills
137-
138-
Some polyfills are required to make the library work on older browsers (IE9 and above). You can add them by importing the following file in your HTML file.
139-
140-
```html
141-
<script type="text/javascript" src="path/to/css-in-js-in-html/build/polyfill.min.js"></script>
142-
```
143-
144-
The polyfills permit to use the following features :
145-
- `window.getComputedStyle`
146-
- `Array.isArray`
147-
- `Array.prototype.lastIndexOf`
148-
- `Array.prototype.reduce`
149-
- `addEventListener`
150-
- `window.matchMedia`
151-
- `document.querySelectorAll`
152-
- `document.querySelector`
153-
- `String.prototype.trim`
154-
155-
It's recommended to not use the polyfills if you don't need to support old browsers.
156-
157133
<p align="right">(<a href="#readme-top">back to top</a>)</p>
158134

159135

@@ -180,7 +156,6 @@ See the [open issues](https://github.com/ulyssear/css-in-js-in-html/issues) for
180156
<p align="right">(<a href="#readme-top">back to top</a>)</p>
181157

182158

183-
184159
<!-- CONTRIBUTING -->
185160
## Contributing
186161

@@ -234,7 +209,6 @@ Project Link: [https://github.com/ulyssear/css-in-js-in-html](https://github.com
234209
[license-url]: https://github.com/ulyssear/css-in-js-in-html/blob/master/LICENSE
235210
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
236211
[linkedin-url]: https://linkedin.com/in/ulyssearnaud
237-
[product-screenshot]: images/screenshot.png
238212
[JavaScript-shield]: https://img.shields.io/badge/JavaScript-323330?style=for-the-badge&logo=javascript&logoColor=F7DF1E
239213
[JavaScript-url]: https://www.javascript.com/
240214
[NPM-shield]: https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white

jest-puppeteer.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

jest.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)