editor icon indicating copy to clipboard operation
editor copied to clipboard

Refactor CSS of components

Open domoritz opened this issue 5 years ago • 22 comments

Right now we use a lot of custom classes. Instead, we should have a single class for a component (e.g. help-modal) and then use rules that are for objects nested below (e.g. .help-modal p a).

domoritz avatar Aug 11 '19 11:08 domoritz

I'll give it a try :)

nik72619c avatar Oct 21 '19 19:10 nik72619c

Sweet, thanks.

domoritz avatar Oct 21 '19 22:10 domoritz

I'm not quite able to get clarity on refactoring css here...any examples of how is it to be refactored @domoritz ?

nik72619c avatar Oct 23 '19 21:10 nik72619c

Sure! The main problems I see is that we have a lot of repetition across files, we don’t have a good way of name spacing properties right now (the styles in one file could affect other components), and we don’t use consistent style for similar components.

I think we want to reduce the number of classes and make the existing ones more meaningful and reusable. Similarly, we should use css variables for colors. We could use tachyons as a css framework to simplify our style.

Working on this will mean that you have to look across files and refactor.

Does this make sense?

domoritz avatar Oct 23 '19 21:10 domoritz

I would like to help on this issue. Is there any branch for this issue?

rav1kantsingh avatar Dec 05 '19 03:12 rav1kantsingh

Welcome to Vega! Not yet. Feel free to send a pull request. I recommend starting with one component and then going from there.

domoritz avatar Dec 05 '19 04:12 domoritz

As you mentioned to use CSS variables for colors. should I define color variables on top of same CSS file or in some other file?

rav1kantsingh avatar Dec 05 '19 06:12 rav1kantsingh

Let's define them in the main CSS file. If you work on variables first, let's replace all colors at once.

domoritz avatar Dec 05 '19 07:12 domoritz

Hey @domoritz . I am new to Open Source. I would like to work on this issue. Should i replace the classes by the tachyons classes?

PunitLodha avatar Dec 16 '19 12:12 PunitLodha

That's a lot of work. Maybe let's start by just refactoring the CSS. Right now, we have a lot of duplications and few clear separations. We can switch to a framework once you have had some exposure to our current style.

domoritz avatar Dec 16 '19 19:12 domoritz

I am also open to this work. Please let me know how can I help.

rav1kantsingh avatar Dec 17 '19 18:12 rav1kantsingh

Have a look at the code and send PRs to fix issues you see.

domoritz avatar Dec 17 '19 18:12 domoritz

I have sent a PR. Please review it. If its good, then i shall start working on the other components

PunitLodha avatar Dec 18 '19 07:12 PunitLodha

Should we start using BEM for structuring the CSS?

PunitLodha avatar Jan 23 '20 14:01 PunitLodha

I'm leaving this decision to you as long as we overall increase consistency.

domoritz avatar Jan 23 '20 18:01 domoritz

@domoritz is this issue still open? I would like to take this.

adrijshikhar avatar Feb 18 '20 22:02 adrijshikhar

Yep, the CSS can always be improved.

domoritz avatar Feb 19 '20 00:02 domoritz

can you give me an example of how you want it to be?

adrijshikhar avatar Feb 20 '20 17:02 adrijshikhar

Not really. Just look through the code and notice how we could clean up the CSS. I know, this issue isn't very concrete.

domoritz avatar Feb 20 '20 17:02 domoritz

Hey @domoritz I am working on this also are we planning to bring theming feature to the editor in future? coz than we will have to make css refactors while keeping that in mind.

ashu8912 avatar Feb 21 '20 23:02 ashu8912

I don't think theming is a priority.

domoritz avatar Feb 21 '20 23:02 domoritz

ok for now all the modal have distorted css working on fixing that within one pr

ashu8912 avatar Feb 22 '20 00:02 ashu8912