Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 431526

Summary: Rethink about how we should organize css files.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: antonm, ken_walker, pwebster, simon_kaegi
Version: 5.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description libing wang CLA 2014-03-28 14:17:30 EDT
I've learned some lessons while implementing the readonly file system widget. I am not an expert of css but I would like to use this bug as a trigger for us to rethink about how we should organize our css files.

Some bullets here:
1.The readonly widget consumes several modules like the navigation renderer, section, dropdwon menu, etc. It ends up that the widget has to import almost all of the orion css files. The reason is that our css files are quite for categories, not for modules. Lets say if I am consuming 10% of the Orion modules, I shouldn't have consumed 90% of Orion css. We may want to break our css down to more module-oriented files so that a widget can choose which ones are needed and which ones are not.

2.We should definitely define any document level style in a single solid css file  so that a widget should avoid using that. This will prevent the widget build from affecting the hosting page.

3.If the widget overrides a class but later on someone added additional attributes for the same class, the attributes affects the widget automatically. I always have to check if this attributes should be shared for the widget or not. I am wondering if we have any better way to handle this. 

4.Naming convention of classes. Conflicting class names with the hosting page are rare cases but we should think about it.

5.There are some cases that the hosting page in turn affects the widget style. The only thing I had to do was to override that class in the widget. A better should be found.
Comment 1 libing wang CLA 2014-03-28 14:27:17 EDT
We also have to rethink about how to modularize js code for UI components so that a widget build does not introduce too much un-reachable code. I will summarize an other bug for that.
Comment 2 libing wang CLA 2014-03-28 15:57:16 EDT
I've just roughly read this interesting article: http://www.alanayoub.com/modular-css/. It talks about breaking into small css files logically and at the build time select needed css files to build a widget.

It may help us in some aspects.
Comment 3 John Arthorne CLA 2015-05-05 14:49:15 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html