Re: New layout language.

On 7/6/05, Laurens Holst <lholst@students.cs.uu.nl> wrote:
> Orion Adrian wrote:
> 
> >>>My point is that it wasn't obvious. You yourself said, you had to
> >>>figure some things out. I've spent years with CSS and while I haven't
> >>>recently, the system is very complex in how it interacts with itself.
> >>>
> >>>
> >>I'd just like to point out here that most CSS experimentation involves
> >>finding out what IE will do with certain types of code.  It's rare that
> >>I run CSS through both Firefox and Opera and find major differences with
> >>how it's interpreted.  In fact, 99 out of 100 times, it'll be
> >>interpreted exactly as the CSS standards say, which means I can
> >>visualize it in my head.
> >>
> >>
> >The idea I've been trying to get across this whole time is that the
> >mental models of the people here are very unlikely to be the mental
> >models of most designers.
> >
> >
> How?
> 
> It is utterly simple. You have a block, which is initially the size of
> the content (if any, or 0x0). 

There are a lot of problems with this statement alone. What is the
size of content? One word per line, continue going until you run out
of content with no breaks? This is more complicated methinks.

> If you want it to have a 10 pixel empty
> space around it, you position it 10px from the top, left, right and
> bottom, which will make it 'stretch' horizontally and vertically as
> necessary.

This is called anchor layout and it's fairly effective and can cover
most cases yes. It does require additional panels to get all layouts
correctly.

> Linking the dimensions to the window borders ensures that the
> box resizes with the browser window.
> 
> Similarly, if you want a box from (0,0) to (50,200) you just specify
> left, top and width, height. If you want a box next to that from (50,0)
> to (total width, unspecified) then you specify left, top and right.

What about the case where you don't want something to grow at the same
rate as the viewport? This is what I'm talking about in the 0%/100%
case. What about the other percentages?

> This should also work perfectly fine for GUI tools to layout a design.

It works easily until you get outside of the 0%/100% case. Once
outside, I haven't seen an algorithm that produces clean code. That's
also a complaint I've seen. People like to hand code because the
machine barfs out bad code.
 
> By the way, in your example that you gave without right: and bottom:,
> how can you specify that something ends x pixels before the end of the
> window? In fact, how can you specify the place where a box ends in
> anything else but percentages? You can't, so I think that makes your
> proposal officially less powerful than CSS currently is :).

By defining the container it's in. The viewport is defined as well
(but wasn't listed in the example). An oversight on my part.

The viewport being another region is described as

top: 0;
left: 0;
width: <number> + 100%;
height: <number> + 100%;

And with at addition it's absolute positioning is exactly as powerful,
and simpler to boot.

-- 

Orion Adrian

Received on Wednesday, 6 July 2005 19:41:43 UTC