-
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(input): add mixin so it's easier to style and maintain similar components and parent components #8821
Conversation
…ve) component token
…s into astump/7180-input
// Set Defaults | ||
@if ($subcomponent == "") { | ||
:host { | ||
--calcite-#{$component}-corner-radius: var(--calcite-corner-radius); |
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.
This still doesn't solve the issue that if filter does the following:
calcite-input {
--calcite-input-corner-radius: var(--calcite-filter-input-corner-radius);
}
The input's corner radius will be set to undefined unless a user explicitly sets it.
Input would need to set a fallback for these values or filter, and any other component that uses input internally would either have to copy the default from input and add it as a fallback. IMO it makes more sense for the fallback to be in the component that is defining the token.
Related Issue: #7180
Summary
This hands-off input styles to a mixin to style input components.
@include input();
will result in all the styles currently found in #8594@include input('input-number', 'number');
will result in all the styles from above specific to the input-number component@include setInputTokens();
will add the input component tokens@include setInputTokens('filter', 'input');
will add the necessary styles to override the input component from the filter component.^ results in...