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

@hybrbase-front/postcss-config

v1.0.0

Published

A shareable postcss configuration for projects.

Downloads

1

Readme

Shareable PostCSS Config

📄 About

Shareable configuration for PostCSS — a tool for transforming CSS with JavaScript.

The package provides a set of plugins and settings that can be easily shared and reused across different projects, reducing the amount of boilerplate code needed to set up PostCSS in each project.

→ Purpose

Simplify the process of setting up PostCSS in a project by providing a pre-configured set of plugins and settings.

This package can be useful for developers who want to:

  • Use PostCSS in their project but don't want to spend time configuring it from scratch

  • Share PostCSS configuration across multiple projects

  • Avoid maintaining and updating PostCSS configuration in every project manually

  • Take advantage of preconfigured optimizations and plugins, such as:

    • autoprefixer — adds vendor prefixes to CSS properties
    • cssnano — minifies CSS files and removes unnecessary code
    • postcss-preset-env — enables the use of future CSS features and converts them into compatible CSS code for current browsers.
    • postcss-import, which allows you to use @import statements in your CSS files, making it easy to split your code into multiple files and organize your CSS
    • postcss-100vh-fix — fixes the issue where the height of an element with 100vh is taller than the viewport in some mobile browsers
    • postcss-flexbugs-fixes — fixes various flexbox bugs in older versions of Safari and IE
    • [tailwindcss — utility-first CSS framework for rapidly building custom user interfaces
    • [tailwindcss/nesting — adds support for nested rules in Tailwind CSS
    • postcss-reporter — logs PostCSS messages to the console with a clean and concise format

Developers can streamline the process of using PostCSS in their project and ensure a consistent configuration across different projects.

💿 Installation

To use this configuration, you'll need to install @hybrbase-front/postcss-config as a development dependency in your project. You can do this by running the following command:

pnpm add -D \
 postcss \
 @hybrbase-front/postcss-config \
 postcss-100vh-fix \
 postcss-flexbugs-fixes \
 postcss-import \
 postcss-preset-env \
 postcss-reporter

If you're working in a monorepository and want to add the package to a specific app, you can use the --filter flag to add it only to that app. For example:

pnpm --filter=[app-dir-name] add -D \
 postcss \
 @hybrbase-front/postcss-config \
 postcss-100vh-fix \
 postcss-flexbugs-fixes \
 postcss-import \
 postcss-preset-env \
 postcss-reporter

Replace [app-dir-name] with the name of the directory of the app where you want to install the package.

💻 Usage

To use the @hybrbase-front/postcss-config package in your project, follow these steps:

  1. Create a file called postcss.config.js in the root folder of your project.
  2. Add the following code to the postcss.config.js file:
module.exports = require('@hybrbase-front/postcss-config')

If you're using a monorepository, your project structure might look like this:

.
└── apps
    ├── docs    # example nextra app
    └── web     # example nextjs app
        ├── postcss.config.js
        ├── ... (other app files)
└── packages    # shared packages

→ Extending the Configuration

To extend the @hybrbase-front/postcss-config configuration, create a new postcss.config.js file with the following code:

module.exports = {
  plugins: [...require('@hybrbase-front/postcss-config').plugins, require('autoprefixer')],
}

In this code, you're extending the plugins array of the existing configuration by first including the plugins in the original configuration using ...require('@hybrbase-front/postcss-config').plugins and then adding autoprefixer as a new plugin.