Coder Social home page Coder Social logo

0xakihiko / tailwind-formatter-blazor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from walrussoup/tailwind-formatter

0.0 0.0 0.0 1.58 MB

Port of the port "Tailwind-Formatter". Opinionated class formatter for TailwindCSS. For blazor in rider

JavaScript 35.63% Ruby 0.60% Kotlin 57.83% CSS 1.60% HTML 2.21% Vue 2.13%

tailwind-formatter-blazor's Introduction

Tailwind Formatter

Tailwind formatter sorts classes according to recommended ordering (as it appears in CSS), without the aggressiveness of prettier. It enforces consistent ordering of classes by parsing your code and reprinting class tags to follow a given order.

Features

  • Customize class ordering with a .tailwindorder file
  • Publish the default recommended order via the dropdown menu
  • Sort currently open file
  • Sort all files project wide

Download

Download Here

Usage

Demo Gif Demo With @apply Gif

Code -> Run Tailwind Formatter

Hotkey -> Shift + Ctrl + H

Class Order

The default class order is available under src/resources/classes.txt. Custom classes will automatically be pushed to the back of the class list. Duplicated classes will also be removed.

The order given is following the recommended standard, which is as they appear in the generated css.

Customizing Sort Order

Create a .tailwindorder configuration file in the root of your project that contains a list of classes as you wish them to appear. If you simply want to move a few, then I recommend publishing the default configuration first.

Example:

bg-red-500
p-4
h-15
mx-2

Due to size restrictions, please consult the plugins classes.txt for a full list of classes as generated by the Tailwind CLI.

Development

Updated Classes

Building updated classes is much more straight forward than painfully going through the docs. It's not elegant, but it works.

cd tailwind
npm install
# If you need to generate the default configuration again, Or consult the default stub https://unpkg.com/browse/[email protected]/stubs/defaultConfig.stub.js 
npx tailwind init --full
# This generates a full classes.css file
npx tailwindcss build -o classes.css
# This parses it and extracts the necessary classes we need into classes.txt
node generate.js
# From there, copy paste classes.txt in resources to update internal list

License

MIT

tailwind-formatter-blazor's People

Contributors

walrussoup avatar tance77 avatar vntw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.