Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@aparajita/tailwind-ionic

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aparajita/tailwind-ionic - npm Package Compare versions

Comparing version
1.1.1
to
2.0.0
+14
-0
CHANGELOG.md

@@ -5,2 +5,16 @@ # Changelog

## [2.0.0](https://github.com/aparajita/tailwind-ionic/compare/v1.1.1...v2.0.0) (2023-03-03)
### ⚠ BREAKING CHANGES
* - The non-abbreviated variants (prefixed with "ion-") in v1.x have been removed.
- The `ios` and `md` variants have been renamed to `mode-ios` and `mode-md`, and only apply to the `mode` attribute of the `html` element.
### Maintenance
* ignore sonarlint stuff ([55ce7ba](https://github.com/aparajita/tailwind-ionic/commit/55ce7ba8135f4ebde1c6e7b7f142180ccc5500b2))
* remove non-abbreviated variants, rename mode variants ([4f4e680](https://github.com/aparajita/tailwind-ionic/commit/4f4e6800e8abddad420d5bd5d49ae3b295e340f5))
* update deps ([245157f](https://github.com/aparajita/tailwind-ionic/commit/245157fe5e87388fe120e29bc1fd744af9fd4ba2))
### [1.1.1](https://github.com/aparajita/tailwind-ionic/compare/v1.1.0...v1.1.1) (2022-08-29)

@@ -7,0 +21,0 @@

+9
-18

@@ -14,23 +14,16 @@ const fs = require('fs')

'plt-android',
'ios',
'md'
'mode-ios',
'mode-md'
]
function addVariants(add, options) {
const abbreviate = options?.abbreviateVariants
function addVariants(add) {
for (const variant of variants) {
const parts = variant.split(':')
let variantName = parts[0]
const variantName = parts[0]
let selector = parts[1] || parts[0]
if (!abbreviate) {
variantName = 'ion-' + variantName
}
let selector = `${parts[1] || parts[0]}`
if (selector.startsWith('plt-')) {
selector = `html.${selector} &`
} else {
selector = `.${selector} &`
selector = `html[mode="${selector}"] &`
}

@@ -96,7 +89,5 @@

'plt-android',
'ios',
'md'
].map((variant) =>
options?.abbreviateVariants ? variant : 'ion-' + variant
)
'mode-ios',
'mode-md'
]

@@ -103,0 +94,0 @@ return {

{
"name": "@aparajita/tailwind-ionic",
"version": "1.1.1",
"version": "2.0.0",
"description": "Tailwind utilities for Ionic",

@@ -27,11 +27,11 @@ "author": "Aparajita Fishman",

"@aparajita/prettier-config": "^1.0.0",
"@types/node": "^18.7.13",
"commit-and-tag-version": "^10.0.1",
"postcss": "^8.4.14",
"prettier": "^2.7.1",
"tailwindcss": "^3.1.6"
"@types/node": "^18.14.5",
"commit-and-tag-version": "^11.1.0",
"postcss": "^8.4.21",
"prettier": "^2.8.4",
"tailwindcss": "^3.2.7"
},
"peerDependencies": {
"postcss": "^8.4.14",
"tailwindcss": "^3.0.0"
"postcss": "^8.4.21",
"tailwindcss": "^3.2.7"
},

@@ -38,0 +38,0 @@ "dependencies": {

+15
-29

@@ -10,2 +10,6 @@ <div class="markdown-body">

## Breaking changes from v1.x
- The non-abbreviated variants (prefixed with "ion-") in v1.x have been removed.
- The `ios` and `md` variants have been renamed to `mode-ios` and `mode-md`, and only apply to the `mode` attribute of the `html` element.
## Installation

@@ -35,30 +39,13 @@

| Variant | Target |
|:------------------|:-----------------------------------------------------|
| ion-plt-desktop | Desktop mode |
| ion-plt-mobile | Mobile-like device (including browser simulations) |
| ion-plt-mobileweb | Mobile device simulation mode in a browser |
| ion-plt-native | Real device using Capacitor |
| ion-plt-ios | iOS device (including browser simulations) |
| ion-plt-android | Android device (including browser simulations) |
| ion-ios | Element or closest parent is in iOS mode |
| ion-md | Element or closest parent is in Material Design mode |
| Variant | Target |
|:--------------|:---------------------------------------------------|
| plt-desktop | Desktop mode |
| plt-mobile | Mobile-like device (including browser simulations) |
| plt-mobileweb | Mobile device simulation mode in a browser |
| plt-native | Real device using Capacitor |
| plt-ios | iOS device (including browser simulations) |
| plt-android | Android device (including browser simulations) |
| mode-ios | App is in iOS style mode |
| mode-md | App is in Material Design style mode |
#### Variant options
By default the full variant names as shown above are used. If you would like to use abbreviated variant names without the `ion-` prefix, pass an options object to the plugin:
```javascript
/** @type {import('tailwindcss/types').Config} */
/** @type {import('@aparajita/tailwind-ionic').plugin} */
const ionic = require('@aparajita/tailwind-ionic')
module.exports = {
plugins: [ionic({
abbreviatedVariants: true
})]
}
```
#### Examples (with abbreviated variant names)

@@ -102,3 +89,3 @@

You may also pass the path as a `.theme` property of an options object, which you will need to do if you also want to set the `abbreviatedVariant` option.
You may also pass the path as a `.theme` property of an options object.

@@ -114,3 +101,2 @@ ```javascript

theme: 'src/theme/variables.css',
abbreviatedVariants: true
})]

@@ -117,0 +103,0 @@ }