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

Allow border to be optional. #84

Closed
roydukkey opened this issue Feb 25, 2023 · 2 comments · Fixed by #88
Closed

Allow border to be optional. #84

roydukkey opened this issue Feb 25, 2023 · 2 comments · Fixed by #88
Assignees

Comments

@roydukkey
Copy link
Contributor

This tool has a lot of great features for creating boxes, and some of those features would be nice on their own. For instance, fullscreen would be great in some cases even without a border.

My use case, however, incorporates boxen into another utility. In order to achieve "no border", I have given boxen a "ghost border" which I strip after boxen's done working.

borderStyle: {
	topLeft: ' ',
	topRight: ' ',
	bottomLeft: ' ',
	bottomRight: ' ',
	top: ' ',
	bottom: ' ',
	left: ' ',
	right: ' '
}
@Caesarovich Caesarovich self-assigned this Apr 22, 2023
Caesarovich added a commit to Caesarovich/boxen that referenced this issue Apr 22, 2023
@roydukkey
Copy link
Contributor Author

roydukkey commented May 9, 2023

@sindresorhus @Caesarovich

#88 is a good step forward, but I'm not sure it fully completes this issue.

// boxen@7.1.0
const result = boxen('toxic', { borderStyle: 'none', padding: 0, margin: 0 });
console.log(result.split('\n'));
//=> [ '', 'toxic', '' ]

When borderStyle = 'none'...

  1. ...lines should only prepend text, when a padding, margin, or title are specified.
  2. ...blank lines should append the text, when padding, margin, or height are specified.

Thoughts?

@roydukkey
Copy link
Contributor Author

roydukkey commented May 9, 2023

Similarly, width doesn't seem to behave properly either.

const text = 'toxic';
const result = boxen(text, { borderStyle: 'none', width: text.length });
console.log(result.split('\n'));
//=> [ '', 'tox', 'ic, '' ]

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

Successfully merging a pull request may close this issue.

2 participants