spectrum-css icon indicating copy to clipboard operation
spectrum-css copied to clipboard

Set font-family on Button based on 'lang' attribute

Open ktabors opened this issue 5 years ago • 2 comments

Description

When a spectrum-css user sets a lang attribute it changes the font-family in :root, which is great. The following components set the 'font-family on themselves, not inherit, to avoid unexpected fonts in weird contexts,' accordion, button, checkbox, commons, menu, radio, textfield, and typography. This causes issues because the button family is more specific than what is set at :rootvia lang.

Possible solution is for these components, 'feature request to set font-family correctly on Button and friends when [lang] is set.'

Additional context

Buttons setting font family https://github.com/adobe/spectrum-css/blob/main/components/button/index.css#L63 Font family set in :root https://github.com/adobe/spectrum-css/blob/main/components/commons/fonts.css

spectrum button

The Slack conversation leading to this issue. https://dxexperience-team.slack.com/archives/C5N154FEY/p1603147326044300

Associated Issues

https://git.corp.adobe.com/React/react-spectrum-v2/issues/624 https://github.com/adobe/react-spectrum/issues/1094

ktabors avatar Oct 21 '20 22:10 ktabors

I'm looking back at the original conversation in Slack and I'm not seeing guidance on how to fix this. Is there availability to suggest a fix or work on this?

ktabors avatar May 06 '21 18:05 ktabors

Possible solution - we have a lang attribute as part of the selector for font-family only

ktabors avatar May 11 '21 19:05 ktabors

Font-family is no longer set on button at all and it instead inherits the appropriate font-family; closing this out but please reopen if you feel this has not been addressed.

castastrophe avatar Mar 25 '24 13:03 castastrophe