Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
287 stars 76 forks source link

CSS Variable for text-area footer font-size #10484

Open tom12993 opened 1 week ago

tom12993 commented 1 week ago

Check existing issues

Description

I want to decouple the font-size of calcite-text-area's body and footer. Example: 14px for text-area body, and 12px for the footer text

Acceptance Criteria

Add --calcite-text-area-footer-font-size which will affect just the footer's font-size.

Relevant Info

No response

Which Component

calcite-text-area

Example Use Case

image

Priority impact

impact - p2 - want for an upcoming milestone

Calcite package

Esri team

ArcGIS Monitor

alisonailea commented 1 week ago

Can you describe a bit more about your use case for this?

tom12993 commented 1 week ago

@alisonailea I just want the footer font-size, including the character count, to be smaller than the text-area body. To achieve this same effect, we're currently setting the scale of calcite-text-area to s so the footer font-size can be 12px. And then we're using shadowRoot to modify the font-size of the body to 14px.

    const textArea = document.querySelector('calcite-text-area')
    if (textArea?.shadowRoot) {
      textArea.shadowRoot.innerHTML += `<style>textarea {font-size: var(--calcite-font-size--1) !important;}</style>`
    }