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

feat(handle): add component tokens #8780

Conversation

Elijbet
Copy link
Contributor

@Elijbet Elijbet commented Feb 19, 2024

Related Issue: #7180

Summary

Adds the following component tokens:

--calcite-handle-text-color
--calcite-handle-text-color-hover
--calcite-handle-text-color-focus
--calcite-handle-text-color-selected

--calcite-handle-background-color
--calcite-handle-background-color-hover
--calcite-handle-background-color-focus
--calcite-handle-background-color-selected

@Elijbet Elijbet changed the title Elijbet/7180 add component tokens for handle feat(handle): add component tokens Feb 19, 2024
@Elijbet Elijbet marked this pull request as draft February 19, 2024 23:41
@alisonailea alisonailea changed the base branch from main to epic/7180-component-tokens February 20, 2024 21:49
@Elijbet Elijbet marked this pull request as ready for review February 21, 2024 18:01
@Elijbet Elijbet added design-tokens Issues requiring design tokens. pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Feb 21, 2024
Copy link
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

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

Move custom props to host and style based on the host state if you can.

@driskull
Copy link
Member

Would be nice to have a story that applies these vars for test coverage.

@Elijbet Elijbet force-pushed the elijbet/7180-add-component-tokens-for-handle branch 2 times, most recently from e7fe8de to 33491b2 Compare February 21, 2024 22:57
@Elijbet Elijbet marked this pull request as draft February 22, 2024 18:36
@Elijbet Elijbet marked this pull request as ready for review February 22, 2024 19:49
@Elijbet Elijbet added skip visual snapshots Pull requests that do not need visual regression testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Feb 25, 2024
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

Awesome stuff, @Elijbet! One more round of changes and I think this will be good to land. 🛬

@@ -23,16 +54,23 @@
:host(:not([disabled])) .handle {
@apply cursor-move;
&:hover {
@apply bg-foreground-2 text-color-1;
color: var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));
background-color: var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2));
}
&:focus {
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR, but I think the :focus block can be moved outside of the parent block since :focus doesn't apply when components are disabled.


export const focused_TestOnly = (): string => html` <calcite-handle focused></calcite-handle> `;

export const themedStates_TestOnly = (): string => html`
Copy link
Member

Choose a reason for hiding this comment

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

✨🏆✨

Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘
🤘🎸🎸🎸🎸🤘🎸🤘🤘🤘🤘🤘🎸🤘🎸🎸🎸🎸🤘🤘🎸🎸🎸🤘🤘🎸🎸🤘🤘🎸🤘🤘🤘🎸🤘🎸🎸🎸🎸🤘🎸🤘
🤘🎸🤘🤘🎸🤘🎸🤘🤘🤘🤘🤘🎸🤘🎸🤘🤘🤘🤘🎸🤘🤘🤘🤘🎸🤘🤘🎸🤘🎸🎸🤘🎸🎸🤘🎸🤘🤘🤘🤘🎸🤘
🤘🎸🎸🎸🎸🤘🎸🤘🤘🎸🤘🤘🎸🤘🎸🎸🎸🤘🤘🤘🎸🎸🤘🤘🎸🤘🤘🎸🤘🎸🤘🎸🤘🎸🤘🎸🎸🎸🤘🤘🎸🤘
🤘🎸🤘🤘🎸🤘🎸🤘🎸🤘🎸🤘🎸🤘🎸🤘🤘🤘🤘🤘🤘🤘🎸🤘🎸🤘🤘🎸🤘🎸🤘🤘🤘🎸🤘🎸🤘🤘🤘🤘🤘🤘
🤘🎸🤘🤘🎸🤘🤘🎸🤘🤘🤘🎸🤘🤘🎸🎸🎸🎸🤘🎸🎸🎸🤘🤘🤘🎸🎸🤘🤘🎸🤘🤘🤘🎸🤘🎸🎸🎸🎸🤘🎸🤘
🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘🤘

@jcfranco
Copy link
Member

@alisonailea Would you mind giving this a quick glance? 👀

Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

🎉

* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-handle-icon-color: Specifies the icon color of the component.
* @prop --calcite-handle-icon-color-hover: Specifies the icon color of the component when in hover state.
Copy link
Member

Choose a reason for hiding this comment

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

question: do we prefer the term hover state or hovered? cc @geospatialem

Should this be worded like defines the color of an icon sub-component when hovered inside the component.

Thats how i've seen these worded in other PRs. I guess we'll probably need to do some cleanup/consistency doc checks before we merge the "real" PR?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can check the epic PR every so often and fix any inconsistencies in wording/description?

Copy link
Member

Choose a reason for hiding this comment

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

question: do we prefer the term hover state or hovered? cc @geospatialem

Should this be worded like defines the color of an icon sub-component when hovered inside the component.

Great question. The sentence reads a bit weird when coupled with "when hovered". WDYT about another option altogether, and something like "on hover"? For instance:

Specifies the component's icon color on hover.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the simplicity of that phrasing.

@Elijbet Elijbet merged commit 2a0be81 into epic/7180-component-tokens Mar 1, 2024
5 checks passed
@Elijbet Elijbet deleted the elijbet/7180-add-component-tokens-for-handle branch March 1, 2024 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-tokens Issues requiring design tokens. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants