-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat(block): add component tokens #8790
Conversation
* @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. |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)).
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. |
…onent-tokens-to-block
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.