-
200810 Dec
Posted in CSS3 Preview, Interviews
Six Revisions put six questions to the estimable Eric Meyer on the subject of CSS3, and we get some nice link love.
Also (and I’m slightly late with this one) John Resig, creator of the jQuery library, runs an approving eye over the Advanced Layout Module. Webmonkey provide further context. We looked at the module back in 2006 (part one, part two), and my tongue-in-cheek prediction of a ten year wait to use it is now down to only eight years…
-
200804 Dec
Posted in Browsers
Opera have announced the first Alpha release of the next version of their browser. Codename Peregrine features version 2.2 of their Presto rendering engine, which boasts 100% Acid 3 compliance, a 30% speed boost on certain sites, and a number of new features for web developers.
As CSS enthusiasts it’s the latter we’re interested in, of course, and the notable CSS3 implementations are:
-
200825 Nov
Posted in Proposals
For those of you not on the www-style mailing list, you may not be aware that Dean Jackson announced today that Apple have published updated proposals for Transitions, Animations and Transforms. This news comes after the recent decision by the CSSWG at their October F2F meeting that
it is very likely that the CSSWG will accept to work on them [Apple's proposals]
.Full details of what’s been changed in these updated proposals can be found in Deans email, however,
the most significant changes are splitting 2D and 3D transforms into separate documents and adding a list of properties that can be animated (and how to interpolate different property types)
It’s worth noting that these documents are only proposals, are likely to change, and haven’t formally been accepted by the W3C.
-
200815 Nov
Posted in CSS3.info
There’s been an apparent need (voiced by the web community) for CSS-based Constants ever since the conception of CSS (even though there are many established server-side preprocessors in existance). From reading blogs and the like, people are either very much in favour or very much against the idea, but the feature’s mixed reception hasn’t stopped members of the CSSWG exploring and discussing the idea further, to the point where we now have two fairly detailed proposals from members of the Working Group. The aim of this post is to explore and then summarise the current state of both proposals (from an authors not a vendors point of view), comparing features of both.
Back in March this year, Dave Hyatt and Daniel Glazman combined forces and presented the first formal proposal for Variables to the Working Group, and (based on this spec) Hyatt subsequently implemented the module into Webkit nightlies; the implementation was distributed for around 5 months, but was later removed due to concerns regarding feature adoption by authors before the spec had any time to mature. In August this year, fantasai submitted a counter-proposal which detailed plans for a parse-time syntax for Constants (which are lost after the variables are parsed and therefore not mutable), compared to Hyatt’s/Glazman’s proposal which allowed for scriptable Variables.
Types of Constants
Fantasai’s proposal features three types of named Constants, ‘values’, ’style-sets’ and ’selectors’; a value constant represents a property value, a style-set constant represents one or more property declarations and a selector constant represents a selector. Each are declared using an
@definerule and as fantasai explains,the syntax of an
. Examples (ripped straight from her proposal :)) showing the syntax for each of the three Constants are below:-@definerule is the@defineat-keyword, followed by either thevalueskeyword (for declaring value constants) or thestyle-setskeyword (for declaring style-set constants) or theselectorskeyword (for declaring selector constants), followed by a blockValues
@define values { textColor: black; bgColor: white; accentColor: silver; accentBorder: double silver 5px; }Style-sets
define style-sets { noteBox { border-style: solid; padding: 1em; border-radius: 1em; } quoteBox { margin: 1em; } }A feature of fantasai’s proposal is that constants are re-usable, so you can include ’style-set templates’ which can be applied to multiple selector declarations, using different value constant values.
Selectors
Note that any selectors used in such a variable aren’t allowed to be grouped (using the comma-seperated grouping syntax), since we will have the ability to group selector variables anyway. Selector constants would be useful for repeatedly selecting child/grandchild etc elements deep within a complex DOM tree; consider this:-
@define selectors { deeplynestedelement: body.home > div#main.container ~ ul#navigation > li a[href="http"] span#child > span#imrunningoutofnames;}
deeplynestedelement u, deeplynested b{ color:red; }And with the addition of a possible
:match()pseudo class in Selectors Level 4, you could do something like this to make the above statement even more organised:-deeplynestedelement:matches(u,b){ color:red; }Instead Hyatt’s/Glazman’s proposal simply utilises a new
@variablesrule in which any type of variable (presumably) can be used, without the need for type keywords - their proposal isn’t actually clear on whether different types of variables can be parsed (or whether this proposal simply targets value constants), however, after looking at several test cases, the implementation seems like it was capable of at least parsing ’style-sets’ constants too.@variables { CorporateLogoBGColor: #fe8d12; }div.logoContainer { background-color: var(CorporateLogoBGColor); }Scoping
Two fairly major differences between the two proposals are their scoping behaviour. In fantasai’s proposal, by default, the
scope of a named constant does not ordinarily cross @import boundaries
; this essentially means that the use of variables declared in one@importare restricted to that particular stylesheet, unlike Hyatt’s/Glazman’s proposal where, by default, constants cross@importboundaries. However, using fantasai’s proposal, authors do have complete control over the scope by using one of three new keywords (which is placed between the@importkeyword and the stylesheet URI),push,pullandsync;pullallows constants declared within the imported stylesheet to be used in the importing stylesheet;pushallows constants declared above the@importrule in the importing style sheet to be used the imported style sheet;syncallows both of the previous, simultaneously.The two proposals differ also in the way that constants relate to, and work with Media Types. In Hyatt’s/Glazman’s proposal, an optional Media Type keyword can be placed between the
@variableskeyword and succeeding block declaration. In fantasais proposal, constant declarations (placed within a@defineblock) can be nested within an@mediablock. However she metions,…if declared inside an
, meaning that constants can be used outside of the@mediarule, the scope of the declaration does not end with the@mediablock@mediathey’re placed in. It’s worth mentioning that the@mediarule model/syntax differences could be trivially modified to use the other’s media type syntax.
-
200815 Nov
Posted in CSS3.info
From the October F2F CSS Working Group minutes (Apple’s proposal);
Apple presented their proposals for Animations and Transitions, made remarks on Transforms, gradients, reflections. All four major browser vendors are interested in these proposals, and it is very likely that the CSSWG will accept to work on them.
Exciting stuff!Hakon presented a proposal for a
border-partsproperty, whichdefines an on/off mask over the border as a series of lengths
; you can check out his proposal in more detail on www-style. Note, this is still very much an unapproved proposal and the WG have stated that they are still unsure how usable/useful a solution such as this would be.Dave Hyatt and Daniel Glazman initially came up with a proposal for CSS Variables, and fantasai has now created a counter-proposal detailing plans for a purely parse-time, non-scriptable solution. To help distinguish between the merits of both, I’ve come up with a brief article comparing and summarising both proposals.






