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(pagination): add component tokens #11157

Merged
merged 16 commits into from
Jan 13, 2025

Conversation

aPreciado88
Copy link
Contributor

@aPreciado88 aPreciado88 commented Dec 28, 2024

Related Issue: #7180

Summary

Add pagination component tokens.

--calcite-pagination-spacing: Specifies the amount of left and right margin spacing between each item.
--calcite-pagination-size: Specifies the width of each item.
--calcite-pagination-color: Specifies the component's item color.
--calcite-pagination-color-hover: Specifies the component's item color when hovered or selected.
--calcite-pagination-color-border-hover: Specifies the component's item bottom border color when hovered.
--calcite-pagination-color-border-active: Specifies the component's item bottom border color when selected.
--calcite-pagination-background-color: Specifies the component's item background color when active.
--calcite-pagination-icon-color-background-hover: Specifies the component's chevron item background color when hovered.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Dec 28, 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.

Please refer to the token naming documentation for naming component tokens

* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-pagination-spacing: Specifies the amount of left and right margin spacing between each item.
* @prop --calcite-pagination-width: Specifies the width of each item.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be pagination-size

* @prop --calcite-pagination-width: Specifies the width of each item.
* @prop --calcite-pagination-color: Specifies the component's item color.
* @prop --calcite-pagination-selected-color-hover: Specifies the component's item color when hovered or selected.
* @prop --calcite-pagination-hover-bottom-border-color: Specifies the component's item bottom border color when hovered.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be --calcite-pagination-color-border-hover

* @prop --calcite-pagination-color: Specifies the component's item color.
* @prop --calcite-pagination-selected-color-hover: Specifies the component's item color when hovered or selected.
* @prop --calcite-pagination-hover-bottom-border-color: Specifies the component's item bottom border color when hovered.
* @prop --calcite-pagination-selected-bottom-border-color: Specifies the component's item bottom border color when selected.
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be --calcite-pagination-color-border-active

* @prop --calcite-pagination-selected-color-hover: Specifies the component's item color when hovered or selected.
* @prop --calcite-pagination-hover-bottom-border-color: Specifies the component's item bottom border color when hovered.
* @prop --calcite-pagination-selected-bottom-border-color: Specifies the component's item bottom border color when selected.
* @prop --calcite-pagination-active-background-color: Specifies the component's item background color when active.
Copy link
Contributor

Choose a reason for hiding this comment

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

--calcite-pagination-color-background-color

* @prop --calcite-pagination-hover-bottom-border-color: Specifies the component's item bottom border color when hovered.
* @prop --calcite-pagination-selected-bottom-border-color: Specifies the component's item bottom border color when selected.
* @prop --calcite-pagination-active-background-color: Specifies the component's item background color when active.
* @prop --calcite-pagination-hover-chevron-background-color: Specifies the component's chevron item background color when hovered.
Copy link
Contributor

Choose a reason for hiding this comment

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

--calcite-pagination-chevron-color-background-hover

* @prop --calcite-pagination-spacing: Specifies the amount of left and right margin spacing between each item.
* @prop --calcite-pagination-width: Specifies the width of each item.
* @prop --calcite-pagination-color: Specifies the component's item color.
* @prop --calcite-pagination-selected-color-hover: Specifies the component's item color when hovered or selected.
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be simplified down to --calcite-pagination-color-hover

@@ -21,7 +36,7 @@
& .page,
& .ellipsis {
@apply text-n2h h-6 px-1;
min-inline-size: theme("width.6");
--width: theme("width.6");
Copy link
Contributor

Choose a reason for hiding this comment

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

you should not assign tokens inside components unless they are -internal

@@ -30,7 +45,7 @@
& .page,
& .ellipsis {
@apply text-n1h h-8 px-2;
min-inline-size: theme("width.8");
--width: theme("width.8");
Copy link
Contributor

Choose a reason for hiding this comment

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

you should not assign tokens inside components unless they are -internal

@@ -39,7 +54,7 @@
& .page,
& .ellipsis {
@apply text-0h h-11;
min-inline-size: theme("width.11");
--width: theme("width.11");
Copy link
Contributor

Choose a reason for hiding this comment

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

you should not assign tokens inside components unless they are -internal

@aPreciado88
Copy link
Contributor Author

@alisonailea I'm having issues with some token e2e tests, could you please take a look?

@aPreciado88 aPreciado88 marked this pull request as ready for review January 4, 2025 00:50
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-pagination-spacing: Specifies the amount of left and right margin spacing between each item.
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @SkyeSeitz / @ashetland - What is the reason for allowing this gap to be customized? Seems like even for "low count" pagination, we'd want to maintain the spacing.

Similar q for "-size" - maybe not needed...

Choose a reason for hiding this comment

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

+1

@aPreciado88 aPreciado88 added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jan 13, 2025
* @prop --calcite-pagination-color-border-hover: Specifies the component's item bottom border color when hovered.
* @prop --calcite-pagination-color-border-active: Specifies the component's item bottom border color when selected.
* @prop --calcite-pagination-color-background: Specifies the component's item background color when active.
* @prop --calcite-pagination-chevron-color-background-hover: Specifies the component's chevron item background color when hovered.
Copy link
Contributor

Choose a reason for hiding this comment

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

Mostly name questions here - cc @SkyeSeitz @alisonailea

Should this be icon-color or another name to follow a different pattern? Not sure if we have used "chevron" before.

* @prop --calcite-pagination-color-hover: Specifies the component's item color when hovered or selected.
* @prop --calcite-pagination-color-border-hover: Specifies the component's item bottom border color when hovered.
* @prop --calcite-pagination-color-border-active: Specifies the component's item bottom border color when selected.
* @prop --calcite-pagination-color-background: Specifies the component's item background color when active.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "background-color" to match other components?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes I agree. Thanks for the catch Adam

@aPreciado88 aPreciado88 removed the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jan 13, 2025
@aPreciado88 aPreciado88 added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jan 13, 2025
@aPreciado88
Copy link
Contributor Author

@ashetland @SkyeSeitz It looks like these are the usual false positive screenshots. Can you please confirm?

@ashetland
Copy link
Contributor

Yep, all false positives.

@aPreciado88 aPreciado88 merged commit f3973c8 into dev Jan 13, 2025
16 checks passed
@aPreciado88 aPreciado88 deleted the aPreciado88/7180-add-pagination-design-tokens branch January 13, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants