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

Align text styles with Symphony console? Or create new ones for additional features? #471

Open
dylan-robins opened this issue Jan 5, 2025 · 2 comments
Labels
question User questions

Comments

@dylan-robins
Copy link

As part of #440 I'm in need of text styles for error, warning, info and debug messages. Today, only error and info are defined. Considering Cleo is inspired by Symphony Console, I went to their docs to see what they implemented.

They have implemented the following default styles

symphony:
  success: "fg=black;bg=green"
  error: "fg=white;bg=red"
  warning: "fg=black;bg=yellow"
  note: "fg=yellow"
  info: "fg=green"
  caution: "fg=white;bg=red"

As you can see there are a few differences w.r.t. what is currently implemented in Cleo:

currently in Cleo:
  error: "fg=red;options=bold"  # Symphony has "fg=white;bg=red"
  info: "fg=blue"               # Symphony has "fg=green"
  comment: "fg=green"           # Symphony just prepends "//" without altering colour
  question: "fg=cyan"
  c1: "fg=cyan"
  c2: "fg=default;options=bold"
  b: "fg=default;options=bold"

Do we want to align Cleo with what Symphony is doing, or will that be too big of change for Poetry?

I'd still suggest adding corresponding styles in order to keep parity with them. I suggest the following

proposed for Cleo v3:
  success: "fg=green;options=bold"  # new, for parity with Symphony
  error: "fg=red;options=bold"
  warning: "fg=yellow;bg=bold"      # new, for parity with Symphony
  note: "fg=yellow"                 # new, for parity with Symphony
  info: "fg=blue"
  caution: "fg=white;bg=red"        # new, for parity with Symphony
  comment: "fg=green"
  question: "fg=cyan"
  debug: "fg=dark_gray"             # new, suggested for use with logging
  c1: "fg=cyan"
  c2: "fg=default;options=bold"
  b: "fg=default;options=bold"

Also, I get b being a useful shorthand for bold, but shouldn't c1 and c2 have some more descriptive names..?

Additionally, Symphony offer some interesting helper methods for creating titles, subtitles, bullet lists and various types of tables. cleo.ui currently only has the type of table, I can implement the others based on what Symphony propose if you'd like.

Shall I start working on these points and open a PR?

@Secrus
Copy link
Member

Secrus commented Jan 6, 2025

Let's just grab the missing styles from Poetry.

@Secrus Secrus added the question User questions label Jan 6, 2025
@dylan-robins
Copy link
Author

Huh, not sure why I never thought to look there lol. I'll open a PR

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

No branches or pull requests

2 participants