style-guide icon indicating copy to clipboard operation
style-guide copied to clipboard

Flexible width option for text container

Open seahindeniz opened this issue 4 years ago • 1 comments

Flex and Text components has no flexibility options for complying of it's parent element's width.

Issue image

Expected image

Can style-guide have more flexible containers that inherit of its parents width? Something like in this example https://codepen.io/seahindeniz/pen/jOPjBJv

<Flex direction="column" className="sg-flex--fit-content">
  <Flex marginBottom="m">
    <Text>This box generates the width</Text>
  </Flex>
  <Flex>
    <Flex className="sg-flex--grow sg-flex--min-content">
      <Text>
        This box should not generate width for its content size and needs to
        comply the width of its parents or previous elements width. Lorem ipsum
        dolor sit amet, consectetur adipiscing elit. Fusce quis elit dui. Donec
        tincidunt velit at justo congue suscipit.
    </Text>
    </Flex>
  </Flex>
</Flex>

seahindeniz avatar Apr 05 '20 08:04 seahindeniz

Hi @seahindeniz . Thanks for suggesting this.

@coderitual This might be nice addition to Flex component. We have a similar example in Input with an error message so we could use this to remove additional classes there. What's your opinion?

clxandstuff avatar Mar 20 '23 16:03 clxandstuff