DISQUS

interfacelab: Variables in CSS via PHP

  • asp örneği · 1 year ago
    css Font examples , Properties , Attribute - - //
    http://www.css-lessons.ucoz.com/font-css-exampl...
  • Robert · 1 year ago
    I wonder if you ever stumbled over Inman's related proposal for sever-side constants, which seems to be a kind of predecessor to this CSS compiler?
  • jawngee · 1 year ago
    Nope, link?
  • Custom PHP · 1 year ago
    Very cool idea!! Thanks for taking the time to document it!
  • بلياردو · 5 months ago
    Thank u

    It.s very good
  • arionyx · 5 months ago
    I'm currently working on a PHP v5.3 compatible implementation of this, if you have any more ideas, I'd be more than happy to include them. For those who want it. I'll make it available for download/review on my company's website at http://alboeverything.com
  • joericochuyt · 3 months ago
    line 146: is_num => is_numeric
  • smashingthemes · 3 months ago
    This is something very important and basic that CSS lacks, sometime you even have to inherit most of the styles from one definition into another, but there is not solution. Thanks for writing this cool parser, I am surely going to try it,
  • dvessel · 1 month ago
    This is really nice. I was trying to adapt this to a few of my projects and noticed some bugs.

    Within a .cssp file, having a rule that needs to be parsed after an eval() rule will throw an exception. I changed the regex pattern for catching the eval lines to this:

    $eval_regex='/(eval\((.*)\))\/';

    from this:

    $eval_regex='/(eval\((.*)\))\s*;/is';

    There's also that is_num function which doesn't exist. It's been mentioned before but it's is_numeric.

    There seems to be other hidden features with you haven't mentioned. I'll be experimenting with them. Thanks for putting this out here.
  • mauricevlot · 1 month ago
    You're a genius. I also ran across the document from Daniel and David and was actually surprised that w3schools didn't do something with this information. These variables and other scripting-like features is definitely something css lacks off. I think that companies who build and maintain large websites with complex stylesheets already build compilers for their own usage, but they'll probably never release it to the public. But you did, and I'm definitely going to use this wonderful piece of innovation!

    Thank you for sharing this.
  • kbjr · 1 month ago
    thank you very much. i have been looking for a way to use variables in my css. this is great, thanks a lot.