mrcrowl / vscode-easy-less

Easy LESS extension for Visual Studio Code
MIT License
68 stars 23 forks source link

Feature request: change less main/out based on existing file. #92

Open StefBakker opened 1 year ago

StefBakker commented 1 year ago

I would like to see a option to automatically switch the less settings. I am working a lot with different workspaces and projects at the moment (Joomla/Wordpress/Magento) that require me to manually adjust the settings in the settings.json. It would be nice to have a extra option to use a specific main/out based on lets say a file. Maybe something like be able to expand the main/out settings:

"less.compile": {
    "main": {
      "./wp-config.php": "${workspaceRoot}/wp-content/themes/theme/assets/less/template.less",
      "./configuration.php": "${workspaceRoot}/templates/theme/less/template.less",
      "./bin/magento": "${workspaceFolder}\/app\/design\/frontend\/parent_theme\/child_theme\/web\/css\/template.css",
    }
},

Maybe this is possible, maybe not but i thought i would share my thoughts about a improvement to this extension

mrcrowl commented 1 year ago

Hey @StefBakker, just wanted to check that your request isn't satisfied by the per-file directives (comment based) that we already support?

See https://github.com/mrcrowl/vscode-easy-less#per-file-configuration

For example, you can add directive comments like this:

// main: "../styles.less", compress: true, sourceMap: false

body,
html {
  ...;
}
mrcrowl commented 1 year ago

... if that doesn't help, you can also specify settings in the workspace config file: i.e.

.vscode/settings.json

Still not enough? Then yes, let's chat more about what you need.

Mqxx commented 1 year ago

Hey is the topic still up to date? I have a similar question related to the output path per file. I have my original less files in a certain structure, for example like this:

./src/wiki/page_1/style/index.less

I now want the file to be automatically saved under the same path but under:

./dist/wiki/page_1/style/index.css

Can I configure this without having to specify this for each individual file?

Thx 😃 ~Mqx

PS: This Extension is awsome!