Re: [css3] Suggestion: Selector variables or “synonyms”

On Wed, Jun 22, 2011 at 11:15 AM, Jens O. Meiert <jens@meiert.com> wrote:
> Dear CSS Working Group,
>
> a while back [1] (and despite later concerns [2]) I brought up the
> idea to introduce selector variables (as in “.foo = .bar”). I
> elaborated on them in a follow-up post [3]. Admittedly I’ve lost track
> of anything that might have come out of this but like to learn whether
> there are any considerations to add such a feature, or to allow any of
> the various variable suggestions [4] to cover selectors too?
>
> >From my experience especially with large-scale projects selector
> variables may be able to improve the maintainability of web sites and
> applications, particularly in the realm of refactorings. If we are
> about to introduce variables at all, that is.
>
> Thank you,
>  Jens.
>
>
> [1] http://lists.w3.org/Archives/Public/www-style/2008Feb/0039.html
> [2] http://meiert.com/en/blog/20090401/why-css-needs-no-variables/
> [3] http://meiert.com/en/blog/20080207/selector-variables/
> [4] http://lists.w3.org/Archives/Public/www-style/2011Feb/0091.html

Sorry for the late response, Jens.

I think that selector variables are a possible solution to the larger
problem of making it easier to reuse blocks of CSS.  Other possible
solutions in this problem space are mixins, SASS's @extend directive,
and architectural practices like OOCSS.

I'm highly interested in figuring out what the correct solution here
is, which solves real problems while avoiding an undecipherable mess
of indirection.  However, I don't have the bandwidth at the moment to
do so.  ^_^  Someday... (At least value variables and nesting will
help out with a lot of code-organization problems.)

~TJ

Received on Tuesday, 19 July 2011 20:59:18 UTC