[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Screenshots for 1.3, page layout



Hi


Why not just wrap each page in a div and attach a class.  One class (or
ID more likely) gives you the name of the form you are editing, another
class gives you the language.
    
ummm....  I don't think we are talking about the same problem.  Each
row is a div, and each input/label combination is a div too, iirc (but
one displayed inline rather than block).   We have the required
specificity necessary to do per-language alignment, and it is just a
matter of where to put the css files.
  

We are - Divs can fit into other divs

If you wrap the entire page in some kind of block tag (div is most popular) then you simply apply a bunch of classes to that outer wrapper and the inner content styling can be set to only apply if the container is of class XYZ

So the page structure would be:

<div id="new_transaction" class="english">
  <div class="address">
    <input>

Hence a given input of class "name" can be given a default width.  But this can be overridden in the case that it's inside an address block rather than some other kind of block.  And further more class="german" allows you to further restrict the styling

Personally I would rather NOT put all the language-specific CSS in the
same file......
  

Sure - however, the cascading part of CSS likely means that you can apply a style in a primary language and then just have a much smaller language override - no sense in applying the entire style for each language (maintenance nightmare!)


Sure, but the question is how to factor the CSS then.  I am suggesting
something entirely different which is to include different css files
for different languages.  That way German and English label widths
don't need to be maintained in the same file. 

*cascading* style sheets

The width of an address tag is one line of the css file, the styling of the nav bar on the left instead of the right is 30 lines of CSS.  Now you want those 30 lines repeated in every single file...

If I come up with a great new "theme" using orange text and making the navigation horizontal, blah, blah, then I need to redo that theme in each of the 26 languages that we eventually support.  Also adding a new language involves adding a huge new CSS file when in fact any given three languages may have similar field lengths for nearly everything bar two lines...

The point of *cascading* style sheets is to apply top level designs and then refine as you go down.

You would be best to have something along the lines of a major theme file with a separate per language CSS file.  It may be sensible to only supply the relevant CSS for the language that the user is interested in, but as a general rule it's worth doing a bit of server side consolidation if you end up with a multitude of small files, eg if the theme file is maintained as a whole bunch of smaller sub files then it's a good idea to aggregate some of them together before delivery to reduce the number of web server requests (setting expires headers also helps here)

That is fairly close to what I am proposing.  Detect the user's
language and include a single css file specific to that language.
  

Sure - but I think the key thing is just to tag the outer wrapper container with something that shows the language - that way the CSS files can be merged or not and also very specific about whether they apply to only a single language

I can imagine that a bunch of similar languages might be maintained in a single file for example (symlinks?).  Simplifies maintenance and we can still apply only the relevant styles to the languages which matter (if needed).

Good luck

Ed W