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(card): Add component tokens #8605

Merged

Conversation

macandcheese
Copy link
Contributor

@macandcheese macandcheese commented Jan 13, 2024

Related Issue: #7180

Summary

Adds the following public component css properties:
--calcite-card-background-color: Specifies the background color of the component.
--calcite-card-border-color: Specifies the border color of the component.
--calcite-card-box-shadow: Specifies the box shadow of the component.
--calcite-card-corner-radius: Specifies the corner radius of the component.

Adds a Chromatic test and a demo page example. Also replaces broken image links in local demo.

@macandcheese macandcheese requested a review from a team as a code owner January 13, 2024 01:51
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 13, 2024
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 17, 2024
* @prop --calcite-card-border-color: Specifies the border color of the component.
* @prop --calcite-card-box-shadow: Specifies the box shadow of the component.
* @prop --calcite-card-corner-radius: Specifies the corner radius of the component.
* @prop --calcite-card-subtitle-color: Specifies the color of the component's `"subtitle"` slot.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Places we accept both a prop and a slot, it could make sense to have this. I could also see card having props in the future for title / subtitle, keeping the slot for more advanced cases, so maybe these are fine to leave.

Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jan 25, 2024
@macandcheese macandcheese removed the Stale Issues or pull requests that have not had recent activity. label Jan 25, 2024
Copy link
Contributor

github-actions bot commented Feb 6, 2024

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Feb 6, 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.

Looks good. Let's just remove the tokens for slotted content and allow those elements to style themselves.

* @prop --calcite-card-border-color: Specifies the border color of the component.
* @prop --calcite-card-box-shadow: Specifies the box shadow of the component.
* @prop --calcite-card-corner-radius: Specifies the corner radius of the component.
* @prop --calcite-card-subtitle-color: Specifies the color of the component's `"subtitle"` slot.
Copy link
Contributor

Choose a reason for hiding this comment

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

we should not create tokens for slotted elements.

packages/calcite-components/src/components/card/card.scss Outdated Show resolved Hide resolved
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Feb 9, 2024
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Feb 9, 2024
@macandcheese macandcheese removed the Stale Issues or pull requests that have not had recent activity. label Feb 9, 2024
@macandcheese
Copy link
Contributor Author

@alisonailea could you give this one another check after the last updates? Thanks!

@alisonailea
Copy link
Contributor

Looks good!

@macandcheese macandcheese merged commit 6950500 into epic/7180-component-tokens Feb 13, 2024
4 checks passed
@macandcheese macandcheese deleted the macandcheese/token-update-card branch February 13, 2024 01:03
Elijbet pushed a commit that referenced this pull request Feb 15, 2024
**Related Issue:** #7180 

## Summary

Adds the following public component css properties:
`--calcite-card-background-color`: Specifies the background color of the
component.
`--calcite-card-border-color`: Specifies the border color of the
component.
`--calcite-card-box-shadow`: Specifies the box shadow of the component.
`--calcite-card-corner-radius`: Specifies the corner radius of the
component.

Adds a Chromatic test and a demo page example. Also replaces broken
image links in local demo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants