vmware-clarity / core

Clarity is a scalable, accessible, customizable, open-source design system built with web components. Works with any JavaScript framework, created for enterprises, and designed to be inclusive.
https://clarity.design
MIT License
161 stars 42 forks source link

Old CSS in `CdsButton` disallows changing letter spacing on small buttons #308

Open squidjam opened 2 months ago

squidjam commented 2 months ago

Describe the bug

A CSS style applied to the buttons when they are small makes it impossible to change the letter spacing when the button is set to a small size

How to reproduce

<cds-button size="sm" class="test">test</cds-button>
cds-button.test {letter-spacing: 10px}

Expected behavior

I should be able to use --letter-spacing to determine the letter spacing on the button regardless of the size it has.

Versions

Clarity project:

Clarity version:

Framework:

Framework version: N/A

Device:

Additional notes

Please go to: projects/core/src/button/button.element.scss and check lines 265-267.

:host([size='sm']) .private-host {
  --letter-spacing: 0.073em;
}

I don't think they should be there.