iou90 / react-native-autoheight-webview

An auto height webview for React Native
ISC License
492 stars 162 forks source link

Apply styles that come from the html #205

Closed petkovv closed 3 years ago

petkovv commented 3 years ago

Hey guys. First I want to say that I have searched for a couple of hours for a solution to my issue but with no success. So what I want to achieve is for example if I have html text that looks like this:

<div>
   <h2>Some title</h2>
   <p>Here some <span style="font-size: 22px;">very very</span> long text is available</p>   
   <p 
               style="
               background-color:#f9f9f9;
                margin-top: 0; 
                padding-bottom: 8.28;
                 padding-top: 8.28;
                  padding-left: 4.14;
                   margin-left: -16.56; 
                   width: 405.72;"
                   >
                   <span style="font-size: 16.099999999999998;" >HEY THERE</span>
                    </p>
</div>

I want the elements which have styles applied to them to appear with the correct styles, but I couldn't find a way to do that. Is it even possible or it can not be achieved? Thanks in advance and if there is something unclear in my question I will give more details. :)

iou90 commented 3 years ago

I think there are no "sizing units" just like "px"/"%"/"vh"... with your properties.

petkovv commented 3 years ago

Hey iou90 and thanks for the fast response :) . I have missed the units here in the example but in my real response the units are there. So should I understand that this functionality I need should come out of the box from the library and I should do nothing manually to enable it. Thanks again iou90. :)

iou90 commented 3 years ago

Yes, this lib only applies default styles to "body" by default.