From: Jeff Thies on
Andy Dingley wrote:
> On 26 May, 14:49, Mark Smith <marksmith5...(a)jungle-monkey.com> wrote:
>> Is it possible to select elements conditionally based on what they
>> contain?
>
> You're looking for predicates, and in general there isn't any such
> mechanism in CSS (look at XPath for an example of one).
>
> If you read Haakon Lie's PhD thesis, the rationale behind these
> decisions is explained more fully. CSS is in many ways a reaction to
> previous stylesheet languages, such as DSSSL, and their over-
> complexity. An axiomatic assumption behind CSS is that it will only
> need to be applied to documents that are the output from a fairly
> sophisticated publishing process (i.e. it can reasonably make demands
> that these documents contain extra markup to assist CSS), rather than
> optimised for terseness and simplicity of coding them. This allows
> significant simplifications in CSS itself, achieving clarity of the
> CSS specification, and also simplicity of CSS implementations.
>
> The "CSS way" of working is that rather than writing complicated CSS
> selectors that can infer a lot from document structure, you write
> documents with additional explicit classes where this implied
> condition would be met. The CSS is then an easy match for a class. You
> are forced to pre-process the HTML (or hand-edit) to achieve this.
> This is easier and simpler overall, even if it is indeed shifting work
> from the browser coder to the site author.

Thanks for the background.

When I think of CSS I think of how all touchscreens worked before
Apple came up with the Touch OS. They all worked in a way that was
convenient to the OS designer, not the user.

CSS is much like that. It makes doing simple common chores like
columns a convoluted mess. It is not design/user friendly. It could be
fixed and the programming to do it is not hard. It won't be, though.

There, I almost feel better!

Jeff
From: Thomas 'PointedEars' Lahn on
Jeff Thies wrote:

> Andy Dingley wrote:
>> You're looking for predicates, and in general there isn't any such
>> mechanism in CSS (look at XPath for an example of one).

Not true. There is just no descendant predicate/selector in CSS _ATM_.

> When I think of CSS I think of how all touchscreens worked before
> Apple came up with the Touch OS. They all worked in a way that was
> convenient to the OS designer, not the user.
>
> CSS is much like that. It makes doing simple common chores like
> columns a convoluted mess. It is not design/user friendly. It could be
> fixed and the programming to do it is not hard. It won't be, though.
>
> There, I almost feel better!

Guess what would happen if you suddenly discovered stylesheet languages on
the Web that are capable of this, like XSL (XPath has been mentioned).


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
From: Andy Dingley on
On 31 May, 16:07, Jeff Thies <jeff_th...(a)att.net> wrote:

>    CSS is much like that. It makes doing simple common chores like
> columns a convoluted mess. It is not design/user friendly. It could be
> fixed and the programming to do it is not hard.

It is hard, that's the lesson of the precursors of CSS. As I said,
read the PhD thesis.

> It won't be, though.

It probably will be, when some PHP idiot decides to attach client-side
scripting, or something equally noxious. That will Be Bad.
From: Stanimir Stamenkov on
Mon, 31 May 2010 17:53:13 +0200, /Thomas 'PointedEars' Lahn/:
>> Andy Dingley wrote:
>>
>>> You're looking for predicates, and in general there isn't any such
>>> mechanism in CSS (look at XPath for an example of one).
>
> Not true. There is just no descendant predicate/selector in CSS _ATM_.

Are there any (other, non-descendant) predicate selectors in CSS,
currently?

--
Stanimir
From: Andy Dingley on
On 31 May, 21:16, Stanimir Stamenkov <s7a...(a)netscape.net> wrote:

> Are there any (other, non-descendant) predicate selectors in CSS,
> currently?

There are a few specialised ones, such as the pseudo-selectors and the
language filters and there's a case for saying that class or id tests
are something of this ilk. The point is that you can't test on child
elements of the element the styles will be applied to,
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: positioning absolute
Next: Sidebar tops uneven