douchunrong / flot

Automatically exported from code.google.com/p/flot
0 stars 0 forks source link

Externalize Styling #748

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the way flot operates the javascript applies inline styles and 
classes to the elements it creates within the container.

I would like to propose the inclusion of a flot.css file that would handle the 
styling of all elements involved. This would create a greater degree of 
separation between the styling of the legend and similar items, allowing a 
greater degree of customization to end users without tampering with the core 
javascript.

I'm more than willing to make all the changes necessary for this to the 
codebase, but I would first like to know that the upstream would be willing to 
accept such a change.

Original issue reported on code.google.com by anthonyr...@gmail.com on 31 Aug 2012 at 9:49

GoogleCodeExporter commented 9 years ago
Can you provide an example of an element you'd want to change this way?

Original comment by dnsch...@gmail.com on 7 Sep 2012 at 9:37

GoogleCodeExporter commented 9 years ago
Certainly, a number of simple examples can be found in the legend, for instance:

.legendColorBox > div {
    border: none;
}

This will not work as expected unless the "!important" declaration is appended 
(border: none !important;).

Another example that I personally noticed was issues with element styling, I 
had all table's set with a "width: 100%" before I rolled out flot, it didn't 
occur to me that I might need to customize the styling of flot elements to 
account for these blanket changes, something that might have been more obvious 
had a separate CSS file been included.

I should note an obvious problem with this, in the fact that if some things 
could be customized via CSS, such as the legend, it might seem odd that other 
things such as the colors, and axis elements required javascript for 
customization.

Seeing as axis drawing was moved from the DOM to canvas (looking at the News 
file), I feel as though issue 519 would be a better solution moving forward, as 
it's more consistent with how flot currently functions. 

If issue 519 isn't high on the roadmap, I'll write and test a patch for issue 
749.

Either way, this issue can probably be closed.

Original comment by anthonyr...@gmail.com on 13 Sep 2012 at 1:30