Skip to content

Commit

Permalink
Upgrade to RFS v10.0.0 #25
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Apr 3, 2024
2 parents ebe5ed2 + adf1030 commit a7c7606
Show file tree
Hide file tree
Showing 3 changed files with 2,807 additions and 8,812 deletions.
28 changes: 6 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
This plugin generates RFS variants of Tailwind utility classes.

## Requirements

This plugin requires a working PostCSS setup of the [RFS PostCSS plugin](https://github.com/twbs/rfs). You can check out the `webpack.mix.js` file for a working setup using Laravel Mix.

## Installation

```
npm install tailwindcss-rfs
```

## Usage
Add `tailwindcss-rfs` to the plugins array of your Tailwind config:

```js
Expand All @@ -25,29 +26,12 @@ module.exports = {
}
```

If you are running a Tailwind CSS version `lower than v3.0`, you also have to add the `rfs` variant to the desired core plugins:

```js
// tailwind.config.js

module.exports = {
variants: {
extend: {
fontSize: ['rfs'],
padding: ['rfs'],
margin: ['rfs'],
gap: ['rfs'],
},
},
plugins: [
require('tailwindcss-rfs')
],
}
```
## Usage

Simply apply the `rfs` variant to any sizing utility. This will pass utility's value to the `rfs()` function and output the processed value.
Simply apply the `rfs` variant to any sizing utility. This will pass the utility's value to the `rfs()` function and output the processed value.

**Template:**

```html
<div class="rfs:p-24">
<p class="rfs:text-6xl">This text resizes magically!</p>
Expand All @@ -67,7 +51,7 @@ Simply apply the `rfs` variant to any sizing utility. This will pass utility's v
}
```

If you are on Tailwind CSS `3.0+` you may also stack the `rfs` variant with other variants like `hover`:
You can also stack the `rfs` variant with other variants like `hover`:

```html
<div class="rfs:p-24 hover:rfs:p-20">
Expand Down
Loading

0 comments on commit a7c7606

Please sign in to comment.