function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
IamSRNIamSRN 

Lightning Web Component Styling - Textarea

Hello,

I am facing this issue in many out of the box LWC components. I am trying to change the style of text area by defining a css class. But it is failing to override the slds style at run time? Any idea?
 
<template>
    <div class="row slds-m-vertical_large">
        <h2 class="header">Basic Examples</h2>
        <lightning-textarea 
        name="input1" 
        label="Enter some text"
        class="mytextarea">
        </lightning-textarea>
    </div>
</template>

.mytextarea{
    height: 150px;
}

You can find this live at : https://developer.salesforce.com/docs/component-library/tools/playground/QWa-zfwxW/1/edit

All Answers

Deepali KulshresthaDeepali Kulshrestha
Hi,
Greetings to you!

- 'mytextarea' class is for the label Enter Some Text, so when you add a CSS to that class the Enter Some Text area part will be changed.


User-added image

Please use the below link for further reference : - 
    - https://success.salesforce.com/answers?id=9063A000000plnTQAQ


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha.