Friday 15 July 2011

node.js - How can I deliver less-css context? -


I need dynamic CSS content of delivery In short, I need it:

  & Lt; Link href = "/ css / site.css? Color = 111111" rel = "stylesheet" type = "text / css" & gt;   

While low code in site.css is unresponsive.

So I have the node on the server side. Installed JS + less, and the follow-up line works fine:

  $ lessc testless.less   

But I still can not understand how these Configure the server to respond to HTTP requests.

1) What is the best option: using Apache or Node.JS? (I'm already installing and working an Apache server)

2) How can I configure my server and application to get it?

Any help would be appreciated.

Thanks Ronan

I used to create a similar problem For both applications and I use Apache with PHP.

I call for less generator using Generator and Generator for PHP Generator via PHP exec ().

I'll use less code to write inline stylsheets. In your case, you create a dynamic stylesheet.

For example use:

& lt; Link href = "/ css / site.php? Color = 111111" rel = "stylesheet" type = "text / css" & gt;

with site.php:

    

or

  & lt;? // use lessc header ("content-type: text / css", true); Exec (resonance "P" (color: '. $ _GET [' color '].';} "| / Usr / local / bin / lessc - ', $ output, $ error); echo flat (" \ n " $ Output); Exit;    

No comments:

Post a Comment