-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: Add antd to the codebase #10508
Conversation
@import '~antd/lib/style/mixins/index'; | ||
@import '~antd/lib/style/core/base'; | ||
|
||
*[class*='ant-'] { |
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.
🔥
@@ -87,6 +87,12 @@ module.exports = { | |||
'no-prototype-builtins': 0, | |||
'no-restricted-properties': 0, | |||
'no-restricted-syntax': 0, | |||
'no-restricted-imports': ['error', { | |||
'paths': [{ | |||
'name': 'antd', |
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.
👏
/* | ||
Theme variables here: https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less | ||
*/ | ||
@primary-color: #20a7c9; |
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.
These colors should be pulled from variables.less
rather than being hard-coded 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.
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, finding a single-source solution to this will make a big difference for custom themes, or switching light and dark mode. I think ideally these variables would be set at runtime, not at build time.
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.
referencing variables.less
is a good first step
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'm a little concerned with including that file directly since we might unintentionally overwrite variables we don't mean to. If we want to do this right, there should be a constants file that sources the common values used in the theme variables.
E.g.
// In constants.less
@superset-color-primary = #20a7c9;
// In variables.less
@primary-color = @superset-color-primary;
// In antd.less
@primary-color = @superset-color-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.
variables.less
is kind of bloated right now and it's difficult to distinguish between our custom variables and the Bootstrap/Cosmos ones. I'm also worried that adding ant variables to this file may create a mess.
I think a larger question is do we want to keep less
in our stack or do we want to slowly migrate away from it? The larger frontend community seems to have been favoring PostCSS, CSS variables, and CSS-in-JS recently. If we also believe these technologies are the future, we should probably limit our use of less to creating a base theme at build-time, and add runtime theme overrides using only styled components or css variables.
closing/reopening to see if it triggers CI |
SUMMARY
Introduces Ant Design as per SIP-48, albeit with a few improvements.
As a follow up, we'll need to continue to tweak the Ant theme variables and styles as needed to match new design direction.
ADDITIONAL INFORMATION