Skip to content

bug: ion-textarea custom style not working for help or count #3112

Closed

Description

@NektariaMoka

Describe the Bug

Based on ionic documentation we can access and change the attributes of count and error .
https://ionicframework.com/docs/api/textarea

Below is a demo to change the size and color.

https://stackblitz.com/edit/angular-dhulrr-hexdmn?file=src%2Fapp%2Fexample.component.css,src%2Fapp%2Fexample.component.html

Expected Behavior

`ion-textarea.custom {
--background: #373737;
--color: #fff;
--padding-end: 10px;
--padding-start: 10px;
--placeholder-color: #ddd;
--placeholder-opacity: 0.8;
}

ion-textarea.custom .helper-text,
ion-textarea.custom .counter {
color: red !important;
font-size: 24px !important;
}`

Is expected to change the the style of helper and counter

Steps to Reproduce

Latest stackblitz from ionic documentation

Screenshots

image

Operating System

windows

Browser

firefox, chrome

Version

No response

Additional Information

No response

Activity

  1. self-assigned this
    on Sep 12, 2023
  2. mapsandapps commented on Sep 12, 2023

    @mapsandapps
    Contributor

    Hi, thank you for the report! I can see that this example in the docs is not working in Angular. Angular encapsulation is preventing the helper-text class from getting the styles applied to it. You can fix this in the Stackblitz by moving

    ion-textarea.custom .helper-text,
    ion-textarea.custom .counter {
      color: red !important;
      font-size: 24px !important;
    }
    

    into the global.css file.

    We need to update the docs to address this and also change the specificity to remove the requirement of !important.

  3. added
    contentIssues related to the contents of the documentation website
    on Sep 12, 2023
  4. removed their assignment
    on Sep 12, 2023
  5. liamdebeasi commented on Oct 17, 2023

    @liamdebeasi
    Contributor

    Thanks for reporting this! This is fixed in #3199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentIssues related to the contents of the documentation website

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions