0

do you know if it is possible to express the height of a specific LWC in %? I want to make it responsive, actually when I try to set an height like :

height: 100%

it seems that the attribute is ignored and the actual height is based on the child node's height

Here is an example:

   <template>

    <lightning-cardvariant="Narrow"style="height:100%;">
    //the component height is not 100%
    </lightning-card>

   </template>
4
  • 2
    Can you add the minimal required code to your question to understand your actual issue? – sanket kumar Jan 23 '20 at 9:04
  • edited the post – J.Dillinger Jan 23 '20 at 9:13
  • Also, when you say the attribute is ignored and the actual height is based on the child node's height, what does it mean? Can you add a screenshot to make it clear? – sanket kumar Jan 23 '20 at 9:28
  • Sure, I added two snapshot here link . In both snaps the height depends on how many child rows are shown, but I wish that the height is always 100% of the screen – J.Dillinger Jan 23 '20 at 9:38
2

I have made slight change to your code.

Check out this Playground LINK

Use height : 90vh i.e - 90% of viewport

2
  • Thank you it works! – J.Dillinger Jan 23 '20 at 10:09
  • Happy to help @J.Dillinger – Mohit Kulkarni Jan 23 '20 at 10:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.