Skip to content

Conversation

@aqsaaqeel
Copy link
Contributor

@aqsaaqeel aqsaaqeel commented Jul 26, 2023

Added tailwind code generator for border radius property

Fixes Issue

**My PR closes #416 **

πŸ‘¨β€πŸ’» Changes proposed(What did you do ?)

βœ”οΈ Check List (Check all the applicable boxes)

  • [] My code follows the code style of this project.
  • [] This PR does not contain plagiarized content.
  • [] The title and description of the PR is clear and explains the approach.

Note to reviewers

πŸ“· Screenshots

Added tailwind code generator for border radius property
@vercel
Copy link

vercel bot commented Jul 26, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
code-magic βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jul 30, 2023 4:15pm

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks Passed!

@Dun-sin
Copy link
Owner

Dun-sin commented Jul 26, 2023

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Issue Reference In order to be considered for merging, the pull request description must refer to a specific issue number. This is described in our Contributing Guide. This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue number that this PR is meant to address.

@aqsaaqeel

break;
case 'border-radius':
codeToCopy = ``;
codeToCopy = `<div class="rounded-sm"></div>`;
Copy link
Owner

Choose a reason for hiding this comment

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

This is hard coded and not what this project is about, please look at what this person did for this PR, this is what is expected #421

@aqsaaqeel
Copy link
Contributor Author

aqsaaqeel commented Jul 29, 2023

https://github.com/Dun-sin/Code-Magic/pull/419/commits
This is the latest commit that tackles the issue of hard-coded values and now can take any arbitrary value. I have tested the code that is generated when clicking on "copy tailwind code" button on this sandbox https://codesandbox.io/s/react-tailwind-3-0-279d3?file=/src/App.js and it works.
This layout πŸ‘‡
Screenshot from 2023-07-30 00-57-32
produced this πŸ‘‡ border-radius style
Screenshot from 2023-07-30 01-40-48

Note: The issue that I faced initially was that Tailwind versions below 2.1 did not support arbitrary values. They had to be hard-coded. Only Tailwind version3.0 and above allow arbitrary values to be used on the go. otherwise in versions 2.0-2.9 have to include a JIT mode in config file to allow arbitrary values.
I have a simple suggestion of adding a note for the user on the website to show that the code that is generated is supported by Tailwind version 3.0.

@aqsaaqeel
Copy link
Contributor Author

I have made the changes but I am facing some issues with the commit not being on the branch that I created. @Dun-sin can you help out?

@Dun-sin
Copy link
Owner

Dun-sin commented Jul 29, 2023

https://github.com/Dun-sin/Code-Magic/pull/419/commits
This is the latest commit that tackles the issue of hard-coded values and now can take any arbitrary value. I have tested the code that is generated when clicking on "copy tailwind code" button on this sandbox and it works.
This layout πŸ‘‡
Screenshot from 2023-07-30 00-57-32
produced this πŸ‘‡ border-radius style
Screenshot from 2023-07-30 01-40-48

Note: The issue that I faced initially was that Tailwind versions below 2.1 did not support arbitrary values. They had to be hard-coded. Only Tailwind version3.0 and above allow arbitrary values to be used on the go. otherwise in versions 2.0-2.9 have to include a JIT mode in config file to allow arbitrary values.
I have a simple suggestion of adding a note for the user on the website to show that the code that is generated is supported by Tailwind version 3.0.

Most people will use the latest anyway. So not a problem

@Dun-sin
Copy link
Owner

Dun-sin commented Jul 29, 2023

I have made the changes but I am facing some issues with the commit not being on the branch that I created. @Dun-sin can you help out?

I don't understand what you mean, I see the commit in this PR, the only problem is the vercel build error Screenshot_2023-07-29-21-25-41-076_com.github.android.jpg

@aqsaaqeel
Copy link
Contributor Author

I have made the changes but I am facing some issues with the commit not being on the branch that I created. @Dun-sin can you help out?

I don't understand what you mean, I see the commit in this PR, the only problem is the vercel build error Screenshot_2023-07-29-21-25-41-076_com.github.android.jpg
I am unable to view the vercel build details, how do i check why my build is failing?
Screenshot from 2023-07-30 01-59-41

@Dun-sin
Copy link
Owner

Dun-sin commented Jul 29, 2023

I have made the changes but I am facing some issues with the commit not being on the branch that I created. @Dun-sin can you help out?

I don't understand what you mean, I see the commit in this PR, the only problem is the vercel build error Screenshot_2023-07-29-21-25-41-076_com.github.android.jpg
I am unable to view the vercel build details, how do i check why my build is failing?
Screenshot from 2023-07-30 01-59-41

You can run npm run build will be the same error that you get

@aqsaaqeel
Copy link
Contributor Author

I have made the changes but I am facing some issues with the commit not being on the branch that I created. @Dun-sin can you help out?

I don't understand what you mean, I see the commit in this PR, the only problem is the vercel build error Screenshot_2023-07-29-21-25-41-076_com.github.android.jpg
I am unable to view the vercel build details, how do i check why my build is failing?
Screenshot from 2023-07-30 01-59-41

You can run npm run build will be the same error that you get

So I looked into this. The reason my build is failing is that I am adding another parameter to this function copyTailwindCodeToClipboard(attribute, outputElement); so now I need to add the second parameter in all the files which are calling this function.
This worked for all other files but when I go to input-range.ts file, this does not work because We are not returning a similar getOutput function here. So I need to make a few more changes in this file. Should I go ahead and make those changes?

@Dun-sin
Copy link
Owner

Dun-sin commented Jul 29, 2023

I have made the changes but I am facing some issues with the commit not being on the branch that I created. @Dun-sin can you help out?

I don't understand what you mean, I see the commit in this PR, the only problem is the vercel build error Screenshot_2023-07-29-21-25-41-076_com.github.android.jpg
I am unable to view the vercel build details, how do i check why my build is failing?
Screenshot from 2023-07-30 01-59-41

You can run npm run build will be the same error that you get

So I looked into this. The reason my build is failing is that I am adding another parameter to this function copyTailwindCodeToClipboard(attribute, outputElement); so now I need to add the second parameter in all the files which are calling this function.
This worked for all other files but when I go to input-range.ts file, this does not work because We are not returning a similar getOutput function here. So I need to make a few more changes in this file. Should I go ahead and make those changes?

You can make the second argument optional

@aqsaaqeel
Copy link
Contributor Author

@Dun-sin I've made the second parameter optional as you advised and the build is not breaking. Can you review?

Copy link
Owner

@Dun-sin Dun-sin left a comment

Choose a reason for hiding this comment

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

Looks good on the code end will check the preview, consider giving the project a starπŸ”₯

@Dun-sin
Copy link
Owner

Dun-sin commented Jul 30, 2023

It worksπŸ”₯

@Dun-sin Dun-sin merged commit 4d63fe2 into Dun-sin:main Jul 30, 2023
@Dun-sin
Copy link
Owner

Dun-sin commented Jul 30, 2023

πŸŽ‰ This PR is included in version 2.58.0 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

@aqsaaqeel
Copy link
Contributor Author

It worksπŸ”₯

Thank you @Dun-sin for helping out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add tailwind code for border radius generator

2 participants