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

@trandx/tailwind-auto-grid

v1.0.3

Published

This utility function checks if a given value is a plain object. It returns `true` if the value is an object and `false` otherwise.

Downloads

358

Readme

Tailwind CSS Grid Auto Fit Plugin

This Tailwind CSS plugin provides utilities to create responsive grid layouts using auto-fit with custom sizing from the theme's spacing scale. It also allows for arbitrary values to be used for the minmax function.

NPM

Table of Contents

Capture

alt text

Installation

    pnpm add -D @trandx/tailwind-auto-grid

or

    npm i -D @trandx/tailwind-auto-grid

Configuration

To enable the plugin, add it to your tailwind.config.js:


import type { Config } from 'tailwindcss/types';

import autoGridPlugin from '@trandx/tailwind-auto-grid';

// Export the full Tailwind configuration
const tailwindConfig: Config = {
  content: [],
    theme: {
        extend: {
        // Your theme customizations
        },
    },
    plugins: [
        // Your plugin
        autoGridPlugin,
    ],
};

export default tailwindConfig;

or

// tailwind.config.js
const autoGridPlugin = require('@trandx/tailwind-auto-grid');

module.exports = {
  theme: {
    extend: {
      // Your theme customizations
    },
  },
  plugins: [
    autoGridPlugin,
  ],
};

Usage

use arbitrary values with the .grid-auto-fit utility classes to create responsive grids:


<div class="grid grid-auto-fit-xs gap-4">
    <div class="bg-gray-200">Item 1</div>
    <div class="bg-gray-200">Item 2</div>
    <div class="bg-gray-200">Item 3</div>
</div>

Alternatively, use arbitrary values with the .grid-auto-fill utility:


<div class="grid grid-auto-fill-[10rem] gap-4">
    <div class="bg-gray-200">Item 1</div>
    <div class="bg-gray-200">Item 2</div>
    <div class="bg-gray-200">Item 3</div>
</div>

Changing the grid item size

Use utilities like .grid-auto-fit-sm, .grid-auto-fit-xl or .grid-auto-fill-sm, .grid-auto-fill-xl to change the minimum and maximum item size of the responsive grid. This plugin includes five item sizes with the default minimum size being 16rem and can take custom value in px, rem, etc...

| Class | Minimum item width | | ----------------------------------------------------- | ------------------ | | grid-auto-fill-xs or grid-auto-fit-xs | 6rem | | grid-auto-fill or grid-auto-fit | 8rem | | grid-auto-fill-sm or grid-auto-fit-sm | 10rem | | grid-auto-fill-md or grid-auto-fill-md | 14rem | | grid-auto-fill-lg or grid-auto-fit-lg | 18rem | | grid-auto-fill-xl or grid-auto-fit-xl | 22rem | | grid-auto-fill-[250px] or grid-auto-fit-[250px] | 250px |

If Issues

In case you notice any irregularities in benchmark or you want to add sort library to benchmark score please open issue here

Author

alt text

License

MIT