Title: | Leaner Style Sheets |
---|---|
Description: | Converts LESS to CSS. It uses V8 engine, where LESS parser is run. Functions for LESS text, file or folder conversion are provided. This work was supported by a junior grant research project by Czech Science Foundation 'GACR' no. 'GJ18-04150Y'. |
Authors: | Jonas Vaclavek [aut, cre], Jakub Kuzilek [aut] |
Maintainer: | Jonas Vaclavek <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2025-03-12 04:44:46 UTC |
Source: | https://github.com/ciirc-kso/rless |
Passes content of file_name into V8 console and converts it using LESS engine to CSS. The converted CSS is saved into output_folder under original name. Only the extension is switched to css.
convert_file(base_path, file_name, output_folder = tempdir())
convert_file(base_path, file_name, output_folder = tempdir())
base_path |
Base path to file to be converted |
file_name |
Path relative to |
output_folder |
Output path where converted file should be placed.
File is placed to |
Full path to created file with converted CSS file
path_to_less_files <- system.file("extdata", package="rless") convert_file(path_to_less_files, "example.less") convert_file(path_to_less_files, "example.less", tempdir())
path_to_less_files <- system.file("extdata", package="rless") convert_file(path_to_less_files, "example.less") convert_file(path_to_less_files, "example.less", tempdir())
Function goes through folder specified in input_folder and finds files
matching the pattern. If recursive is set to TRUE, scanner
are also subdirectories of the input_folder. Matching files are
converted using convert_file
function.
convert_folder(input_folder, output_folder = tempdir(), recursive = FALSE, pattern = "*.less$")
convert_folder(input_folder, output_folder = tempdir(), recursive = FALSE, pattern = "*.less$")
input_folder |
Path to files to be converted |
output_folder |
Output path where converted files should be placed
Files are placed to |
recursive |
Boolean value used when searching for filed to be converted |
pattern |
Pattern which files need to match to be converted |
List of file paths to converted files is returned
path_to_less_files <- system.file("extdata", package="rless") convert_folder(path_to_less_files) convert_folder(path_to_less_files, tempdir()) convert_folder(path_to_less_files, recursive = TRUE) convert_folder(path_to_less_files, pattern = '*.css$')
path_to_less_files <- system.file("extdata", package="rless") convert_folder(path_to_less_files) convert_folder(path_to_less_files, tempdir()) convert_folder(path_to_less_files, recursive = TRUE) convert_folder(path_to_less_files, pattern = '*.css$')
Parse LESS file to CSS and return it as result
parse_less(code)
parse_less(code)
code |
text to be converted in LESS format |
Currently LESS '@import' functionality is not supported.
converted text to CSS
parse_less('.button { .red{ collor: red}}') parse_less('@red: red; .red{ collor: @red}')
parse_less('.button { .red{ collor: red}}') parse_less('@red: red; .red{ collor: @red}')
rless is R package providing CSS preprocessor features to R users.
It uses LESS language, which is an CSS extension giving option to use variables, functions or using operators while creating styles. Visit oficial LESS website (http://lesscss.org) for more information about language specifics. The provided LESS content is converted into CSS using V8 JavaScript engine (https://v8.dev/).
Maintainer: Jonas Vaclavek [email protected]
Authors:
Jakub Kuzilek
Useful links: