-
Notifications
You must be signed in to change notification settings - Fork 104
feat(Alert): add size props; add css-api; refactor component #2146
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
base: main
Are you sure you want to change the base?
Conversation
Preview is ready. |
Visual Tests Report is ready. |
f08a52c
to
353afc1
Compare
color: var(--g-alert-title-color, var(--g-color-text-primary)); | ||
font-size: var(--g-alert-title-font-size, var(--_--title-font-size)); | ||
font-weight: var(--g-alert-title-font-weight, var(--_--title-font-weight)); | ||
line-height: var(--g-alert-title-line-height, var(--_--title-line-height)); |
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.
There is no need of font weight CSS vars, user can do the following:
<Alert title={<MyBoldTitle/>} />
Let's keep only font-size
and line-height
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.
fixed
src/components/Alert/Alert.scss
Outdated
} | ||
|
||
&__title { | ||
color: var(--g-alert-title-color, var(--g-color-text-primary)); |
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.
color: var(--g-alert-title-color, var(--g-color-text-primary)); | |
color: var(--g-alert-title-text-color, var(--g-color-text-primary)); |
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.
fixed
src/components/Alert/Alert.scss
Outdated
} | ||
|
||
&__message { | ||
color: var(--g-alert-message-color, var(--g-color-text-complementary)); |
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.
color: var(--g-alert-message-color, var(--g-color-text-complementary)); | |
color: var(--g-alert-message-text-color, var(--g-color-text-complementary)); |
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.
fixed
src/components/Alert/Alert.scss
Outdated
@@ -17,5 +134,6 @@ $block: '.#{variables.$ns}alert'; | |||
|
|||
&__close-btn { | |||
flex-shrink: 0; | |||
margin-inline-start: var(--g-alert-close-btn-indent, var(--_--close-btn-indent)); |
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.
What's the purpose of manipulating both margin and relative position? There are already usage of --_--close-btn-offset
above.
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.
after discussion with the designer we decided to remove additional offset
src/components/Alert/Alert.scss
Outdated
&__main { | ||
flex-grow: 1; | ||
display: flex; | ||
gap: var(--g-alert-content-gap, var(--_--content-gap)); |
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 specify in CSS API only the parts we publically declare. The content name is the internal structure. This should be variables like: g-alert-message-margin
, g-alert-actions-margin
and so on
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.
fixed
src/components/Alert/Alert.tsx
Outdated
layout = 'vertical', | ||
closeBtnSize = 'm', |
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.
closeBtnSize = 'm', | |
closeButttonSize = 'm', |
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.
fixed
} | ||
|
||
&__icon { | ||
vertical-align: text-bottom; |
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.
Icon is now not aligned properly with the title. Icon should be a bit under the text baseline
353afc1
to
2710b80
Compare
06c4405
to
3854a73
Compare
No description provided.