Skip to content

Commit

Permalink
Bump v1.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Crowl committed Jul 16, 2022
1 parent 613d698 commit 08b45d3
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 30 deletions.
45 changes: 43 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
![Easy LESS logo](https://raw.githubusercontent.com/mrcrowl/vscode-easy-less/main/icon.png)
# Changelog

## The [Easy LESS changelog](https://playbooks.codelingo.io/p/p_EMdmk2e) can now be found on CodeLingo Playbooks.
## v1.7.4

- Added support for optional quotes around string inline options (`main`, `out`, `math` and `autoprefixer`), so that they look more JSON-ey e.g.
```javascript
// out: "../styles.css"
```
- Added test suite.
- Modernise code.

## [v1.7.2-v1.7.3]

- New: math setting is now supported as a per-file directive, and is explicitly available in the settings.json configuration.

## v1.7.1

- Fix: Reverted change in 1.7.0 that caused `@import "../../style.css";` imports to stop being exported.

## v1.7.0

- Updated less to [v4.1.0](https://github.com/less/less.js/blob/master/CHANGELOG.md)
- 💔 **Breaking change**: The less compiler changed the default `math` mode to `parens-division` in v4.x. To restore the v3.x behaviour you will either need to:
- Set the `math` mode to `"always"`.
- Wrap the expression with () to force the division, i.e. `width: (100% / 3)`
- For more information, see http://lesscss.org/usage/#less-options-math and https://github.com/mrcrowl/vscode-easy-less/#project-wide--global-configuration.

## v1.6.0-v1.6.3

- Added support for settings in workspaces with multiple projects—[#50](https://github.com/mrcrowl/vscode-easy-less/issues/50)
- Added a new variable `${workspaceFolder}` which can be used to interpolate the folder root path into an `out` or `main` setting.
- Fix: Compiler stalling when less error exists in file other than being saved—[#55](https://github.com/mrcrowl/vscode-easy-less/issues/55)
- Fix: palette command "Compile LESS to CSS" not triggering in newer versions of VS code.—[#46](https://github.com/mrcrowl/vscode-easy-less/issues/46)
- Fix: for `sourceMapURL` not matching generated file when using `main` and `out` settings together.—[#43](https://github.com/mrcrowl/vscode-easy-less/issues/43)

## v1.5.0-v1.5.1

- Updated less to v3.9.0
- Updated less-plugin-autoprefix to v2.0.0
- Inline Javascript must now be explictly enabled using the javascriptEnabled option (either per-file or via settings). This regressed in v1.5.0 [#54](https://github.com/mrcrowl/vscode-easy-less/issues/54), due to security changes introduced by LESS v3.0.0.

## <v1.4.5

- For earlier release notes, see https://github.com/mrcrowl/vscode-easy-less/blob/v1.4.5/CHANGELOG.md
52 changes: 25 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ Easily work with LESS files in Visual Studio Code.

---

<br>

### 💘 Easy LESS is proudly sponsored by [**CodeLingo** — Get on the same page, fast!](https://marketplace.visualstudio.com/items?itemName=codelingo.codelingo)

- Share links to snippets that open directly in VS Code.
- Tighten the loop and keep alignment between design discussions and the code.

<br>

# Features

- Generates a `.css` file each time you save a `.less` file.
Expand Down Expand Up @@ -77,7 +68,7 @@ N.B. Also available from the command palette as "Compile LESS to CSS".
- Example:

```less
// out: ../dist/app.css, compress: true, sourceMap: false
// out: "../dist/app.css", compress: true, sourceMap: false

body,
html {
Expand All @@ -96,12 +87,18 @@ N.B. Also available from the command palette as "Compile LESS to CSS".

`out: { boolean | filepath: string | folderpath: string }`

- Redirects the css output to a different file.
- This setting can be used to override a project-wide `"out": false` setting, where you only want certain `.less` files to be generated.
- Redirects the css output to a different file or suppresses output.
- If `filepath` is used, but no file extension is specified, it will append `.css`
- If `folderpath` is used, the less filename will be used, but with the `.css` extension
- A folder path must end with a `/` (or `\` for Windows), e.g. `../css/` not `../css` (the latter is always interpreted as an extensionless filename).
- Filepath is relative to the current file.
- _NOTE_: A folder path must end with a `/` (or `\` for Windows), e.g. `../css/` not `../css` (the latter is always interpreted as an extensionless filename).
- Filepath is relative to the current file, so relative paths can be used, e.g. `../../styles.css`
- The following replacements are available:
- `${workspaceFolder}` — the root folder for the VS Code project containing the `.less` file.
- `$1` — the "base" name of the `.less` file, e.g. for `styles.css`, `$1` would be `style`.
- `$2` — the extension of the css file, usually `.css` unless `outExt` is used.
- Example: `${workspaceFolder}/dist/css/final-$1$2`
- `out: false` = don't output.
- This setting can be used to override a project-wide `"out": false` setting, where you only want certain `.less` files to be generated.

`outExt: { string }`

Expand Down Expand Up @@ -145,7 +142,7 @@ N.B. Also available from the command palette as "Compile LESS to CSS".
/css/feature/features.less:

```less
// main: ../../main.less
// main: "../../main.less"
.feature {
background-image: url(background.png);
}
Expand Down Expand Up @@ -175,8 +172,8 @@ N.B. Also available from the command palette as "Compile LESS to CSS".
```

- See [browserslist](https://github.com/ai/browserslist#queries) documentation for further examples of browser queries.
- **NOTE**: If used with the per-file configuration, the browsers listed _must_ be unquoted and semi-colon separated (because comma is already the directive separator): e.g.<br/>
`// autoprefixer: > 5%; last 2 Chrome versions; not ie 6-9, sourceMap: true, out: ../css/style.css`
- **NOTE**: If used with the per-file configuration, the browsers listed _must_ be semi-colon separated (because comma is already the directive separator): e.g.<br/>
`// autoprefixer: "> 5%; last 2 Chrome versions; not ie 6-9", sourceMap: true, out: "../css/style.css"`

`ieCompat: { boolean }`

Expand Down Expand Up @@ -204,7 +201,7 @@ N.B. Also available from the command palette as "Compile LESS to CSS".
```
... or, using a per-file directive:
```less
// math: always
// math: "always"
```
Alternatively, you can wrap your expression in parentheses:
```less
Expand All @@ -228,7 +225,7 @@ Settings are read and applied in the following order:
> Add the following line to the head of your less file:
>
> ```javascript
> // out: new-file.css
> // out: "new-file.css"
> ```

2. How do I redirect all css output to a specific folder?
Expand All @@ -254,7 +251,7 @@ Settings are read and applied in the following order:
> Add a reference to the master.less file to the head of the imported less file:
>
> ```javascript
> // main: master.less
> // main: "master.less"
> ```

4. How do I suppress the compilation of a single less file?
Expand Down Expand Up @@ -323,27 +320,25 @@ Settings are read and applied in the following order:
> - _Per file_: by specifying the `main` setting key more than once:
>
> ```less
> // main: main-one.less, main: main-two.less
> // main: "main-one.less", main: "main-two.less"
> ```
>
> When there is more than one `main` setting, they are guaranteed to be
> output in the order listed (from left to right). For the example shown above, the output from `main-one.less` will be saved to disk before `main-two.less` is processed (assuming they are both configured to output). This can be used to control dependency chains.

7. Can I specify paths relative to the _workspace_, instead of relative to the _less_ file?

> Yes, the variable `${workspaceRoot}` can be used within the `main` or `out` parameters:
> Yes, the variable `${workspaceFolder}` can be used within the `main` or `out` parameters:
>
> `.vscode/settings.json`:
>
> ```json
> {
> "less.compile": {
> "main": ["${workspaceRoot}\\css\\main.less"]
> "main": ["${workspaceFolder}/css/main.less"]
> }
> }
> ```
>
> Alternatively, the variable `${workspaceFolder}` can be used, which supports both multi-root workspaces and single folders.

8. How do I generate sourcemap (`*.css.map`) files?

Expand All @@ -357,8 +352,11 @@ Settings are read and applied in the following order:
> }
> ```

9. How do I resolve the error `"Inline JavaScript is not enabled. Is it set in your options?"`? > Inline JavaScript is a feature of LESS that used to be enabled by default. It was disabled by default in v3.0.0 of LESS for security reasons. You can use the `javascriptEnabled` setting to override this behaviour by setting the value to `true`. > > If you receive this error unintentionally, there are most likely one or more backticks (``) in your .less file.
}
9. How do I resolve the error `"Inline JavaScript is not enabled. Is it set in your options?"`?

> Inline JavaScript is a feature of LESS that used to be enabled by default. It was disabled by default in v3.0.0 of LESS for security reasons. You can use the `javascriptEnabled` setting to override this behaviour by setting the value to `true`.
>
> If you receive this error unintentionally, there are most likely one or more backticks (``) in your .less file.

# Acknowledgements

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "easy-less",
"displayName": "Easy LESS",
"description": "Auto-compile LESS to CSS on save",
"version": "1.7.3",
"version": "1.7.4",
"publisher": "mrcrowl",
"engines": {
"vscode": "^1.31.0"
Expand Down

0 comments on commit 08b45d3

Please sign in to comment.