Giter Club home page Giter Club logo

tailwindcss-rfs's Introduction

GitHub release (latest by date) npm GitHub

RFS Plugin for Tailwind CSS

This plugin generates RFS variants of Tailwind utility classes.

Requirements

This plugin requires a working PostCSS setup of the RFS PostCSS plugin. You can check out the webpack.mix.js file for a working setup using Laravel Mix.

Installation

npm install tailwindcss-rfs

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

module.exports = {
    plugins: [
        require('tailwindcss-rfs')
    ],
}

Usage

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:

<div class="rfs:p-24">
    <p class="rfs:text-6xl">This text resizes magically!</p>
</div>

Output:

.rfs\:text-6xl {
  font-size: calc(1.5rem + 3vw);
  line-height: 1;
}

.rfs\:p-24 {
  padding: calc(1.725rem + 5.7vw);
}

You can also stack the rfs variant with other variants like hover:

<div class="rfs:p-24 hover:rfs:p-20">
    <p class="rfs:text-6xl hover:rfs:text-5xl">This text resizes magically!</p>
</div>

tailwindcss-rfs's People

Contributors

aerni avatar dependabot[bot] avatar lynden-jones avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tailwindcss-rfs's Issues

Usage example

Hi

Is it possible for you to give a small example how to use this plugin?

Thanks in advance.

rjs

prefix option doesn't seem to work

I set the prefix to ''. I also tried setting the prefix to 'something-else-'.

However the prefix remained as 'rfs-'

This is my tailwind.config.js

module.exports = {
  future: {
    // removeDeprecatedGapUtilities: true,
    // purgeLayersByDefault: true,
  },
  purge: [],
  theme: {
    extend: {},
  },
  variants: {},
  corePlugins: {
    fontSize: false, // defer to rfs
    padding: false, // defer to rfs
    margin: false, // defer to rfs
  },
  plugins: [
    require('tailwindcss-rfs')({
      prefix: '',
      fontSizeUtilities: true,
      paddingUtilities: true,
      marginUtilities: true,
    })
  ]
}

Is repository still active?

Hello,

I would like to submit a Pull Request, but am wondering if the Repository is still actively maintained?

Tailwind issue, invalid font size value

I seem to be getting an issue where tailwind is appending [object Object] to the end of font sizes. I'm currently using Gatsby with Tailwind CSS compatibility version. Below is a screenshot of the problem:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.