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

Build a "Placeholder" widget #1200

Closed
willmcgugan opened this issue Nov 17, 2022 · 5 comments
Closed

Build a "Placeholder" widget #1200

willmcgugan opened this issue Nov 17, 2022 · 5 comments
Assignees

Comments

@willmcgugan
Copy link
Collaborator

willmcgugan commented Nov 17, 2022

We had a Placeholder widget which could be used to design a layout before you built a full widget. This use an older API.

We should refresh the placeholder idea, make it look nicer that the previous iteration, and add some features

  • Pick harmonious alternating colors, by mixing brackground with ~30% from this palette
  • Argument to select various modes: plain color, size and location, CSS, lorem ipsum text, etc
  • Add click handler to cycle between modes
@rodrigogiraoserrao rodrigogiraoserrao self-assigned this Nov 17, 2022
@rodrigogiraoserrao
Copy link
Contributor

rodrigogiraoserrao commented Nov 17, 2022

With the commit 83c8a9b we have the scaffolding for the widget Placeholder which:

  • has 5 3 different variants that display different things; and
  • cycles through the different variants when you click the placeholder.
  1. The "default" variant shows a solid colour (from the palette linked) that was associated to the placeholder upon instantiation.
  2. The "state" variant shows whether the placeholder has focus (or not) and whether the mouse is over the placeholder or not.
  3. The "size" variant shows the size of the placeholder.
  4. The "css" variant shows the CSS of the placeholder.
  5. The "text" variant shows some Lorem Ipsum text.

@rodrigogiraoserrao
Copy link
Contributor

Questions left unanswered:

  • Exactly how should each variant be styled by default?
  • Should the background colour (from the palette linked) be customisable?
  • Should the placeholders scroll if the content is too large? (E.g., the css variant tends to have lots of content that won't fit small placeholders.)

@rodrigogiraoserrao
Copy link
Contributor

After some discussion, the variants for state and CSS have been removed from consideration.
Thus, placeholders have 3 variants.

@rodrigogiraoserrao
Copy link
Contributor

Fixed with #1229.

@github-actions
Copy link

github-actions bot commented Dec 9, 2022

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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