tx-styling

- Editing components that use the tx prop or tx template literals.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tx-styling" with this command: npx skills add landfolk/tx/landfolk-tx-tx-styling

tx styling

When to use

  • Editing components that use the tx prop or tx template literals.

  • Integrating @landfolk/tx into a React/Next.js app.

  • Debugging grouping, Tailwind extraction, or linting around tx .

Core rules

  • Prefer tx over className for Tailwind classes.

  • Use arrays for conditional styles; avoid string concatenation.

  • Use grouping syntax like hover:(bg-blue-500 text-white) .

  • Do not forward tx props; only forward className .

  • For styleable components, merge className into tx .

Tooling overview

  • SWC plugin rewrites tx to className at compile time.

  • Tailwind transformer expands grouped classes for JIT extraction.

  • ESLint rule sorts and validates classes.

Grouping syntax

Example:

<div tx="hover:(bg-blue-500 text-white)" />

Compiles to className="hover:bg-blue-500 hover:text-white" . Groups can be nested.

SWC transform

  • tx="..." becomes className="..." .

  • Arrays like tx={[cond && tx ...]} become joined className arrays.

  • Tagged tx templates expand at compile time.

  • In dev, class strings can be wrapped with a conflict checker if registered.

Register the dev-only conflict checker once:

import '@landfolk/tx/checkConflicts'

Tailwind transformer

The transformer scans tx attributes and template literals to expand grouped syntax into full class lists so Tailwind JIT sees every class.

ESLint rule

@landfolk/tx/optimize-tailwind-classes :

  • Expands grouped syntax and re-compacts in a stable order.

  • Sorts classes using Tailwind's internal order.

  • Normalizes whitespace in arbitrary values.

  • Can validate class names when given a Tailwind config path.

Getting started

See getting-started.md for install, config, and Next.js compatibility.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

TronScan Transaction Info

Query TRON transaction result, confirmation status, sender, resource consumption. Use when user asks "why did this tx fail", "tx status", "who sent it", "ene...

Registry SourceRecently Updated
1431Profile unavailable
General

Xiaohongshu Crawler

爬取小红书内容,支持登录搜索、笔记详情获取、用户主页信息及热门笔记,无需登录部分功能可用。

Registry SourceRecently Updated
General

TAPD

当用户需要查询、修改 TAPD 项目中需求、缺陷、任务等信息时,如修改状态、添加评论等,通过调用 TAPD MCP 提供相应的服务。当用户要求时,通过 send_qiwei_message 发送消息到企业微信。

Registry SourceRecently Updated
General

Roast Generator

吐槽生成器。温和吐槽、毒舌模式、朋友互怼、名人吐槽、自嘲、Battle模式。Roast generator with gentle, savage modes. 吐槽、毒舌、搞笑。

Registry SourceRecently Updated