-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3L working with LessPHP? #13
Comments
What versions of Less does LessPHP support? |
Using PHP to compile LESS files is a rather bad idea, since the compilers are written in - well - PHP and can just try to be compatible with the less.js. Answering your question: no, the LessPHP doesn't work with the 3L (it can't, for example, handle multiple arguments in the .box-shadow mixin). Another presumably popular LESS' PHP compiler - Less.php - fails to evaluate JavaScript used in 3L. If you're going to compile any non trivial less file on the server, you'd be better using a real JavaScript compiler in the Node environment. I'm not sure why are you so into using a server for compilation? The client-side compilation, using less.js in the browser is certainly a bad idea, but why won't you use the Node with the Less compiler package installed to create a CSS, or at least any desktop tool that internally uses the less.js? |
Thx for the quick answer! louis. |
The .less files are just for development. Whenever you want to deploy your application or website on a server, it's better to deliver only the compiled .css, leaving all .less on your machine. To do as such you have basically two options:
I think that for now, the second option will suit you more. Most of the tools can watch your .less files and compile them instantly after they change delivering the .css in the fly. The compilation is a quick process. It usually takes less than a second, so you don't need to be concerned about making a burden on your machine and feel free to recompile it every single line change. Also remember to refer only the compiled .css in your HTML file. |
https://incident57.com/codekit/ is another nice one if you are 1) On a mac 2) Don't like the command line. |
Uh- my current developing workflow looks as following: |
I might be wrong, but doesn't Transmit basically just upload the files for you in the background on every change? If so, you are still free to use any tool that compile the CSS live. Transit will be just uploading this file. Of course, this will generate a bit of overhead, since you will be uploading the whole CSS instead of a single LESS files (given you have them divided that way), but I don't think this will be noticeable in any way. Otherwise, I believe there's no PHP compiler that could handle the mixins in 3L or any other library that uses the JavaScript-only features of less.js. |
Hard decision. Leaving known waters and work for the change or stick to the roots? Over time I coded my own lil mixin library not even thinking about that there could be a real big one out there, till today- and up to here it serves me pretty good, buuut leaving this job to someone else would be great.- But back to topic. So you mean before saving TextMate or so should compile it into a css for me? That sounds like a bummer with 1sec compile-time in mind. I save ooooften. And refresh even moooore often. CodeKit looked especially here very interesting. Is CodeKit a standalone text-editor? If so I'm pretty sure it will lose against the awesome TextMate 2. Aiaiai. |
No, CodeKit is an app that "just" compiles the files into their final state (ie. .less -> .css). You still need to use a text editor. The workflow with this kind of software is:
I don't think this will take much longer than using some kind of a server compilation. If this will not suit you though, you are still free (and it's completely fine) to use the client-side compilation of the less file while in development. Just switch to the outcome .css file when in production. |
Yeah but I'd like to use 3L ;) - And therefore the server side compilation stand's in way. I just wanna be sure: so CodeKit compiles my less to a css and saves it on a server? So I don't need my Transmit-Network-Volume workflow? Do I have the files simultaneously saved on my local drive and then uploaded by CodeKit? That would be great because I'm a very lazy backupper. What interests me most is the opportunity to see live updates on another screen of my css without refreshing. Although it's hard to imagine how can smoothly work. I know the developer tools of Safari, Chrome and such but still compared to my speed in TextMate 2 it's a real pain in the ass to test around in the developer tools. |
But- to not lose the point here. :D |
I'm not using Transmit and Network Volume (I'm not even a Mac user), so I might be wrong on that. The CodeKit tracks your files in the Network Volume folder (I guess the NV works that way - creating a local folder) and when it sees a change, it compiles a .css file into that folder. Since the changes are detected by Transmit (again, just a guess), the .css is uploaded.
Not really sure of the problem here. You have to |
Sorry to bother with a seemingly nobrainer- for me it isn't! And the internet is a great place with lots of helpful people, right? :)
I really don't like the client-side preprocessing and end up using lessPHP (http://leafo.net/lessphp/) since I love less so much!
But it seems lessPHP isn't up to date, is it?
So is 3L working with LessPHP?
Thx!
The text was updated successfully, but these errors were encountered: