2 ms·
if used in conjunction with a traditional CSS framework and you require javascript for your page, there are really no dis-advantages. in my rich internet appli
by JimBastard 17y ago
if used in conjunction with a traditional CSS framework and you require javascript for your page, there are really no dis-advantages.
in my rich internet applications i will use traditional CSS for the initial "base" state of the application and then JSSS for all further states which are generated via JS (no page-reload)
- woid 17y agoone big drawback I'm seeing is binding styles directly to DOM elements (it will appear as style attribute). this definitely has memory (many non-shared styles) and performance implications (may cause many reflows because you are setting styles individually) and it may interfere with existing code I would expect this tool to generate real CSS stylesheet code and embed it into page dynamically
- axod 17y agoI don't think this is an issue. You're modifying the DOM directly. Those style properties exist anyway. You're just modifying them via js. It only "appears as style attribute" if you serialize the DOM into HTML.
- woid 17y agoHave you ever looked at any open-source browser implementation? Because of cascading nature of style definition. Data structures describing current styling form trees (for memory efficiency and easy manipulation from script). Effective styles are evaluated during rendering. For example look at this talk and around 11:30 the guy is describing style-related data structure in Chrome/WebKit: http://www.youtube.com/watch?v=RVnARGhhs9w http://www.youtube.com/watch?v=RVnARGhhs9w Your statement "Those style properties exist anyway" is simply not true.
- dasil003 17y agoin my rich internet applications i will use traditional CSS for the initial "base" state of the application and then JSSS for all further states which are generated via JS (no page-reload) Why not just have the dynamic style in a separate class next to the base class it's applied to and then use jQuery.addClass?
- JimBastard 17y agoyou could implement a parser that used .addClass() and .removeClass() instead of .css() if i release an official parser i think it would use those methods. the whole point is to store your CSS in JSON and parse it with JS, the libraries used to do the parsing / assigning are kinda arbitrary.