Not signed in (Sign In)

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Syntax Highlighting

You can highlight any code you post by wrapping it in the BBCode tags, [code lang="css"]code here[/code]. Other usable lang values are "xml", "html", "xhtml", "css", "js", "javascript", "php", "sql", "python", "py", "ruby", "rb", and "java".

Choose the Format Comments option "SyntaxHighlighter" to use this BBCode. Note that no other BBCode is supported at the moment.

    • CommentAuthorCPF
    • CommentTimeFeb 25th 2010
     
    In principal, I'd like to do something like below (which regrettably does not work). This would permit me to vary a color value globally within every CSS class that referenced "darkgray". Can it be done?

    .darkgray { color=#333333; }

    .class (font-weight=bold; color=darkgray; )
    • CommentAuthorthomas
    • CommentTimeFeb 28th 2010
     
    CSS doesn't support variables, but some projects have built tools that compile a pseudo-CSS language into normal CSS, such as SASS, and a framework built around it called Compass: http://sass-lang.com/, http://compass-style.org/
    • CommentAuthorPhouan
    • CommentTimeApr 7th 2010
     
    Why do you need varibles for working with CSS, if it's easy as hell if you once know the basics? - It's not JavaScript / jQuery, or PHP, it's stylsheet coding. You can name the color if they exist, for example


    .darkgray {
    color=#333333;
    }

    .class {
    font-weight: bold;
    color: gray;
    }

Valid XHTML 1.0 Strict

Valid CSS!