-
Notifications
You must be signed in to change notification settings - Fork 53
feat(Header): add descriptionColor variable #78
Conversation
Codecov Report
@@ Coverage Diff @@
## master #78 +/- ##
==========================================
+ Coverage 88.35% 88.37% +0.01%
==========================================
Files 47 47
Lines 773 774 +1
Branches 100 101 +1
==========================================
+ Hits 683 684 +1
Misses 87 87
Partials 3 3
Continue to review full report at Codecov.
|
Regarding Layout, you could just use |
new approach to theming is merged with this PR - please, take another look |
src/components/Header/Header.tsx
Outdated
{ | ||
generateKey: false, | ||
}, | ||
) |
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 can be simplified with the following:
const descriptionElement = HeaderDescription.create(
descriptionContentOrProps,
{
defaultProps: {
variables: {
...(v.descriptionColor && { color: v.descriptionColor }),
},
},
generateKey: false,
},
)
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.
thing that I am worrying about is that this is semantically not the same as providing these custom variables as variables
property - here, with the suggested approach, those are passed as defaultProps
. Shouldn't we instead consider overrideProps
from this config object at least?
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.
Yes, we can add them in the overrideProps, my comment was just regarding removing the parsing of the descriptionProp considering it can be avoided with the proposed code. If there is no other way, then it can stay like this.
src/components/Header/Header.tsx
Outdated
{ | ||
generateKey: false, | ||
}, | ||
) |
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.
Yes, we can add them in the overrideProps, my comment was just regarding removing the parsing of the descriptionProp considering it can be avoided with the proposed code. If there is no other way, then it can stay like this.
Header - descriptionColor variables
Sets color of Header.Description.
TODO
API Proposal
descriptionColor