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

Suggestion: (##) for setting element ID #93

Open
int3 opened this issue Jul 20, 2014 · 3 comments
Open

Suggestion: (##) for setting element ID #93

int3 opened this issue Jul 20, 2014 · 3 comments

Comments

@int3
Copy link

int3 commented Jul 20, 2014

I find it to be an operation at least as common as setting the CSS class. And (##) would be in obvious analogy to the CSS syntax plus the existing (#.) operator.

Suggestion 2, while I'm at it: Are you considering some sort of support for a templating system? Maybe heist, since threepenny already depends on snap...

@int3
Copy link
Author

int3 commented Jul 22, 2014

I know it's good practice to split out bugs into different issues, but in the interests of not spamming... here's one more suggestion: Could you expose str/int/emptyAttr? They seem like useful convenience functions.

@int3
Copy link
Author

int3 commented Jul 22, 2014

Suggestion 4: It should be possible to sink single CSS styles directly, rather than editing the entire CSS style list at once.

P.S. If you think any of these suggestions are good ideas I'd be happy to submit PRs for them once I'm done with my current project.

@HeinrichApfelmus
Copy link
Owner

  1. I'm not too keen on this. Due to issue The getElementsBy.. functions do not work with a custom HTML file #60, the id attribute is not as useful as it could be at the moment. For CSS, classes are probably preferred.
  2. I recognize the need to separate GUI layout from functionality, but I don't think that a simple template engine is the answer. In a sense, the Graphics.UI.Threepenny.Elements etc. modules form a template engine (with weird syntax, namely Haskell syntax). Concerning other solutions, I would very much prefer a WYSWIG program for building HTML GUIs.
  3. Not sure. Do you have a use case where they make your life more convenient? I think I prefer the full list of HTML attributes as given in the module, but I'm happy to be convinced otherwise. Note that attr is always available. (If these three functions are to be exported, I would give them other names, because I don't like the current ones.)
  4. If I remember correctly, the CSS style list behaves exactly the way you mention: it overwrites styles that are mentioned, but doesn't delete styles that occur in the list. Arguably, this behavior is weird, and I'm happy to see it fixed: a whole list that overrides everything and a facility to apply individual styles directly.

(Unfortunately, I won't have much time until October, so I may be very slow in accepting patches.)

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

No branches or pull requests

2 participants