Skip to content

Commit ef3cf1b

Browse files
vallemarrigor789
andauthoredOct 31, 2022
readme: add ios and android variants as example (#162)
* readme: add variand for ios and android * chore: update readme example Co-authored-by: Igor Randjelovic <[email protected]>
1 parent 9ffb703 commit ef3cf1b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed
 

‎README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Adjust `content`, `darkMode`, `corePlugins` plus any other settings you need, he
3333

3434
```js
3535
// tailwind.config.js
36+
const plugin = require('tailwindcss/plugin');
3637

3738
/** @type {import('tailwindcss').Config} */
3839
module.exports = {
@@ -44,7 +45,20 @@ module.exports = {
4445
theme: {
4546
extend: {},
4647
},
47-
plugins: [],
48+
plugins: [
49+
/**
50+
* A simple inline plugin that adds the ios: and android: variants
51+
*
52+
* Example usage:
53+
*
54+
* <Label class="android:text-red-500 ios:text-blue-500" />
55+
*
56+
*/
57+
plugin(function ({ addVariant }) {
58+
addVariant('android', '.ns-android &');
59+
addVariant('ios', '.ns-ios &');
60+
}),
61+
],
4862
corePlugins: {
4963
preflight: false // disables browser-specific resets
5064
}

0 commit comments

Comments
 (0)
Please sign in to comment.