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

Center Text #1112

Open
shanewmurphy opened this issue Nov 1, 2022 · 6 comments
Open

Center Text #1112

shanewmurphy opened this issue Nov 1, 2022 · 6 comments

Comments

@shanewmurphy
Copy link

Is there any way to center Text??

@azuline
Copy link

azuline commented Nov 1, 2022

can you help me center a div too

@shanewmurphy
Copy link
Author

@azuline don't know if you're messing with me or not. I'm using NextUI.org for Next js project, NextUI uses Stitches as a style engine. I'm used to styling elements with CSS. With Stitches, to my mind, you jump through any loops just get to basic styling applied.

Center a div
width: 90% margin: 0 auto;
Will center a div

To center Text with Stitches best wrap components in a div and try to center things that way. Trying to center H1, H2 with CSS{{Align: "center"}} doesn't work

@azuline
Copy link

azuline commented Nov 1, 2022

hehe sorry i was

Do you know if this is a NextUI problem or a Stitches problem? Or a CSS problem? If it's the former, asking in NextUI support might produce better results.

In the event it's a CSS problem, have you tried textAlign: "center"?

@shanewmurphy
Copy link
Author

I'm centered text with CSS. Nope textAlign: "center will not work with H1, H2, H3 etc

@azuline
Copy link

azuline commented Nov 1, 2022

Seems to work in normal HTML/CSS?

image

I'm not fully understanding the problem, but this seems like a problem you're have with styling NextUI (which happens to use Stitches) rather than Stitches specifically?

@jrgarciadev
Copy link

jrgarciadev commented Nov 10, 2022

Hey @shanewmurphy here's you have an example https://codesandbox.io/s/centered-text-5ihr6t?file=/App.js, hope it helps you

This issue can be closed

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

3 participants