@igorkowalczyk/is-browser 1.0.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.
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ const plugin = require("tailwindcss/plugin");
2
+
3
+ module.exports = plugin(function ({ addVariant }) {
4
+ addVariant("firefox", "@-moz-document url-prefix()");
5
+ });
package/license.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Igor Kowalczyk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@igorkowalczyk/is-browser",
3
+ "version": "1.0.1",
4
+ "description": "🏔️ Add support for browser specific variants in Tailwind.css",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "format": "prettier --write . --ignore-unknown",
8
+ "format:check": "prettier --check .",
9
+ "test": "echo \"Error: no test specified\" && exit 1"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/IgorKowalczyk/is-browser.git"
14
+ },
15
+ "keywords": [
16
+ "tailwindcss",
17
+ "react",
18
+ "firefox",
19
+ "chrome"
20
+ ],
21
+ "author": "Igor Kowalczyk",
22
+ "license": "MIT",
23
+ "bugs": {
24
+ "url": "https://github.com/IgorKowalczyk/is-browser/issues"
25
+ },
26
+ "homepage": "https://github.com/IgorKowalczyk/is-browser#readme",
27
+ "devDependencies": {
28
+ "prettier": "^2.6.2",
29
+ "tailwindcss": "^3.1.2",
30
+ "prettier-plugin-tailwindcss": "^0.1.11"
31
+ },
32
+ "files": [
33
+ "index.js"
34
+ ]
35
+ }
package/readme.md ADDED
@@ -0,0 +1,61 @@
1
+ <img width="170" height="170" align="left" style="float: left; margin: 0 10px 0 0; border-radius: 50%;" alt="Tailwindcss" src="https://raw.githubusercontent.com/IgorKowalczyk/is-browser/main/src/images/logo.svg">
2
+
3
+ # Tailwind is `:browser`
4
+
5
+ 🏔️ Add support for browser specific variants in Tailwind.css
6
+ <br><br><br>
7
+
8
+ ---
9
+
10
+ ## 📥 Installation
11
+
12
+ **Tailwind.css v3 or newer is required**.
13
+
14
+ ```
15
+ npm install @igorkowalczyk/is-browser
16
+ yarn add @igorkowalczyk/is-browser
17
+ pnpm add @igorkowalczyk/is-browser
18
+ ```
19
+
20
+ ## 📦 Usage
21
+
22
+ Add to `plugins` in your **tailwind.config.js**:
23
+
24
+ ```js
25
+ module.exports = {
26
+ // ...
27
+ plugins: [
28
+ require("@igorkowalczyk/is-browser"),
29
+ // ...other plugins.
30
+ ],
31
+ };
32
+ ```
33
+
34
+ Style your components using `{browser_name}:{class}`, e.g. `firefox:bg-red-100`, `firefox:bg-blue-100`, etc.
35
+
36
+ ```jsx
37
+ <div className="firefox:bg-red-100 bg-blue-100">
38
+ <p>On firefox background should be red, on other browsers it should be blue</p>
39
+ </div>
40
+ ```
41
+
42
+ ## 🔐 Supported browsers
43
+ | Browser | Browser Version(s) | Variant | CSS Property |
44
+ | --- | --- | --- | --- |
45
+ | Firefox | `1.5 – 61` | `firefox:` | `@-moz-document url-prefix()` |
46
+
47
+ ## ⁉️ Issues
48
+
49
+ If you have any issues with the page please create [new issue here](https://github.com/igorkowalczyk/is-browser/issues)
50
+
51
+ ## 📥 Pull Requests
52
+
53
+ When submitting a pull request:
54
+
55
+ - Clone the repo.
56
+ - Create a branch off of master and give it a meaningful name (e.g. my-awesome-new-feature).
57
+ - Open a [pull request](https://github.com/igorkowalczyk/is-browser/pulls) on [GitHub](https://github.com) and describe the feature or fix.
58
+
59
+ ## 📋 License
60
+
61
+ This project is licensed under the MIT. See the [LICENSE](https://github.com/igorkowalczyk/is-browser/blob/master/license.md) file for details