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(block): add component tokens #8790

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Feb 20, 2024

Related Issue: #7180

Summary

Adds the following component tokens (CSS props):

  • --calcite-block-background-color
  • --calcite-block-border-color
  • --calcite-block-content-space
  • --calcite-block-description-text-color
  • --calcite-block-header-background-color-hover
  • --calcite-block-header-background-color
  • --calcite-block-heading-text-color-open
  • --calcite-block-heading-text-color
  • --calcite-block-text-color
  • --calcite-block-toggle-icon-color

Deprecates the following:

  • --calcite-block-padding

Note: added internal icon color token for upcoming icon prop.

* @prop --calcite-block-header-background-color: Specifies the background color of the component's header.
* @prop --calcite-block-heading-text-color: Specifies the text color of the component's heading.
* @prop --calcite-block-padding: **deprecated** use `--calcite-block-space` instead - Specifies the padding of the component's `default` slot.
* @prop --calcite-block-space: Specifies the space of the component's `default` slot.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think padding here is more descriptive - space is a bit ambiguous. Maybe calcite-block-content-padding ?

Copy link
Member

Choose a reason for hiding this comment

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

I think spacing makes more sense. That way we could internally swap between padding/margin/whatever if need be. Do we want to be specific with padding or margin?

Copy link
Member

Choose a reason for hiding this comment

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

We should decide on space vs spacing too :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, even content-space could make sense I guess. But space could be anything - space between text, slots, etc. In Modal we do use --calcite-modal-content-padding. In the future "content areas" could be ::parts with defaults.

Copy link
Member

Choose a reason for hiding this comment

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

We already have spacing vars like --calcite-spacing-xxs so it only makes sense to have component spacing vars like --calcite-block-spacing- IMO.

Copy link
Member

Choose a reason for hiding this comment

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

For Panel, we added calcite-panel-footer-space

Copy link
Contributor

Choose a reason for hiding this comment

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

calcite-block-content-space works for me. We can update elsewhere we currently use padding to follow this. As long as it has a context and isn't just component-space.

Copy link
Member Author

Choose a reason for hiding this comment

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

I knew this seemed familiar. We had a similar discussion in #8629 (comment) and landed on --calcite-tab-content-block-padding.

calcite-block-content-space works for me. We can update elsewhere we currently use padding to follow this. As long as it has a context and isn't just component-space.

SGTM, but I'd like for @alisonailea to chime on this too. If we needed separate props later on for block/inline values, would we introduce --calcite-component-space-<block|inline>? If so, we could add an example of this in our component token guidelines.

We should decide on space vs spacing too :)

We decided on space to align with size (vs. sizing).

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that our design system is not necessarily web specific, we need to use platform agnostic naming conventions. space is the preferred terminology here.

Copy link
Member Author

Choose a reason for hiding this comment

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

For posterity, if we need custom space props that only apply horizontally or vertically, we can use something like --calcite-component-<part>-space-<x|y> (see #8852 (comment)).

@jcfranco jcfranco added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Feb 21, 2024
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 Feb 29, 2024
@jcfranco jcfranco 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. Stale Issues or pull requests that have not had recent activity. labels Mar 1, 2024
@jcfranco jcfranco 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 Mar 2, 2024
@jcfranco jcfranco 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 Mar 2, 2024
@jcfranco jcfranco 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 Mar 2, 2024
@jcfranco jcfranco 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 Mar 2, 2024
@jcfranco jcfranco 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 Mar 4, 2024
@jcfranco jcfranco 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 Mar 4, 2024
@jcfranco jcfranco merged commit 2a6cbc1 into epic/7180-component-tokens Mar 5, 2024
8 checks passed
@jcfranco jcfranco deleted the jcfranco/7180-add-component-tokens-to-block branch March 5, 2024 18:18
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