-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Bugfix - Fixes in CSS generation - "sketch_css" #29
Bugfix - Fixes in CSS generation - "sketch_css" #29
Conversation
fn size_to_string(value) { | ||
fn size_to_string(size: String) -> String { | ||
case size { | ||
"percent" -> "%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a better way to do that, since the name of the size function is "percent" and the value for the size variable comes from the AST
fn size_to_string(size: String) -> String { | ||
case size { | ||
"percent" -> "%" | ||
_ -> size | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could do something like this, but your version is fine. 🙂
fn size_to_string(size: String) -> String { | |
case size { | |
"percent" -> "%" | |
_ -> size | |
} | |
} | |
fn size_to_string(size: String) -> String { | |
use <- bool.guard(when: size == "percent", return: "%") | |
size | |
} |
Thanks for your PR! I see you're still pushing some fixes, do you think you have additional fixes to do, or is it OK as is? |
I think it's OK, those are the only issues I've stumbled upon. The rest of the library is working great! |
Thank you! |
This PR fixes 3 issues with CSS generation using "sketch_css":
z_index(100)
was generated with the property namez_index
instead ofz-index
.opacity(1.0)
generated asopacity: ;
.width(percent(100))
being generated aswidth: 100percent
instead ofwidth: 100%
.