All Projects → bradlc → tailwindcss-fluid

bradlc / tailwindcss-fluid

Licence: MIT license
Fluid utilities for Tailwind CSS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tailwindcss-fluid

cra-tailwindcss
Integrate Tailwind CSS in a Create React App setup
Stars: ✭ 105 (-6.25%)
Mutual labels:  tailwind
Figmatocode
Generate responsive pages and apps on HTML, Tailwind, Flutter and SwiftUI.
Stars: ✭ 2,299 (+1952.68%)
Mutual labels:  tailwind
github-markdown-tailwindcss
⛵ Replicate GitHub Flavored Markdown with Tailwind CSS components
Stars: ✭ 100 (-10.71%)
Mutual labels:  tailwind
Jetstream
Tailwind scaffolding for the Laravel framework.
Stars: ✭ 3,102 (+2669.64%)
Mutual labels:  tailwind
Awesome Tailwindcss
😎 Awesome things related to Tailwind CSS
Stars: ✭ 7,791 (+6856.25%)
Mutual labels:  tailwind
tailwind
Makes using TailwindCSS in NativeScript a whole lot easier!
Stars: ✭ 128 (+14.29%)
Mutual labels:  tailwind
css-to-tailwind
Convert plain CSS to TailwindCSS classes. Demo: https://transform.tools/css-to-tailwind
Stars: ✭ 19 (-83.04%)
Mutual labels:  tailwind
rebuild-x-with-tailwind
My playground to learn Tailwind CSS
Stars: ✭ 29 (-74.11%)
Mutual labels:  tailwind
Goodwork
Self hosted project management and collaboration tool powered by TALL stack
Stars: ✭ 1,730 (+1444.64%)
Mutual labels:  tailwind
laravel-tvi
A CMS/CRM for creating & managing websites and form leads. Using Laravel, Tailwind CSS, Vue, and Inertia JS
Stars: ✭ 36 (-67.86%)
Mutual labels:  tailwind
Material Kit React
React Dashboard made with Material UI’s components. Our pro template contains features like TypeScript version, authentication system with Firebase and Auth0 plus many other
Stars: ✭ 3,465 (+2993.75%)
Mutual labels:  tailwind
Tailblocks
Ready-to-use Tailwind CSS blocks.
Stars: ✭ 6,660 (+5846.43%)
Mutual labels:  tailwind
tailwind-dashboard-template
Mosaic Lite is a free admin dashboard template built on top of Tailwind CSS and fully coded in React. Made by
Stars: ✭ 1,662 (+1383.93%)
Mutual labels:  tailwind
Next-JS-Landing-Page-Starter-Template
🚀 Free NextJS Landing Page Template written in Tailwind CSS 3 and TypeScript ⚡️ Made with developer experience first: Next.js 12 + TypeScript + ESLint + Prettier + Husky + Lint-Staged + VSCode + Netlify + PostCSS + Tailwind CSS
Stars: ✭ 521 (+365.18%)
Mutual labels:  tailwind
powergrid-demo
⚡ PowerGrid fully configured in a Laravel project.
Stars: ✭ 38 (-66.07%)
Mutual labels:  tailwind
folio
Interactive Portfolio with Next, GSAP, Tailwind, and React
Stars: ✭ 20 (-82.14%)
Mutual labels:  tailwind
tailwind-components
Collection of components found on the internet
Stars: ✭ 1,326 (+1083.93%)
Mutual labels:  tailwind
loopple
Drag & drop dashboard builder
Stars: ✭ 180 (+60.71%)
Mutual labels:  tailwind
svelte-pwa-now
A PWA ready Svelte v3.0 starter template with Tailwind, Now integration and optional Typescript suppot
Stars: ✭ 138 (+23.21%)
Mutual labels:  tailwind
ttall
Laravel fronend preset for TTALL stack - Tailwindcss | Turbolinks | Alpine.js | Laravel | Livewire 🚀
Stars: ✭ 50 (-55.36%)
Mutual labels:  tailwind

tailwindcss-fluid

Fluid utilities for Tailwind CSS

Install

npm install --save-dev tailwindcss-fluid

Usage

Add the plugin to your Tailwind configuration:

// tailwind.js
module.exports = {
  // ...
  plugins: [
    require('tailwindcss-fluid')({
      // settings
    })
  ]
}

Settings

You define which class names will be generated much like you do in the core Tailwind configuration. The difference is that each variant (e.g. sm, md, lg etc.) has four properties: min, max, minvw, and maxvw:

{
  textSizes: {
    sm: {
      min: '14px',
      max: '20px',
      minvw: '320px',
      maxvw: '1400px'
    }
  }
}

The above settings will generate one new utility class, .text-sm-fluid:

.text-sm-fluid {
  font-size: 14px;
}

@media (min-width: 320px) {
  .text-sm-fluid {
    font-size: calc(14px + 6 * (100vw - 320px) / 1080);
  }
}

@media (min-width: 1400px) {
  .text-sm-fluid {
    font-size: 20px;
  }
}

Supported properties

textSizes, fontWeights, leading, tracking, borderWidths, borderRadius, width, height, minWidth, minHeight, maxWidth, maxHeight, padding, margin, negativeMargin, zIndex, opacity

Setting your values in the core Tailwind config

If you set a property to true it will take the settings from your core config (e.g. module.exports.textSizes):

{
  textSizes: true
}

Note: In this case you will probably want to disable the core textSizes module

Non-fluid values

You can generate non-fluid utilities by defining a single value, like you would normally. This is useful if you want fluid and non-fluid values defined in the same place:

{
  textSizes: {
    sm: '14px',
    md: {
      min: '16px',
      max: '22px',
      minvw: '320px',
      maxvw: '1280px'
    }
  }
}

Suffix

By default all generated class names will end with -fluid. You can override this behaviour with the suffix setting:

{
  suffix: '', // default: '-fluid'
}

Example

Here is an example of using tailwindcss-fluid for all of your (fluid and non-fluid) font-size utilities:

// tailwind.js
module.exports = {
  // ...

  textSizes: {
    sm: '14px',
    md: {
      min: '16px',
      max: '20px',
      minvw: '320px',
      maxvw: '1280px'
    },
    lg: {
      min: '26px',
      max: '40px',
      minvw: '320px',
      maxvw: '1280px'
    }
  },

  // ...

  modules: {
    // ...

    textSizes: false // disable the core module

    // ...
  },

  plugins: [
    require('tailwindcss-fluid')({
      suffix: '',
      textSizes: true // use the settings defined the core config (above)
    })
  ]
}

This configuration will produce three font-size utility classes: text-sm, text-md, and text-lg.

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].