Skip to content

feat: className:@md, named groups, and arbitrary variant attributes - #53

Merged
jrmybtlr merged 14 commits into
mainfrom
feat/arbitrary-variant-attributes
Sep 5, 2026
Merged

feat: className:@md, named groups, and arbitrary variant attributes#53
jrmybtlr merged 14 commits into
mainfrom
feat/arbitrary-variant-attributes

Conversation

@jrmybtlr

Copy link
Copy Markdown
Owner

Summary

  • Same modifier attributes as Vue for everything Tailwind spells in the variant, including @md, named groups, and arbitrary ones ([&>*], data-[state=open]). Bracket-aware parsing so = inside […] is not the attribute separator; quoted values may use " or '.
  • UseClassy rewrites before JSX/HTML parse (same pipeline as className:sm:hover). No character substitution, no mods() helper.
  • Also includes local demo/tooling: per-major brace-expansion pins, parallel demo dev on port 3000, and a React demo toolchain bump so the new attributes lint/typecheck under Vite 8.

Supersedes #52.

Test plan

  • pnpm test — parser tests for [&>*], data-[state=open], single quotes, dep-scan rewrite
  • React demo: className:@md, className:group-hover/item, className:[&>*], className:data-[state=open], single-quoted modifiers
  • Vue demo still starts on port 3000 (pnpm dev)
  • TypeScript / some linters may still flag source the same way they already flag chained modifiers; Vite is fine because UseClassy runs first

Made with Cursor

cursoragent and others added 6 commits August 25, 2026 18:21
JSX cannot parse className:@md or className:group-hover/item. Keep the
real Tailwind names via mods() / useMods() / classy.mods and scan those
maps into the class manifest instead of inventing substitute characters.

Co-authored-by: Jeremy Butler <jrmybtlr@users.noreply.github.com>
Keep the same attribute spelling as Vue. UseClassy already rewrites
className:@md and className:group-hover/item before JSX parse, matching
className:sm:hover. Character substitution and a separate mods() helper
both felt unnatural.

Co-authored-by: Jeremy Butler <jrmybtlr@users.noreply.github.com>
Parse class:/className: modifier names with bracket depth so
data-[state=open] keeps its inner =, and [&>*] works as an attribute.
Same pre-parse rewrite path as @md and named groups.

Co-authored-by: Jeremy Butler <jrmybtlr@users.noreply.github.com>
Co-authored-by: Jeremy Butler <jrmybtlr@users.noreply.github.com>
class:hover='…' and className:@md='…' parse the same as double quotes,
including whitespace around = and arbitrary variants with inner =.

Co-authored-by: Jeremy Butler <jrmybtlr@users.noreply.github.com>
A global brace-expansion override remapped ESLint's minimatch onto v5 and
broke `expand`. Pin patched versions per major, start all demos in
parallel on fixed ports, and refresh the React demo toolchain.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
useclassy-com 5efce51 Commit Preview URL

Branch Preview URL
Sep 05 2026, 09:52 PM

- Added support for the `useclassy-typescript-plugin` in various demo projects, including React and UnoCSS.
- Updated TypeScript configuration files to extend and include necessary paths for better integration.
- Enhanced VSCode settings to support the new TypeScript plugin and improve development experience.
- Updated demo applications to reflect changes in className handling and added examples for new features.
- Improved README documentation to clarify setup instructions and usage of the TypeScript plugin.
… vite-plugin-useclassy/typescript-plugin

- Removed all instances of the deprecated useclassy-typescript-plugin from package.json, pnpm-lock.yaml, and various demo configurations.
- Updated TypeScript plugin references in configuration files and README to reflect the new vite-plugin-useclassy/typescript-plugin.
- Adjusted VSCode settings and documentation to align with the changes in plugin naming and usage.
- Cleaned up workspace configuration by removing the useclassy-typescript-plugin from pnpm-workspace.yaml.
- Removed unused demo references from tsconfig.json, retaining only the necessary path for tsconfig.node.json.
- This cleanup streamlines the TypeScript configuration for better maintainability.
@jrmybtlr

jrmybtlr commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

Copilot AI and others added 4 commits September 5, 2026 21:44
…t-attributes

# Conflicts:
#	README.md
#	src/init/index.ts
#	src/tests/init-setup.test.ts

Co-authored-by: jrmybtlr <24998792+jrmybtlr@users.noreply.github.com>
Co-authored-by: jrmybtlr <24998792+jrmybtlr@users.noreply.github.com>
Co-authored-by: jrmybtlr <24998792+jrmybtlr@users.noreply.github.com>
Co-authored-by: jrmybtlr <24998792+jrmybtlr@users.noreply.github.com>

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in cb62788.

@jrmybtlr
jrmybtlr merged commit 27ad110 into main Sep 5, 2026
4 checks passed
@jrmybtlr
jrmybtlr deleted the feat/arbitrary-variant-attributes branch September 5, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants