Expose styles as variables?
LitoMore opened this issue · 1 comments
LitoMore commented
A package I am maintaining chalk-pipe has a function to determine what type of style is passed in.
Currently Chalk only exposes the types of styles. But in my case, I want the variables.
https://github.com/LitoMore/chalk-pipe/blob/main/source/index.ts#L3-L23
Could we add some exports like this:
export const modifiers = ['rest', 'bold' , 'dim', ...];
export const colors = = ['black', 'red', 'green', ...];
Since we already documented which styles are supported in the readme. It's a good idea to expose these styles as variables.
sindresorhus commented
Makes sense to me. I think we should also expose foregroundColor
and backgroundColor
individually, like in the types.