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

What needs to be done here? #1

Open
malte-v opened this issue Feb 22, 2020 · 2 comments
Open

What needs to be done here? #1

malte-v opened this issue Feb 22, 2020 · 2 comments

Comments

@malte-v
Copy link

malte-v commented Feb 22, 2020

This seems to be working really well, but only for a very limited set of properties. Is there anything that needs to be done besides adding the remaining CSS data types and completing the Style enum? For example, is there any chance to make the 1"em" thing look less awkward? Thanks!

@richard-uk1
Copy link
Owner

The 1"em" problem is that as soon as the lexer sees an e after a number, it thinks it's shorthand for a float in standard form e.g. 1.34e32. See this feature request.

Otherwise it's just a case of implementing all the properties. I was implementing them as I needed them. I think I've handled a lot of the more fiddly ones, but yeah it's not complete yet. There is also the issue of other properties not covered by my selection strategy (candidate recommendation and above), and also the inherit et. al. property values. And finally there is the issue of deciding exactly how they render. I want to support

  1. Where the properties are all static, render ahead-of-time into a static string.
  2. Into a string on the heap at runtime
  3. Into a string in a bump arena, so it works well with dodrio
  4. Into the AST, so that styles can be handled however the crate user wants.

I still need to support all these cases. This also means that I need an easy way for the user to create property values (and possibly whole properties) with a macro. I've started this work, but there's a lot to do.

@richard-uk1
Copy link
Owner

If you're interested this library is actually in use on the internet here: https://scrumbles.uk/

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

2 participants