W dniu 18.12.2012 16:34, Lex Berezhny pisze:
On Tue, Dec 18, 2012 at 10:16 AM, Łukasz Mach <[email protected]
<mailto:[email protected]>> wrote:
W dniu 18.12.2012 16:08, Lex Berezhny pisze:
[...]
I don't really understand your CSS requirements. Why do you want to
dynamically inject the CSS? The complexity introduced in that seems
unnecessary. What is the goal or reason for this?
Now, when you need to use some widget (eg. HorizontalSplitPanel),
you need to go documentation or code or examples of
HorizontalSplitPanel, see what .css classes it uses, and what should
be defined in your CSS, and copy&paste it to CSS of your web
application. Otherwise - it will look like a shit.
It's especially visible in all dialog boxes.
It's annoying. I think it should work in such way, that you just use
HorizontalSplitPanel, and you have default look of it. Eg - default
look could be like in
https://github.com/pyjs/pyjs/__tree/master/examples/__splitpanel/public
<https://github.com/pyjs/pyjs/tree/master/examples/splitpanel/public> -
and if you want it to look different, you can override it in .css
When using analogy of eg. wxWidgets or pyQT - when you use
wx.Button, wx.Calendar or something, you just use it - you don't
need to worry about copy appropriate images to your application, or
write definition of look of button somewhere in your app.
The simple solution to this would be to have a base.css file with all of
the widgets styled. You can then overwrite it in a custom CSS.
Hmm, I bet that almost everyone will call such file "bloat".
Also, I think there should be mechanism of adding style to browser, even
when making custom widgets. Dammed, it's annoying for me even if I must
copy&paste .css between my own projects.
[...]
Try not to think of Pyjs as equivalent to wxWindgets or pyQT. Your life
will be easier if you think in terms of web design, DOM and CSS.
Pyjs is just a way of using Python to manipulate DOM. Styling is up to you.
Ok. Example from web application world - django. When I use admin
plugin, I don't need to copy&paste CSS and copy files by hand -
everything looks nice, and I need to play with .css only when I want to
modify something.
I think that "just works" approach is good no matter if it's web or
desktop application.
--
pozdrawiam
Łukasz Mach - [email protected]
--