Skip to content

[defineStyleX] className approach does not work in some case #989

@BeiyanYunyi

Description

@BeiyanYunyi

Describe the bug

StyleX removed the attrs() function to keep it "simple". defineStyleX switched to props() function instead at #979. However, props() uses className instead of class, which is not completely compatible with vue. For <div>, className will be turned into class, but for <svg>, it wouldn't.

According to StyleX's document, we should write our own attrs().

Reproduction

defineStyleX, then use v-stylex for <svg>.

System Info

System:
    OS: macOS 26.0
    CPU: (10) arm64 Apple M4
    Memory: 3.51 GB / 32.00 GB
    Shell: 4.0.2 - /etc/profiles/per-user/beiyanyunyi/bin/fish
  Binaries:
    Node: 22.17.0 - /etc/profiles/per-user/beiyanyunyi/bin/node
    npm: 10.9.2 - /etc/profiles/per-user/beiyanyunyi/bin/npm
    pnpm: 10.13.1 - /etc/profiles/per-user/beiyanyunyi/bin/pnpm
    bun: 1.2.20 - /etc/profiles/per-user/beiyanyunyi/bin/bun

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions