-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Style customization #822
Comments
I'm open to extend the API to support something like this. Maybe you could suggest how the API could look like? |
As inquirer.registerStyle({
// Assign on top of default style (not changed remain as default)
question: chalk.bold.yellow,
answer: chalk.bold,
..
})
// All further prompts rely on that Internally, probably What do you think? |
Yeah I think I like that. Then we'd need to update our prompts to use I don't think an extra module is necessary? What would this module do? Encapsulate default styles and the way to extend it? Might be good to also unify everything like: {
colors: {
question: chalk.bold.yellow,
...
},
glyphs: {
questionPrefix: { default: '? ', windows: '? ' },
}
} There's been request to update the way we modify glyphs quite often too, so this might be a good occasion to unify everything under a styling interface. |
It might be more composable if a prefix (which may already have a custom styles applied by user) is kept out of enforced styling, e.g. in my case I want prefix to be in different style than question body, so if question style would be applied to it, I would need to add hack so it doesn't really apply.
I thought it'll be good if given prompts can just access given styles setup (without a need of injecting them as argument for every prompt creation). So my first thought was that e.g. here it can be: const style = require('@inquirer/style'); but technically we could also do: const { style } = require('@inquirer/core')
Currently, if I see correctly |
All the requests were about the question prefix specifically. But we could extend to things like lists characters, etc. |
Closing this old issue, there's a |
It'll be nice to be able to style the output, e.g. at serverless we'd love to resemble style to which we already accustomed our users, as e.g.:
Currently, it appears that without hacking of inquirer internals it's not possible to achieve.
The text was updated successfully, but these errors were encountered: