CSS - Javascript Cleaning Meeting

The discussion was logged here : http://svn.seagullproject.org/~logbot/index.php?date=2006-12-05 starting at 10:39

Overview

This meeting will aim to see what changes can be done to better use CSS and integrate Javascript files in Seagull Framework.

At the end of meeting, we should have defined a roadmap to implement those changes with TO DECIDE and TODO lists. Tickets should also be created for further work and these tickets will be assigned to 2 milestones: "css cleanup", "js cleanup".

Agenda

CSS

1.efficient use of css files (performance, style.php, ...)

  • use one single style.php file in SGL_THEME dir
  • allow possibility to split and load several files layout, fonts, core (with ability to define files load order)
  • rename to .css files if it loads faster than .php files

TO CONFIRM: is it possible to have a single style.php file? What about some theme specific defined vars?

TO DECIDE: how to load these different files (in the link function? automatically?)

2.structural VS presentational naming

  • use maximum structural naming
  • use presentational naming for CSS widgets generic CSS rules

3.refactoring CSS rules between layout, styling

Split core.php into

  • layout.php = main structure
  • style.php (instead of core.php) = default tags definitions + some styling (fonts, colors, ...)
  • widgets.php rules.php = some usefull CSS rules using presentational naming

Rename these file with .css extension if benchmark from mwattier is ok

4.making default_theme IE7 ready (and outstanding IE bugfixes)

  • using css helpers instead of specific browsers CSS hacks for simplicity

5.defining some CSS widgets generic CSS rules (working with forms, tables)

  • identify which are generic enough to be added and put the rules inside widgets.php main-rules.php css file

JAVASCRIPT

1.javascript strategy in seagull (flexibility, loose coupling, performance)

  • use javascript more professionnally
  • follow CS in javascript too
  • make tests (scriptaculous, JsUnit?, ...)
  • create a namespace for seagull methods

2.Flexibility

  • allow to load some files across whole project (in addition to manager)
  • allow to define some js vars from php
$output->defineJsVar('WEBROOT', SGL_WEB_ROOT)
# and SGL_JS will be prefixed automatically (depending in the namespace we'll use)

3.refactoring core seagull js methods, reducing them at minimum, put them in namespace (e.g. sgl.core, sgl.utils, ...)

  • cleanup the crappy mainAdmin.js, mainPublic.js

Roadmap

For CSS

  1. Split core.php into main-layout.php, main-style.php, main-rules.php (instead of main-widgets cause widget has a specific meaning)
  2. Rename style.php to css.php and give it ability to load "main-" files automatically
  3. Clean up default_theme
  4. Fix outstanding IE bugs

For Javascript

  1. Need more feedback and discussion through RFC