All Projects → humans → tailwindcss-modularscale

humans / tailwindcss-modularscale

Licence: other
Modular scale plugin for TailwindCSS.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tailwindcss-modularscale

tailwind-layouts
Collection of Tailwind Layouts
Stars: ✭ 53 (+178.95%)
Mutual labels:  tailwind
black-dashboard
Elegant black dashboard
Stars: ✭ 43 (+126.32%)
Mutual labels:  tailwind
nextjs-typescript-and-mongodb
NextJS template for development with MongoDB.
Stars: ✭ 17 (-10.53%)
Mutual labels:  tailwind
angular-material-starter-template
🍄 Angular 14 boilerplate that comes with Material-UI, Tailwind3, Purgecss, Jest & Cypress Support, Optimal project structure & Interceptor inspired from popular blogs, source map analyzer tools, husky, all pre-configured and much more...
Stars: ✭ 104 (+447.37%)
Mutual labels:  tailwind
electron-vite-tailwind-starter
This Starter utilizes Electron, Vite and Tailwindcss in combination. It trys to adhare best practices.
Stars: ✭ 141 (+642.11%)
Mutual labels:  tailwind
tailwind
Website clones/examples using Tailwind CSS.
Stars: ✭ 49 (+157.89%)
Mutual labels:  tailwind
vurtify
Laravel 8 boilerplate project with Fortify + Vue 3 + Bootstrap 5
Stars: ✭ 61 (+221.05%)
Mutual labels:  tailwind
nextjs-prism-markdown
Example using Prism / Markdown with Next.js including switching syntax highlighting themes.
Stars: ✭ 87 (+357.89%)
Mutual labels:  tailwind
dsmtech
🚀 The best tech companies and startups in the Greater Des Moines area.
Stars: ✭ 21 (+10.53%)
Mutual labels:  tailwind
ngx-tailwind
💨 Simple Angular schematic that initializes Tailwind CSS in your project and adds a custom webpack config to your build process.
Stars: ✭ 120 (+531.58%)
Mutual labels:  tailwind
shopify-slater-tailwindcss
Shopify Starter Theme + TailwindCSS with PurgeCSS
Stars: ✭ 40 (+110.53%)
Mutual labels:  tailwind
bootstrap-tailwind-breakpoints
A tiny little thing that helps you keep track of your break points.
Stars: ✭ 19 (+0%)
Mutual labels:  tailwind
portfolio
This is my portfolio which is also a template. Feel free to fork, star, and use it.
Stars: ✭ 86 (+352.63%)
Mutual labels:  tailwind
tailwind-spotify
Spotify UI built using TailwindCSS and VueJS
Stars: ✭ 36 (+89.47%)
Mutual labels:  tailwind
windstrap
Tailwind CSS with Bootstrap JS
Stars: ✭ 63 (+231.58%)
Mutual labels:  tailwind
react-social-network-v1
Simple React Social Network, built with React,Node,Express,MongoDB and Tailwind
Stars: ✭ 30 (+57.89%)
Mutual labels:  tailwind
tailwindcss-dash-docset
TailwindCSS Dash Docset, built with the Dash Docset Builder in PHP. We needed it. 🌈️
Stars: ✭ 37 (+94.74%)
Mutual labels:  tailwind
animeflix
A anime discovery, streaming site made with NextJs and TailwindCSS. Uses AniList API and video data from GogoAnime. No ads and no vpn required
Stars: ✭ 326 (+1615.79%)
Mutual labels:  tailwind
code-type
Practice code-typing with top 1000 keywords of the most popular programming languages.
Stars: ✭ 31 (+63.16%)
Mutual labels:  tailwind
tailwind-shift
⚙️ Shift to the next TailwindCSS version hassle-free.
Stars: ✭ 114 (+500%)
Mutual labels:  tailwind

TailwindCSS Modular Scale Plugin

Modular scale is used in typography as a sequence of text sizes are harmonious to each other.

Here's an article that explains the Modular Scale far better than I ever will

Installation

# NPM
npm install --save-dev tailwindcss-modularscale

# Yarn
yarn add --dev tailwindcss-modularscale

Usage

Default configuration.

module.exports = {
  // ...

  plugins: [
    require('tailwindcss-modularscale')()
  ],
}

The default configuration:

{
  sizes: [
    { size: 'sm', value: -1 },
    { size: 'base', value: 0 },
    { size: 'lg', value: 1 },
    { size: 'xl', value: 2 },
    { size: '2xl', value: 3 },
    { size: '3xl', value: 4 },
    { size: '4xl', value: 5 }
  ],
  base:  16,
  ratio: 1.333, // Perfect Fourth
  unit: 'px',
}

The generated code will use .ms- to avoid conflicts with the textSize utilities.

.ms-sm   { font-size: 12px; }
.ms-base { font-size: 16px; }
.ms-lg   { font-size: 21px; }
.ms-xl   { font-size: 28px; }
.ms-2xl  { font-size: 38px; }
.ms-3xl  { font-size: 51px; }
.ms-4xl  { font-size: 67px; }

Custom configuration

module.exports = {
  // ...

  plugins: [
    require('tailwindcss-modularscale')({
      sizes: [
        { size: 'base', value: 0 },
        { size: 'lg', value: 1 },
      ],
      base:  1,
      ratio: 1.2,
      unit: 'rem',
    })
  ],
}

To add other variants of the font sizes

module.exports = {
  // ...

  plugins: [
    require('tailwindcss-modularscale')({
      base:     16,
      ratio:    1.333,
      variants: ['responsive'],
    })
  ],
}

Limitations

As of now, this plugin only supports one base size. I'm still not sure what's the best utility class if I were to support multiple base sizes.

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].