Skip to content

Why is text not centered after changing button height? #4995

Answered by GollyJer
GollyJer asked this question in Q&A
Discussion options

You must be logged in to vote

Figured this out with trial and error.
Had to set the padding to zero for the centering to work. Then reset the left and right to what looks good.

The strange thing is I don't see any padding in the default button styling.

<Button
  _text={{ fontWeight: 800 }}
  variant="outline"
  colorScheme="secondary"
  o="0.8"
  h="8"
  p="0"
  pr="3"
  pl="2"
  leftIcon={<Icon as={MaterialCommunityIcons} name="plus" size="lg" />}
  onPress={() => openShowcaseDetailsScreen()}
>
  Add
</Button>

Is there a less verbose way?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by GollyJer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant