Skip to content

Conversation

jzempel
Copy link
Member

@jzempel jzempel commented Sep 24, 2024

Description

Follow-on from #1885 that rounds out color variable prop treatment for loaders.

Detail

Improves getColor to allow for inherit and currentcolor keywords in addition to transparent (which is already supported).

Checklist

  • 👌 design updates will be Garden Designer approved (add the designer as a reviewer)
  • 🌐 demo is up-to-date (npm start)
  • ⬅️ renders as expected with reversed (RTL) direction
  • ⚫ renders as expected in dark mode
  • 🤘 renders as expected with Bedrock CSS (?bedrock)
  • 💂‍♂️ includes new unit tests. Maintain existing coverage (always >= 96%)
  • tested for WCAG 2.1 AA accessibility compliance
  • 📝 tested in Chrome, Firefox, Safari, and Edge

}

const colorStyles = ({ theme, color }: IStyledInlineProps & ThemeProps<DefaultTheme>) => {
const options = color.includes('.') ? { variable: color, theme } : { hue: color, theme };
Copy link
Contributor

@ze-flo ze-flo Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To double-check, we do not support rgba colors (rgba(123,43,56, 0.5). Correct?

[update]: rgba shouldn't be supported.

return !!parseToRgba(maybeColor);
} catch {
return false;
let retVal = ['currentcolor', 'inherit', 'transparent'].includes(maybeColor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@jzempel jzempel merged commit 8e3f3fc into main Sep 24, 2024
8 checks passed
@jzempel jzempel deleted the jzempel/loader-color branch September 24, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants