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

font-weight / fw value unit is pixels in transpilation #1

Closed
cfuendev opened this issue Jan 29, 2023 · 3 comments
Closed

font-weight / fw value unit is pixels in transpilation #1

cfuendev opened this issue Jan 29, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@cfuendev
Copy link
Owner

While recreating some Chakra UI components from scratch to test the usability of the library, I came across this:

As you can see, since in my ignorance I made the macro turn any default values to px (Not only uses the wrong unit, but is also short-sighted), the value of font-weight is appended the "px" unit, which shouldn't happen because font-weight is just a number, not a size unit.

I will see if I can make this transpile step (Because it is a very specific step built into the macro) only apply to values related to units. Besides, I need to fix that pixels shouldn't be the default replaced value.

@cfuendev cfuendev self-assigned this Jan 29, 2023
@cfuendev cfuendev added the bug Something isn't working label Jan 29, 2023
@cfuendev
Copy link
Owner Author

cfuendev commented Feb 1, 2023

1/2/2023: Working on a fix rn. Hope to release it today!

3/2/2023: Well, that didn't go well lol. I lied, I had some other things keeping me busy so today I started debugging. Turns out that Imba uses 0.25rem as their default unit. Thet tasks would go as following:

  • Make it so that, when no unit is specified, values are parsed to ${value*0.25}rem.
  • Do not perform this transformation on font-weight / fw.

@cfuendev
Copy link
Owner Author

cfuendev commented Feb 3, 2023

image

You'd be surprised of the wonders that a single piece of sweet bread and a Coronita do while coding. The first line had px:4 as the input that resulted in padding-left: 1rem and padding-right: 1rem, while the last line is the code that I was writing when I found this bug, which now works properly, resulting in font-weight:600 point blank.

Fixed. Will publish the patch shortly!

cfuendev added a commit that referenced this issue Feb 3, 2023
@cfuendev
Copy link
Owner Author

cfuendev commented Feb 3, 2023

2279e72 fixed the problem
And the fixed npm package has been published as 0.3.1

@cfuendev cfuendev closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant