From 3e1b4a42fa53ab2ef875d169bd69613ed443bb32 Mon Sep 17 00:00:00 2001 From: Emil Kashkevich Date: Wed, 1 Feb 2017 15:40:11 +0200 Subject: [PATCH] Add experimental LESS syntax support --- lib/postcss-sorting.coffee | 11 +++++++---- package.json | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/postcss-sorting.coffee b/lib/postcss-sorting.coffee index b7fa871..3251ac0 100644 --- a/lib/postcss-sorting.coffee +++ b/lib/postcss-sorting.coffee @@ -115,10 +115,13 @@ module.exports = predefinedConfig = @_getPredefinedConfig() options = null - if grammar.scopeName == 'source.css.postcss.sugarss' - syntax = require 'sugarss' - else - syntax = require 'postcss-scss' + switch grammar.scopeName + when 'source.css.postcss.sugarss' + syntax = require 'sugarss' + when 'source.css.less' + syntax = require 'postcss-less' + else + syntax = require 'postcss-scss' src = content: if selection.length then selection else buffer.getText() diff --git a/package.json b/package.json index 846d96b..02b6176 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "postcss": "5.2.11", + "postcss-less": "0.15.0", "postcss-scss": "0.4.0", "postcss-sorting": "2.0.1", "sugarss": "0.2.0"