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

Extend backgroundColor to under the border #44

Closed
Zireael opened this issue Oct 12, 2019 · 3 comments
Closed

Extend backgroundColor to under the border #44

Zireael opened this issue Oct 12, 2019 · 3 comments

Comments

@Zireael
Copy link

Zireael commented Oct 12, 2019

Hi, when I specify the backgroundColor, it is applied only immediately just under the thext inside the box. But then there is a black moat between the text and the border, like this:
image

To achieve something like this:
image

This is under Windows cmd terminal, so maybe the background gets rendered better in other terminals. Also, I suspect putting bacground to fill inside of the box might not be possible as adding background color to border glyphs would spill that colour to outside the box as well?

Lastly, I know this is not core functionality of boxen, but consider adding a simple option to change text color. Can be achieved with Chalk etc, but for anyone needing a one dependency solution this might be enough..

const boxen = require("boxen");
const color = require("chalk");
console.log(
  boxen(color.hex("#07171d")("this is some text"), {
    margin: { top: 1, right: 0, bottom: 1, left: 2 },
    padding: { top: 0, right: 2, bottom: 0, left: 2 },
    borderColor: "#e29578",
    backgroundColor: "#e0f0f5",
    borderStyle: "double",
  })
);
@sindresorhus
Copy link
Owner

Also, I suspect putting bacground to fill inside of the box might not be possible as adding background color to border glyphs would spill that colour to outside the box as well?

Correct.

but consider adding a simple option to change text color.

Sure, I agree that could be useful.

@sindresorhus
Copy link
Owner

The background looks better on iTerm on macOS:

Screenshot 2020-02-12 at 19 51 57

@sindresorhus
Copy link
Owner

I would recommend trying out https://github.com/microsoft/terminal. It might look better there.

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

No branches or pull requests

2 participants