Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tokens] Implement a --calcite-color-focus global variable across the design system #10510

Closed
5 of 8 tasks
Tracked by #7180
COV-GIS opened this issue Oct 9, 2024 · 4 comments
Closed
5 of 8 tasks
Tracked by #7180
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. calcite-components Issues specific to the @esri/calcite-components package. design-tokens Issues requiring design tokens. docs Issues relating to documentation updates only. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. has workaround Issues have a workaround available in the meantime. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - medium Issue is non core or affecting less that 60% of people using the library

Comments

@COV-GIS
Copy link

COV-GIS commented Oct 9, 2024

Check existing issues

Description

Provide a global token/CSS variable that enables designers and developers to set the focus color, which could be named --calcite-color-focus.

The above is currently achievable via the deprecated --calcite-ui-focus-color CSS variable, but its usage doesn't apply to the use case, Calcite should instead opt to provide support for focus and brand color variables.

Workaround example with --calcite-ui-focus-color (Note: this is a deprecated CSS variable): https://codepen.io/geospatialem/pen/poMNgbO

Acceptance Criteria

  • Allow developers to use a global --calcite-color-focus token that allows customization of the focus in apps.
    • For instance, support Button's focus color to match button color when kind is danger

Relevant Info

No response

Which Component

Across components

Example Use Case

Allow developers to use a global --calcite-color-focus token that allows customization of the focus in apps. For instance, support Button's focus color to match button color when kind is danger.

Priority impact

impact - p3 - not time sensitive

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

N/A

@COV-GIS COV-GIS added 0 - new New issues that need assignment. enhancement Issues tied to a new feature or request. needs triage Planning workflow - pending design/dev review. labels Oct 9, 2024
@github-actions github-actions bot added calcite-components Issues specific to the @esri/calcite-components package. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Oct 9, 2024
@geospatialem geospatialem added the docs Issues relating to documentation updates only. label Oct 9, 2024
@geospatialem
Copy link
Member

geospatialem commented Oct 9, 2024

@COV-GIS This is currently achievable using the deprecated --calcite-ui-focus-color CSS variable when specifying the kind attribute or providing a class selector, for instance: https://codepen.io/geospatialem/pen/poMNgbO

calcite-button[kind="danger"] {
  --calcite-ui-focus-color:var(--calcite-color-status-danger);
}

With the above in mind we will work towards a more streamlined implementation using a new CSS variable/token of --calcite-color-focus and provide additional documentation in the future. Will be updating the title and scope, as we do not plan to provide specific support on component's kind attr/prop, as it would be up to developers to achieve.

cc: @alisonailea @brittneytewks

@geospatialem geospatialem added the design-tokens Issues requiring design tokens. label Oct 9, 2024
@geospatialem geospatialem changed the title Button: focus color when kind danger [Tokens] Implement a --calcite-color-focus global variable across the design system Oct 9, 2024
@geospatialem geospatialem added p - medium Issue is non core or affecting less that 60% of people using the library estimate - 3 A day or two of work, likely requires updates to tests. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. has workaround Issues have a workaround available in the meantime. and removed needs triage Planning workflow - pending design/dev review. labels Oct 9, 2024
@geospatialem geospatialem added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Oct 9, 2024
@geospatialem geospatialem removed the needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. label Oct 9, 2024
alisonailea added a commit that referenced this issue Oct 30, 2024
**Related Issue:** #7180 #10510

## Summary

This adds `calcite-color-focus` to replace the deprecated
`calcite-ui-focus-color`
@alisonailea alisonailea added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Oct 30, 2024
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned alisonailea Oct 30, 2024
Copy link
Contributor

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Oct 30, 2024
@geospatialem
Copy link
Member

Verified with Chromatic via https://codepen.io/geospatialem/pen/MWNGoey using the new --calcite-color-focus global token/CSS variable.

@COV-GIS
Copy link
Author

COV-GIS commented Oct 30, 2024

Awesome! Thanks folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. calcite-components Issues specific to the @esri/calcite-components package. design-tokens Issues requiring design tokens. docs Issues relating to documentation updates only. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. has workaround Issues have a workaround available in the meantime. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - medium Issue is non core or affecting less that 60% of people using the library
Projects
None yet
Development

No branches or pull requests

4 participants