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

Feature Request: twoslash-like for UnoCSS #794

Open
3 of 4 tasks
litingyes opened this issue Sep 28, 2024 · 2 comments
Open
3 of 4 tasks

Feature Request: twoslash-like for UnoCSS #794

litingyes opened this issue Sep 28, 2024 · 2 comments

Comments

@litingyes
Copy link
Contributor

litingyes commented Sep 28, 2024

Clear and concise description of the problem

Is it possible to provide a twoslash-like function for unocss code snippets? Otherwise, it is inconvenient to intuitively view the effective CSS style in the non-editor state.

Suggested solution

Not yet, but it could be

Alternative

No response

Additional context

No response

Validations

Contributes

  • If this feature request is accepted, I am willing to submit a PR to fix this issue
@litingyes litingyes changed the title Twoslash-like for UnoCSS Feature Request: twoslash-like for UnoCSS Sep 28, 2024
@antfu
Copy link
Member

antfu commented Sep 28, 2024

You can write a twoslash implementation following the protocol and reuse @shikijis/twoslash package: https://github.com/twoslashes/twoslash/tree/main/packages/twoslash-protocol

For example, here is an implementation for ESLint: https://github.com/twoslashes/twoslash/tree/main/packages/twoslash-eslint

I don't have the bandwidth to work on this right now, so feel free to give it a shot if anyone wants to try.

@litingyes
Copy link
Contributor Author

You can write a twoslash implementation following the protocol and reuse @shikijis/twoslash package: https://github.com/twoslashes/twoslash/tree/main/packages/twoslash-protocol

For example, here is an implementation for ESLint: https://github.com/twoslashes/twoslash/tree/main/packages/twoslash-eslint

I don't have the bandwidth to work on this right now, so feel free to give it a shot if anyone wants to try.

OK, I will try it during the National Day holiday.

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

2 participants