npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tailwind-phi

v1.0.1

Published

Golden ratio utilities for Tailwind CSS

Downloads

29

Readme

tailwind-φ

Ever notice how some designs just feel... right? There's often mathematics behind that feeling - specifically the golden ratio (φ ≈ 1.618034). This plugin gives you a set of magic numbers, baked into Tailwind utilities, that you can mix into your existing designs to make them feel more harmonious.

npm install tailwind-phi
// tailwind.config.js
module.exports = {
  plugins: [
    require('tailwind-phi')
  ]
}

How to Think About It

Rather than replacing your existing Tailwind classes, tailwind-phi adds new ones you can use strategically:

  • Use grid-cols-phi-fixed when you want that perfect content-sidebar split that just feels right
  • Drop text-phi and friends into your typography system where you need naturally progressive size jumps
  • Grab aspect-phi when you need an image container that's pleasing to the eye
  • Try the phi-thirds layout when you need three columns but want them to feel balanced

The golden ratio isn't about strict rules - it's about having good proportions in your back pocket when you need them.

Design Tips

  • Mix it with your existing spacing system. Use Tailwind's standard gap-* with grid-cols-phi-fixed for example
  • The golden ratio works great for main/aside divisions (main content vs sidebar)
  • Try phi-based spacing around your most important content - it creates subtle emphasis
  • The typography scale works beautifully for article or blog layouts
  • When something feels slightly off in your layout, try swapping in a phi-based proportion

See the live demo for the full utility reference and detailed examples.

License

MIT

Nature's most beautiful proportion (φ ≈ 1.618034) is now available as a carefully curated set of Tailwind utilities. Like a master chef's secret ingredients, these proportions can elevate your designs from good to exquisite.

npm install tailwind-phi
// tailwind.config.js
module.exports = {
  plugins: [
    require('tailwind-phi')
  ]
}

The Art of Golden Proportions

The Perfect Rectangle

The golden rectangle (1:1.618034) is your foundational plating. Use it for images, cards, or any container where you want to cultivate a more organic sense of "rightness" and balance.

<figure class="aspect-phi overflow-hidden rounded-phi">
  <!-- Landscape orientation -->
</figure>

<!-- or portrait orientation -->
 <figure class="aspect-phi-reverse overflow-hidden rounded-phi">
  <!-- Portrait orientation -->
</figure>

Typographic Rhythm & Balance

<article class="space-y-phi-sm">
  <h1 class="text-phi-xl">Leading with Impact</h1>
  <h2 class="text-phi-lg">Natural Hierarchy</h2>
  <p class="text-phi">
    Your content, flowing with mathematical grace
  </p>
</article>

Composing Your Design

The key to using these proportions isn't to apply them everywhere, but to use them intentionally:

  • 🖼 aspect-phi creates the perfect frame for your visual content
  • 📏 -phi modifiers for spacing create subtle, natural rhythms - best when there are multiple stacked elements
  • 🎯 grid-cols-phi-fixed for when you need that perfect asymmetrical balance
  • 📝 text-phi-{size} scale builds harmony into your typography

Think of these utilities like fine seasonings - they're most effective when applied thoughtfully to enhance your design's natural flavors.