sublimehq / Packages

Syntax highlighting files shipped with Sublime Text and Sublime Merge
https://sublimetext.com
Other
2.95k stars 586 forks source link

(feature request) highlight LESS in HTML #1376

Open anovsiradj opened 6 years ago

anovsiradj commented 6 years ago

using LESS (and another CSS preprocessor) syntax hightight if <style> tag attribute type value is not default (text/css). for example:

<style type="text/x-less">
...
body {
  #content {
    ...
  }
}
...
</style>

thanks!

(sory for my english)

Thom1729 commented 6 years ago

I'm ambivalent about this. It's not a standard HTML feature, and we don't generally like adding nonstandard features to core syntaxes. In this case, there's no LESS syntax in core, so the feature wouldn't even work without a third-party syntax. I think that's a compelling reason not to implement it in core.

On the other hand, I can definitely see that it would be nice if third-party syntaxes could more easily provide extensions like this. I've been thinking about improving the language-determination functionality for <script> and <style> tags in the core HTML syntax. Improving that mechanism might also make it easier for third-party syntaxes to "hook into" it.

michaelblyons commented 4 years ago

Sounds like a job for a third-party package with extends.

michaelblyons commented 3 years ago

Like #2722, this would require linking an external syntax. Any unit tests would fail. I recommend closure.

deathaxe commented 3 years ago

It seems LESS and SCSS are only small extensions compared to CSS. Inheriting them from CSS would be even more straigthforward than the aproach of SASS package. Maybe we can add them at some point, because they seem to have matured to some kind of defacto standard in web development.

michaelblyons commented 3 years ago

It seems LESS and SCSS are only small extensions compared to CSS. Inheriting them from CSS would be even more straigth forward than the aproache SASS package does at the moment. Maybe we can add them at some point, because they seem to have matured to some kind of defacto standard in web development.

Good points. I'm willing to concede.