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

Migrate from Windi to Tailwind #4614

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Migrate from Windi to Tailwind #4614

wants to merge 25 commits into from

Conversation

pat-s
Copy link
Contributor

@pat-s pat-s commented Dec 23, 2024

superseedes #3279

fixes #2194

Had to add some scoped classes to resolve some padding and override clashes.
In addition, some width and height specifiers had to be changed as they are different between windi and tailwind.

@pat-s pat-s added refactor delete or replace old code build_pr_images If set, the CI will build images for this PR and push to Dockerhub labels Dec 23, 2024
@woodpecker-bot
Copy link
Collaborator

woodpecker-bot commented Dec 23, 2024

Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-4614.surge.sh

@pat-s pat-s force-pushed the refactor/windi-to-tailwind branch from 15912d6 to 6e64b94 Compare December 23, 2024 17:30
@pat-s pat-s marked this pull request as ready for review December 23, 2024 23:21
.yamllint.yaml Outdated
@@ -6,6 +6,7 @@ ignore-from-file:
- .gitignore
- server/store/datastore/migration/test-files/.gitignore
- web/.gitignore
- web/pnpm-lock.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually list of files from where ignores are read and not a list of ignored files.
There's a different key for ignored files, and you could also add the docs lockfile

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately ignore and ignore-from-file are mutually exclusive. Suggesting to go with ignore.

package.json Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You ran pnpm in the wrong directory? ;)

@@ -67,3 +63,9 @@ const { doSubmit: repairRepos, isLoading: isRepairingRepos } = useAsyncAction(as
notifications.notify({ title: i18n.t('admin.settings.repos.repair.success'), type: 'success' });
});
</script>

<style scoped>
.admin-repos {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this class? If I see it correctly it's only used once

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ListItem class item is used in the "repo list" and "admin repos" list (in the admin settings). Both have different paddings p-0 and p-4 currently. These differences are not directly respected with tailwind as the overrides are not applied in the same way.

The (only) approach that worked was to use scoped CSS classes instead of competing tailwind classes. This was also recommended by AI.
Not sure why it worked in Windi in the first place.

There might be additional cases in which such scoped classes could be of help. Currently, many subelements are a collection of competing tailwind classes merged in from parent objects. It is often unclear which one actually take precedence. AFAIU, with scoped classes, these always take precedence.

import svgLoader from 'vite-svg-loader';
import { defineConfig } from 'vitest/config';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you change this because of the tsc failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, did that before your change. Just followed the official docs how to use vite with tailwind.

@pat-s pat-s mentioned this pull request Dec 24, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build_pr_images If set, the CI will build images for this PR and push to Dockerhub refactor delete or replace old code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to TailwindCSS
3 participants