Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development mode identifiers should replace . with _ #1489

Open
2 tasks done
dbasilio opened this issue Oct 11, 2024 · 0 comments
Open
2 tasks done

Development mode identifiers should replace . with _ #1489

dbasilio opened this issue Oct 11, 2024 · 0 comments

Comments

@dbasilio
Copy link

Describe the bug

To differentiate our vanilla extract css files to scss, we have to use a prefix to .css.ts so that we can handle the compiled vanilla css files differently than our compiled scss files. We've gone with .vanilla.css.ts but that means our development mode class names now have a . in them, which needs to be escaped in the CSS files. This is a vector for instability that we would rather avoid, so it would be nice if:

  • vanilla extract would automatically replace non-word/non-whitespace characters in the file page with _, or
  • vanilla extract exposed the classname in the identifiers function so we could do basically the same thing ourselves

Right now the classname is not exposed so all our classnames are the same except for the hash, which is not helpful for understanding which styles are fighting.

Reproduction

No repro

System Info

System:
    OS: macOS 14.7
    CPU: (12) arm64 Apple M2 Pro
    Memory: 57.23 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 4.1.1 - ~/.nvm/versions/node/v18.12.1/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 129.0.6668.101
    Firefox: 131.0.2
    Safari: 17.6
  npmPackages:
    @vanilla-extract/css: ^1.16.0 => 1.16.0 
    @vanilla-extract/css-utils: ^0.1.4 => 0.1.4 
    @vanilla-extract/jest-transform: ^1.1.9 => 1.1.9 
    @vanilla-extract/webpack-plugin: ^2.3.13 => 2.3.13 
    webpack: ^5.91.0 => 5.93.0

Used Package Manager

yarn

Logs

No response

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant