Reputation: 43
I always use a predefined CSS Reset as well as WordPress Core CSS along with my upcoming CSS in any project that I work on. I did not have a problem before I use LESS.
When I write new LESS code and compiled it through SimpLESS or any other compiler, I just get my existing CSS (Reset, WP Core) code removed from my stylesheet (.css) and it gets updated with the new compiled CSS.
It's really annoying for me as I'm using LESS for the first time.
So, how to I keep my existing CSS and the compiled CSS both at once?
Upvotes: 1
Views: 311
Reputation: 683
why dont you compile your less to a separate style sheet and include both in your page head? The problem is if you are compiling from style.less to style.css without including your existing css code in your less, it will overwrite the file not append to it.
So either use the solution above and include your existing css in your less, or compile to a different file name and include both css files in your document head.
Upvotes: 0
Reputation: 4391
Two options:
Put your existing CSS in your LESS code. Your LESS code will overwrite your css file on every save, so you'll manage all of your styles with LESS.
Change the name of your LESS file so you're not overwriting your existing CSS code, then put links to both stylesheets in your HTML document, or by putting this line in your LESS file:
@import (css) "foo.css";
Upvotes: 1