google / ansicolor-dart

Apache License 2.0
104 stars 26 forks source link

Ability to nest styles #5

Open seaneagan opened 9 years ago

seaneagan commented 9 years ago

Currently when you try to nest styles it doesn't work because when a pen is done writing it resets all styles, not just its own. Here's one take on an API to do this:

https://github.com/sindresorhus/chalk#api

jtmcdole commented 4 years ago

I know I'm late on responding to these. I like the idea of storing a stack of "complete state" such that:

  1. down: bold + red + green background
  2. down: bold + blue background
  3. up

Would see only having the blue background removed and green background restored at step-3