Redash: Bootstrap/Ant style collisions

Created on 7 Jan 2019  ·  8Comments  ·  Source: getredash/redash

Redash is in the midst of migrating from Bootstrap to Ant, and from Angular to React.
Loading both component libraries causes collisions, since both use some identical less variable names, resulting mostly in wrong colors being displayed.

Bootstrap cannot be fully swapped until React migration is complete (Ant doesn't offer Angular components) so a middle ground must be found.

Currently defining specific css overrides, which problematic in many ways. Need better solution.

Frontend React

All 8 comments

Seems importing css instead of less files in ant.less resolves this.
I think it's good enough for now.

@ranbena the problem with importing the css version is that our overrides won't apply:

https://github.com/getredash/redash/blob/22f835d3cbf0088b86129b235a73d621e342d725/client/app/assets/less/redash/ant.less#L12-L42

No?

I agree with @arikfr on this, the issue still exists, although we can avoid it for some components that don't require variable override.

I tested migrating all less files related to #3209 and some differences are noticeable (e.g.: font for form labels and inputs). My first test was with buttons, so that wasn't annoying.

I think what we can try do to at least give it some time is somehow isolate Ant less processing from the rest. I did a few tests with webpack.config.js and it seemed possible. It seems to create a variable-isolated tree when I do sth like this:

// webpack.config.js (line 29)
  entry: {
    app: [
      "./client/app/index.js",
      "./client/app/assets/less/main.less",
      "./client/app/assets/less/redash/ant.less"
    ],
    server: ["./client/app/assets/less/server.less"]
  }

With that we can create a new tree without including bootstrap on those paths. WDYT? :smile:

@gabrieldutra if this works, it seems like the best solution indeed.

@ranbena what do you think? I'm not very experienced with Less (or Redash styling files), but I can try to reorganize those files.

My concerns are all related to what we will see after this division. Till now we've been coding based on a mix of styles and once we properly divide it some page/component styles could break. A very good look on pages and components (mainly the ones which use Ant) will be important.

Be assured @arikfr and I will take a close look at all pages and components prior to approval 🕵🏻‍♂️

Can we close this now?

Was this page helpful?
0 / 5 - 0 ratings