Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tailwindcss-formatter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-formatter

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Tailwindcss::Formatter

This Ruby Gem provides a CLI interface for effortlessly organising and formating Tailwind CSS class declarations in your HTML and ERB templates, following the recommended class order for cleaner and more maintainable code.

Installation

Install the gem and add it to the application's Gemfile by executing:

bundle add tailwindcss-formatter

If bundler is not being used to manage dependencies, install the gem by executing:

gem install tailwindcss-formatter

Usage

Once installed, you can run the formatter from the CLI to format your files. It runs in dry mode by default, so you will need to specify the -w | --write flag to have the modifications written back to the files in place.

It takes a glob or file path as the first argument. If you leave this empty, it will use the default, which is set up for a typical Rails project: "app/**/*.html.erb".

Example with glob pattern to match files:

tailwindcss-format "app/**/*.html.erb"

Example passing the --write flag so the formatting is written to the files in place:

tailwindcss-format "app/**/*.html.erb" -w

Flags

-w | --write Writes the formatted class strings back to the file in place.

-c | --check-formatted Raises exit code 1 if unformatted class declarations are detected.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/benbarber/tailwindcss-formatter.

FAQs

Package last updated on 21 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc