Suggestion: nest .css under .tsx files?
enhancement
### Clear and concise description of the problem
Sometimes I'll have a separate CSS file for a component (not using CSS Modules) - e.g. `CodeBlock.css` which is used in `CodeBlock.tsx`. Ideally, I'd like the CSS nested under the component. Is there any reason this isn't the default currently? Open to feedback, of course.
### Suggested solution
Currently we have:
```
"*.tsx": "$(capture).ts, $(capture).*.tsx, $(capture)_*.ts, $(capture)_*.tsx, $(capture).module.css, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts, $(capture).css.ts"
```
Perhaps change that to:
```
"*.tsx": "$(capture).ts, $(capture).*.tsx, $(capture)_*.ts, $(capture)_*.tsx, $(capture).css, $(capture).module.css, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts, $(capture).css.ts",
```
I guess we'd want to do the same for `*.jsx`.
### Alternative
_No response_
### Additional context
_No response_
### Validations
- [x] Follow our [Code of Conduct](https://github.com/antfu/.github/blob/main/CODE_OF_CONDUCT.md)
- [x] Read the [Contributing Guide](https://github.com/antfu/contribute).
- [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
关闭于 2025-01-31 3 条评论