Skip to content
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

Merged
merged 10 commits into from
Aug 5, 2020
Merged

feat: Add antd to the codebase #10508

merged 10 commits into from
Aug 5, 2020

Conversation

nruhe
Copy link
Contributor

@nruhe nruhe commented Aug 3, 2020

SUMMARY

Introduces Ant Design as per SIP-48, albeit with a few improvements.

  1. Wrapping ant components in a config provider or ".ant" class will no longer be necessary. Just use Ant components directly!
  2. Components are now being exposed through ./common/components folder and linting now errors if you try to include them via node_modules. This gives us the flexibility to later wrap any components in emotionJS as per SIP-37.

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

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@nruhe nruhe changed the title Feature/antd Add antd to the codebase Aug 3, 2020
@import '~antd/lib/style/mixins/index';
@import '~antd/lib/style/core/base';

*[class*='ant-'] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@nruhe nruhe changed the title Add antd to the codebase [WIP] feat: Add antd to the codebase Aug 3, 2020
@nruhe nruhe changed the title [WIP] feat: Add antd to the codebase feat: Add antd to the codebase Aug 3, 2020
@@ -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',
Copy link
Member

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;
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or better yet, we could pull these variables in via JS using something like this or (perhaps less ideal, but easier) this.

Copy link
Member

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.

Copy link
Member

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

Copy link
Contributor Author

@nruhe nruhe Aug 4, 2020

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;

Copy link
Member

@ktmud ktmud Aug 4, 2020

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.

@nytai
Copy link
Member

nytai commented Aug 5, 2020

closing/reopening to see if it triggers CI

@nytai nytai closed this Aug 5, 2020
@nytai nytai reopened this Aug 5, 2020
@nytai nytai merged commit 51a88cb into apache:master Aug 5, 2020
@nytai nytai deleted the feature/antd branch August 5, 2020 20:50
Ofeknielsen pushed a commit to ofekisr/incubator-superset that referenced this pull request Oct 5, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants