consola icon indicating copy to clipboard operation
consola copied to clipboard

Using consola.box with colors in the body adds extra padding

Open TheDutchCoder opened this issue 1 year ago • 0 comments

Environment

Node: v20.13.0 OS: MacOS Sequoia 15 consola: 3.2.3

Reproduction

consola.box({
  title: ' RVezy Nuxt tools' ,
  message: ` Tools and commands for a better Developer Experience `,
  style: {
    padding: 1,
    borderColor: "cyan",
  },
});

// Outputs
// ╭─────────────────── RVezy Nuxt tools ─────────────────────╮
// │                                                          │
// │   Tools and commands for a better Developer Experience   │
// │                                                          │
// ╰──────────────────────────────────────────────────────────╯

However

consola.box({
  title: ` ${colors.blue('RVezy')} ${colors.cyan('Nuxt')} ${colors.blue('tools')} `,
  message: ` ${colors.blue('Tools')} and ${colors.blue('commands')} for a better Developer Experience`,
  style: {
    padding: 1,
    borderColor: "cyan",
  },
});

// Outputs
// ╭──────────────────────────── RVezy Nuxt tools ───────────────────────────────╮
// │                                                                             │
// │   Tools and commands for a better Developer Experience                      │
// │                                                                             │
// ╰─────────────────────────────────────────────────────────────────────────────╯

Describe the bug

When using colors in the body part of a box, it adds a lot of padding at the end.

Additional context

No response

Logs

No response

TheDutchCoder avatar Oct 11 '24 13:10 TheDutchCoder