Expand description

Tailwind to Css

Tailwind style tracer + compiler!

use tailwind_css::TailwindBuilder;

fn build() {
    let mut tailwind = TailwindBuilder::default();
    // The compiler will expand directly into the final css property
    // Inline style will not be tracked
    let inline = tailwind.inline("py-2 px-4 bg-green-500");
    // The compiler will expand into a `class`, and record the style class used
    tailwind.trace("py-2 px-4 bg-green-500");
    // Compile all traced classes into bundle
    let bundle = tailwind.bundle();
}

Notice

Tailwind++ Grammar

This library is not strictly implemented according to the original version.

Especially when some writing methods can be simplified or generalized.

For example arbitrary values of z-index needs brackets, but rs version does not.

  • js: z-[100]
  • rs: z-100

Bundle or Inline?

For example, there are style overrides in p-auto px-px pt-2 pb-2.

In inline mode, the latter will overwrite the former, and finally get {}

In Bundle mode, the final result depends on the browser.

Implement Progress

tailwind-rs needs your help!

A lot of documentation and test cases are missing, you are welcome to pr!

See the tests folder for details.

Modules

Macros

Structs

https://tailwindcss.com/docs/adding-custom-styles#using-arbitrary-values

v:v:-a-a-[A]

In general, it is a look-up table.

https://tailwindcss.com/docs/preflight

https://tailwindcss.com/docs/mix-blend-mode

Utilities for controlling the number of columns within an element.

Utilities for applying brightness filters to an element.

A component for fixing an element’s width to the current breakpoint.

Error type for all tailwind operators

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Uncategorized tailwind property

https://tailwindcss.com/docs/opacity

https://tailwindcss.com/docs/screen-readers

https://tailwindcss.com/docs/box-shadow

https://tailwindcss.com/docs/box-shadow

https://tailwindcss.com/docs/height

Utilities for controlling an element’s padding.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Enums

https://github.com/tw-in-js/twind/blob/main/src/twind/variants.ts

Utilities for controlling how the browser should calculate an element’s total size.

Utilities for controlling the stack order of an element.

Utilities for controlling the aspect ratio of an element.

Utilities for controlling whether table borders should collapse or be separated.

https://tailwindcss.com/docs/box-sizing

https://tailwindcss.com/docs/box-sizing

https://tailwindcss.com/docs/clear

Utilities for controlling the number of columns within an element.

Utilities for controlling the font smoothing of an element.

https://tailwindcss.com/docs/display

Actual error data for the error

https://tailwindcss.com/docs/float

font that unknown at parsing time

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

https://tailwindcss.com/docs/object-fit

https://tailwindcss.com/docs/overscroll-behavior

Utilities for controlling how an element is positioned in the DOM.

https://tailwindcss.com/docs/height

Utilities for controlling the table layout algorithm.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

Utilities for controlling the font smoothing of an element.

https://tailwindcss.com/docs/visibility

Traits

Functions

Type Definitions

Tailwind Parsed Result

Tailwind Parsed Result

All result about tailwind