@igorkowalczyk/is-browser 5.0.3 → 5.1.0
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 +22 -7
- package/dist/index.cjs +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/package.json +20 -11
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
## 📥 Installation
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Install the package using your package manager of choice. Tailwind CSS v3 and v4 are supported.
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
npm install @igorkowalczyk/is-browser
|
|
@@ -26,7 +26,20 @@ pnpm add @igorkowalczyk/is-browser
|
|
|
26
26
|
|
|
27
27
|
## 📦 Usage
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### Tailwind CSS v4
|
|
30
|
+
|
|
31
|
+
Import the plugin in your CSS file.
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
@import "tailwindcss";
|
|
35
|
+
@plugin "@igorkowalczyk/is-browser";
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
That's it! You can now use the plugin in your components.
|
|
39
|
+
|
|
40
|
+
### Tailwind CSS v3
|
|
41
|
+
|
|
42
|
+
Add to `plugins` in your `tailwind.config.js`.
|
|
30
43
|
|
|
31
44
|
```js
|
|
32
45
|
module.exports = {
|
|
@@ -38,6 +51,8 @@ module.exports = {
|
|
|
38
51
|
};
|
|
39
52
|
```
|
|
40
53
|
|
|
54
|
+
## 🎨 Examples
|
|
55
|
+
|
|
41
56
|
Style your components using `{browser_name}:{class}`, e.g. `firefox:bg-red-100`, `chrome:bg-blue-100`, etc.
|
|
42
57
|
|
|
43
58
|
```jsx
|
|
@@ -56,15 +71,15 @@ Style your components using `{browser_name}:{class}`, e.g. `firefox:bg-red-100`,
|
|
|
56
71
|
|
|
57
72
|
## ⁉️ Issues
|
|
58
73
|
|
|
59
|
-
If you
|
|
74
|
+
If you come across any errors or have suggestions for improvements, please create a [new issue here](https://github.com/igorkowalczyk/is-browser/issues) and describe it clearly.
|
|
60
75
|
|
|
61
76
|
## 📥 Pull Requests
|
|
62
77
|
|
|
63
|
-
When submitting a pull request:
|
|
78
|
+
When submitting a pull request, please follow these steps:
|
|
64
79
|
|
|
65
|
-
- Clone
|
|
66
|
-
- Create a branch
|
|
67
|
-
- Open a [pull request](https://github.com/igorkowalczyk/is-browser/pulls) on [GitHub](https://github.com) and describe the feature or fix.
|
|
80
|
+
- Clone [this repository](https://github.com/igorkowalczyk/is-browser) `https://github.com/igorkowalczyk/is-browser.git`
|
|
81
|
+
- Create a branch from `main` and give it a meaningful name (e.g. `my-awesome-new-feature`).
|
|
82
|
+
- Open a [pull request](https://github.com/igorkowalczyk/is-browser/pulls) on [GitHub](https://github.com/) and clearly describe the feature or fix you are proposing.
|
|
68
83
|
|
|
69
84
|
## 📋 License
|
|
70
85
|
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var createPlugin=require('tailwindcss/plugin');/* eslint-disable func-names */
|
|
2
|
+
const isBrowser = createPlugin(function ({ addVariant }) {
|
|
3
|
+
addVariant("firefox", "@supports (-moz-appearance: none)");
|
|
4
|
+
addVariant("safari", "@supports (background: -webkit-named-image(i))");
|
|
5
|
+
addVariant("chrome", "@supports (-webkit-app-region: inherit)");
|
|
6
|
+
}); // So rollup can infer the return type
|
|
7
|
+
module.exports=isBrowser;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import createPlugin from'tailwindcss/plugin';/* eslint-disable func-names */
|
|
2
|
+
const isBrowser = createPlugin(function ({ addVariant }) {
|
|
3
|
+
addVariant("firefox", "@supports (-moz-appearance: none)");
|
|
4
|
+
addVariant("safari", "@supports (background: -webkit-named-image(i))");
|
|
5
|
+
addVariant("chrome", "@supports (-webkit-app-region: inherit)");
|
|
6
|
+
}); // So rollup can infer the return type
|
|
7
|
+
export{isBrowser as default};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igorkowalczyk/is-browser",
|
|
3
3
|
"description": "🏔️ Add support for browser specific variants in Tailwind.css",
|
|
4
|
-
"version": "5.0
|
|
4
|
+
"version": "5.1.0",
|
|
5
5
|
"author": "Igor Kowalczyk",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -10,20 +10,28 @@
|
|
|
10
10
|
"bugs": "https://github.com/IgorKowalczyk/is-browser/issues",
|
|
11
11
|
"homepage": "https://github.com/IgorKowalczyk/is-browser#readme",
|
|
12
12
|
"type": "module",
|
|
13
|
+
"main": "dist/index.cjs",
|
|
14
|
+
"module": "dist/index.js",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
13
16
|
"exports": {
|
|
14
|
-
"import": "./dist/
|
|
15
|
-
"require": "./dist/
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"require": "./dist/index.cjs",
|
|
19
|
+
"types": "./dist/index.d.ts"
|
|
16
20
|
},
|
|
17
21
|
"devDependencies": {
|
|
18
|
-
"@igorkowalczyk/eslint-config": "
|
|
19
|
-
"@igorkowalczyk/prettier-config": "
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"@igorkowalczyk/eslint-config": "3.0.7",
|
|
23
|
+
"@igorkowalczyk/prettier-config": "3.0.7",
|
|
24
|
+
"@rollup/plugin-node-resolve": "16.0.0",
|
|
25
|
+
"@rollup/plugin-typescript": "12.1.2",
|
|
26
|
+
"eslint": "9.21.0",
|
|
27
|
+
"prettier": "3.5.3",
|
|
28
|
+
"rimraf": "6.0.1",
|
|
29
|
+
"rollup": "4.34.9",
|
|
30
|
+
"tailwindcss": "4.0.11",
|
|
31
|
+
"typescript": "5.8.2"
|
|
24
32
|
},
|
|
25
33
|
"peerDependencies": {
|
|
26
|
-
"tailwindcss": ">=3.0.0"
|
|
34
|
+
"tailwindcss": ">=3.0.0 || >=4.0.0"
|
|
27
35
|
},
|
|
28
36
|
"files": [
|
|
29
37
|
"README.md",
|
|
@@ -40,7 +48,8 @@
|
|
|
40
48
|
"node": ">=16"
|
|
41
49
|
},
|
|
42
50
|
"scripts": {
|
|
43
|
-
"build": "rollup -c",
|
|
51
|
+
"build": "pnpm run clean && rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
52
|
+
"clean": "rimraf dist",
|
|
44
53
|
"format": "prettier . --write --ignore-unknown --cache",
|
|
45
54
|
"format:check": "prettier . --check --cache",
|
|
46
55
|
"lint": "eslint .",
|