|
|
|
|
|
by michaelchisari
5579 days ago
|
|
I mildly disagree that coupling it to the controller makes the best sense. Maybe in MVC that isn't component structured, but even then, you'd probably want more granular control than that. In Appleseed[1], I mapped CSS component views, and foundations. Foundations are layouts of components, and describe the whole page. Views describe a specific view of a component. So, basically, if I have a component "example", with a view "list", then I can create a file in the default theme: themes/default/styles/components/example/list.css
It will only get loaded into the <head> if the list view of the example component is loaded. I do similar things for the client-side Javascript.It is good that people are working towards figuring out these patterns, though. The sooner we can move away from the wild west of spaghetti css and javascript, the better. [1] http://wiki.appleseedproject.org/doku.php?id=developers |
|