Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 7 of 7
  1. #1
    Regular Member

    Join Date
    Feb 2007
    Location
    Ahaha! I got VIP!
    Posts
    126

    cssparse - Simple CSS variable app

    Note: In no way is this meant to be a huge, record-breaking program. I threw this together in a few minutes and found it to be quite useful in coding templates, so here it is.

    cssparse Download


    What is cssparse?
    • cssparse is a standalone application that lets you create .cssp files with variable declarations, and parse them into .css files. [See also: How does cssparse work?][/*:m:1whllh2b]


    Why use cssparse? We all know Sass and HSS are better tools.
    • Sass requires ruby, which I don't have time to figure out, and HSS is extremely strict and missing a few properties. In light of their shortcomings, I quickly punched out a hundred or so lines* of Java code and out came this.[/*:m:1whllh2b]
    • Another thought that dawned on me recently was why you shouldn't just use a PHP stylesheet that outputs CSS. The answer is simple: You need to install server software to do that, you need to know PHP, and it presumably takes up more bandwidth to retrieve from a file that continually preprocesses. To use cssparse, all you need is the application.[/*:m:1whllh2b]


    What can cssparse do?
    • cssparse lets you declare variables to be used in your CSS template. When parsing, these variables are taken into account. You can also use any variable inside of another variable, even if it hasn't been defined yet. [See also: How does cssparse work?][/*:m:1whllh2b]


    What can't cssparse do?
    • It can't do nested blocks, and all variables must be one line. However, mixins (basically CSS functions/methods) will be added if people actually use this. [/*:m:1whllh2b]


    Are any updates scheduled for cssparse?
    • If anyone actually uses this, I'll add one-line comments (// comment).[/*:m:1whllh2b]
    • If this kicks off, I'll add mixins.[/*:m:1whllh2b]


    How do I install cssparse?
    1. The easier way, but gives you some limitations on the use of cssparse: Download the file anywhere.[/*:m:1whllh2b]
    2. The more complex way, but allows for easier use of cssparse: Download the file anywhere. Now go to Start -> Right click on My Computer -> Properties -> Advanced -> Environment Variables. Now select PATH in the top box, press Edit, go the end, and type a semicolon ( followed by the path to the folder where you put cssparse.exe.[/*:m:1whllh2b]


    How does cssparse work?
    [list][*]CSSP files are like normal CSS files, but with an extra section at the top, like such:[/*:m:1whllh2b][*]
    Code:
    blue=#6cf
    bgc=#CCCCCC
    border=1px solid $col
    col=#FF6633
    ENDVAR
    
    body,html {
        margin: 0;
        background-color: $bgc;
        color: $blue;
    }
    
    #navigation {
        padding: 5px;
        background-color: $blue;
        color: $col;
        border: $border;
    }
    [/*:m:1whllh2b][*]Note: if you used install option #1 (simple) then you MUST put all of your .cssp files into the same folder as your cssparse.exe![/*:m:1whllh2b][*]There are two ways to compile a .CSSP file using cssparse.
    1. Go into command prompt (Start -> Run -> type "cmd" and hit Enter). Now navigate to the directory where your .cssp file is. Now type the command "cssparse example.cssp" obviously replacing example with your own filename.[/*:m:1whllh2b]
    2. If you're going to be constantly re-compiling your CSSP, you can just create a batch file (example.bat) in the directory that contains your CSSP. In the contents of that batch file, put the same command "cssparse example.cssp". Also, in case of errors, it'd be a good idea to put "pause" on a line after that. And you can just run that batch file any time you need to compile.[/*:m:1whllh2b]
    [/*:m:1whllh2b][/list:u:1whllh2b]

    * I use a lot of spacing.

  2. #2
    Obsessed Veteran Adam's Avatar



    Join Date
    Nov 2004
    Location
    UK / England
    Posts
    17,271

    Re: cssparse - Simple CSS variable app

    I guess this can be handy in certain situations. But not any faster than the method I currently produce layouts at.

    Nice work though.

  3. #3
    Regular Member

    Join Date
    Feb 2007
    Location
    Ahaha! I got VIP!
    Posts
    126

    Re: cssparse - Simple CSS variable app

    Quote Originally Posted by Adam
    I guess this can be handy in certain situations. But not any faster than the method I currently produce layouts at.

    Nice work though.
    Thanks Adam. I actually created a batch file that will compile it whenever I press enter, and I've found that it's very handy for the current layout that I'm producing.

    If I may ask, what do you use to produce layouts? Just good old CSS, or the PHP method, or Sass/HSS?

  4. #4
    Obsessed Veteran Adam's Avatar



    Join Date
    Nov 2004
    Location
    UK / England
    Posts
    17,271

    Re: cssparse - Simple CSS variable app

    It varies. At work we have certain methods of creating layouts for clients, it's rapid to a point, took me sometime to get used to it. For any personal projects plain simple css, split with php. I've never been a fan of Sass, I can see why some people take to it, I just don't like anything which adds another layer of interpretation to a very simple task in the first place.

    I often used macros anyway, reduces typing.

  5. #5
    Regular Member

    Join Date
    Feb 2007
    Location
    Ahaha! I got VIP!
    Posts
    126

    Re: cssparse - Simple CSS variable app

    Quote Originally Posted by Adam
    It varies. At work we have certain methods of creating layouts for clients, it's rapid to a point, took me sometime to get used to it. For any personal projects plain simple css, split with php. I've never been a fan of Sass, I can see why some people take to it, I just don't like anything which adds another layer of interpretation to a very simple task in the first place.

    I often used macros anyway, reduces typing.
    I can see how that would be nice. Well, I'll see if anyone decides to use it (probably should post it over at Droidz too) and add // comments at some point.
    I feel like the most reliable thing to do would be to have a cron job to autocompile all of my CSSP files.

    Again, it's not a big thing, just a quickie I threw out there.

  6. #6
    Enthusiast

    Join Date
    Apr 2008
    Location
    Inside your animashunz having fun with Mr. default :D
    Posts
    2,078

    Re: cssparse - Simple CSS variable app

    I downloaded it and it didn't run. The command prompt came up and shut right down.

    I'm using Win 7 64 bit.

  7. #7
    Regular Member

    Join Date
    Feb 2007
    Location
    Ahaha! I got VIP!
    Posts
    126

    Re: cssparse - Simple CSS variable app

    You have to run it from command prompt.

    [list][*]Note: if you used install option #1 (simple) then you MUST put all of your .cssp files into the same folder as your cssparse.exe![/*:m:1b073ml7][*]There are two ways to compile a .CSSP file using cssparse.
    1. Go into command prompt (Start -> Run -> type "cmd" and hit Enter). Now navigate to the directory where your .cssp file is. Now type the command "cssparse example.cssp" obviously replacing example with your own filename.[/*:m:1b073ml7]
    2. If you're going to be constantly re-compiling your CSSP, you can just create a batch file (example.bat) in the directory that contains your CSSP. In the contents of that batch file, put the same command "cssparse example.cssp". Also, in case of errors, it'd be a good idea to put "pause" on a line after that. And you can just run that batch file any time you need to compile.[/*:m:1b073ml7]
    [/*:m:1b073ml7][/list:u:1b073ml7]


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •