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

Hint cssClass #2453

Closed
andretchen0 opened this issue Jul 28, 2023 · 0 comments
Closed

Hint cssClass #2453

andretchen0 opened this issue Jul 28, 2023 · 0 comments
Labels
coding This issue requires some programming visuals Various things that easily catch the eye
Milestone

Comments

@andretchen0
Copy link
Contributor

andretchen0 commented Jul 28, 2023

There seems to be a disconnect between the way hint is called and how it works internally.

Signature: hint(text, cssClass)

It's probably due to a bad argument name that folks started applying quasi-CSS classes here. But hint doesn't work like that:

Screenshot 2023-07-28 at 20 16 06 copy
  • The top "hint" is called with hint('20', 'healing d20') – taken from code currently in the codebase.
  • The bottom "hint" is called with hint('20', 'healing') – invented, but it seems to do the right thing, i.e., make the text green.

The cssClass argument doesn't represent a real CSS class, but just a string that the hint internals use as a key in a {key:{fill:number, stroke:number}}. healing is a key in that Object, but healing d20 is not.

Options

  1. Don't fix. Leave as-is.
  2. Implement some CSS-ish behavior, to match the argument name and current callers.
  3. Split the cssClass on spaces and Object.assign to the style where the substrings match a key.
  4. Fix the hint callers so that they just pass, e.g., healing, instead of healing d20.

I'd lean towards 1 – since perhaps current behavior is the desired behavior – or 4.

2 and 3 are both possible, but more complicated than necessary for current usage.

I'll rename the argument in any case, unless the behavior ends up matching CSS classnames.

@DreadKnight DreadKnight added coding This issue requires some programming visuals Various things that easily catch the eye labels Jul 29, 2023
@DreadKnight DreadKnight added this to the 0.5 - Chimera milestone Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coding This issue requires some programming visuals Various things that easily catch the eye
Projects
None yet
Development

No branches or pull requests

2 participants