An open API service indexing awesome lists of open source software.

https://github.com/tuanpham-dev/tailwind-parent

A Tailwind Plugin that allows you to style elements based on their parent classes.
https://github.com/tuanpham-dev/tailwind-parent

Last synced: 2 months ago
JSON representation

A Tailwind Plugin that allows you to style elements based on their parent classes.

Awesome Lists containing this project

README

          

# Tailwind Parent
A Tailwind Plugin that allows you to style elements based on their parent classes.

# Installation
1. Install package:
```bash
npm install tailwind-parent --save
```

2. Add to tailwind.config.js
```javascript
plugins: [
require('tailwind-parent')
],
theme: {
parent: {
prefix: '',
classNames: [ // array or object
'is-red',
'is-green',
'is-blue'
]
}
}
```

# Example
```html




```

Results in:
```css
.is-red .is-red\:bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity))
}
```