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

perf: Add tailwind to editor and design system #9032

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

cstuncsik
Copy link
Contributor

@cstuncsik cstuncsik commented Apr 3, 2024

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Apr 3, 2024
module.exports = {
content: ['./index.html', './src/**/*.{vue,js,ts}'],
darkMode: ['selector', '[data-theme="dark"]'],
theme: {
Copy link
Contributor

Choose a reason for hiding this comment

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

thank you for adding this. But not sure this is enough.. we need some work here to map our design system to the tailwind tokens..
so that we can have consistency and this could succeed..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That could be the next step. First, we should make sure none of the tailwind tokens collide with ours, and then we can start using them.
If I understood correctly, it would not add anything to the built bundle if you don't use anything from Tailwind.

I want to leverage its layout helpers in the first place because they are missing from our design system.
For typography, colors, and spacing, we can still use ours, and later, we can integrate.

Copy link
Contributor

Choose a reason for hiding this comment

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

How much more effort would be adding that support here? Because colors and spacing would be the biggest win here and feels incomplete without it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know how many colors we're using and haven't yet gone deep into customizing Tailwind with CSS variables (I know it's also using them)

1 way would be to overwrite existing tokens with our colors, they have quite a thorough palette and I don't think we use more shades than them (we shouldn't at least).
10-11 variants is more than enough for each color

The other way would be to give all of our own design system colors a meaningful CSS class name and just add them the the tailwind config

https://tailwindcss.com/docs/customizing-colors

Quite the same goes for spacing, luckily we don't have much of them

https://tailwindcss.com/docs/customizing-spacing

I'd say 1-3 days would be enough but verifying and testing is another question (especially without visual regression tests)

Copy link
Contributor

Choose a reason for hiding this comment

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

okay, might be too much effort then to ask of you now.

in my head it's simply adding the mapped tokens to our existing css colors.

Screenshot 2024-04-03 at 14 58 27

why do we need regression tests though? I am only asking to add the tokens like this, maybe update a small component to use the tailwind classes to validate..

Copy link
Contributor

Choose a reason for hiding this comment

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

we should not touch our current css variables..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I see. We just add these and start to use them as CSS classes on the elements rather than the CSS variables in the style tags.

I would be much calmer if we had a regression test to see if nothing was changed visually after introducing tailwind

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. Ya you only need to touch a small component as a POC..

Happy to help with testing in any way. I ran it locally and tested and everything seemed fine.

Do you agree to add colors/spacing tokens within this PR then? Happy to approve if you still think otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If nothing is broken I suggest add colors and spacing in a separate PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay 👍🏽 Sounds good.

netroy
netroy previously requested changes Apr 3, 2024
packages/design-system/package.json Outdated Show resolved Hide resolved
mutdmour
mutdmour previously approved these changes Apr 3, 2024
Copy link
Contributor

github-actions bot commented Apr 3, 2024

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Apr 3, 2024

1 flaky test on run #4773 ↗︎

0 356 12 0 Flakiness 1

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 cstuncsik 🗃️ e2e/*
Project: n8n Commit: 8f8ae2d85f
Status: Passed Duration: 04:15 💡
Started: Apr 25, 2024 5:08 AM Ended: Apr 25, 2024 5:12 AM
Flakiness  cypress/e2e/5-ndv.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Screenshots Video

Review all test suite changes for PR #9032 ↗︎

Copy link
Contributor

github-actions bot commented Apr 3, 2024

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link
Contributor

✅ All Cypress E2E specs passed

@netroy netroy dismissed their stale review April 25, 2024 07:04

approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants