Currently this is configured to easily work with VS Code & the Live Preview extension. Although if you want to use your own HTTP server, the projectRoot
just need to be set properly inside of lessToCss.html
.
- Clone this repo.
- Replace contents of or overwrite
styles.less
with your content. - Set the variable of
projectRoot
to be the full directory path of the cloned repo (if you want to see the copy-directory-path button which is useful if downloading the minified file.) - Assuming the Live Preview extension is enabled, open
lessToCss.html
to a web browser in VS Code by right cicking on the file in the Explorer (sidebar) and selectingShow Preview
.
Example: https://github.com/nomadicGopher/DirectCMS (/compilers/lessToCss.html)
-
Download
lessToCss.html
. -
Move
lessToCss.html
from your Download folder to the directory with your LESS file. -
Set the variable of projectRoot to be the directory path which contains your LESS file.
-
If your LESS file is not named
styles.less
, then update the variablelessFilePath
to your match your LESS file's name. -
Assuming the Live Preview extension is enabled, open
lessToCss.html
to a web browser in VS Code by right cicking on the file in the Explorer (sidebar) and selectingShow Preview
.or
If your own server is running open the browser to
https://localhost:$PORT/$RELATIVE_PATH_FROM_SERVER_TO/lessToCss.html
- No longer require an HTTP server (reference LESS file data without any APIs)