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

CSSProperties no LeftUnionType, TopUnionType, etc #161

Open
aeromac opened this issue Feb 2, 2024 · 4 comments
Open

CSSProperties no LeftUnionType, TopUnionType, etc #161

aeromac opened this issue Feb 2, 2024 · 4 comments

Comments

@aeromac
Copy link

aeromac commented Feb 2, 2024

Hi, I was just wondering why properties such as Width use types such as WidthUnionType which allows setting a double or String, however, Left does not have a similar type and is instead declared as a String type.

Thank you

@zbynek
Copy link
Contributor

zbynek commented Feb 20, 2024

Elemental takes these from Closure (specifically https://github.com/google/closure-compiler/blob/e6957b2a68b522a2483ab268cd835b8c706aca36/externs/browser/w3c_css.js#L1734 is a string and other properties are number|string, which gets converted to *UnionType when generating the Java code). This changed in google/closure-compiler@7bd7987 , but I couldn't find any more info. You can ask the Closure community 🤷

@jDramaix
Copy link
Member

This is to avoid bugs. Although it's valid to assign 0 to element.style.left/right/top/bottom, any other numbers without units are silently ignored.

@jDramaix
Copy link
Member

jDramaix commented Feb 27, 2024

And I think they should do the same for others properties with unit, but it may break too many internal code.

@jDramaix jDramaix reopened this Feb 27, 2024
@jDramaix
Copy link
Member

Reopening the issue, the Closure extern file could could be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants