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

Feat/vscode twind intellisense #1270

Closed
wants to merge 8 commits into from

Conversation

ybabts
Copy link
Contributor

@ybabts ybabts commented Jun 11, 2023

What does this feature aim to accomplish?

This feature aims to make the VSCode Intellisense compatible with Twind. Currently, the Twind extension for VSCode is broken, so I have been using the Tailwind CSS extension as a replacement.

What does it do?

This feature is a plugin for Fresh that clones the Twind config to the Tailwind config, enabling proper auto-completion of custom values. It runs during the initialization of dev.ts. With the start task, it automatically regenerates the Tailwind config for VSCode whenever it changes.

How does it work?

First, it reads the Twind config file and applies a regex pattern to capture the inner Twind config. It checks if the config was successfully captured; if not, the promise is rejected. It then removes the selfURL: import.meta.url, line and wraps the Twind config with module.exports = {$1}. Finally, it writes the file to the location where the Tailwind CSS extension expects the tailwind.config.js file.

When does this plugin apply?

This plugin is applied during the project initialization process. If the user selects Tailwind and VSCode, this plugin will be automatically applied. Otherwise, it will have no effect.

@ybabts ybabts marked this pull request as ready for review June 11, 2023 16:46
@Norfeldt
Copy link

Norfeldt commented Jul 19, 2023

Does this also fix the issue with typescript 5?

@deer
Copy link
Contributor

deer commented Nov 29, 2023

@marvinhagemeister, another tailwind victim here.

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.

4 participants