[Pkg-javascript-commits] [less.js] 29/58: add support for `isruleset`

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:28:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.3.0
in repository less.js.

commit 297ac17ddad19c8b284f5318ae5c579ae72cabc5
Author: Justineo <justice360 at gmail.com>
Date:   Thu Jan 15 12:12:39 2015 +0800

    add support for `isruleset`
---
 lib/less/functions/types.js | 4 ++++
 test/css/functions.css      | 1 +
 test/less/functions.less    | 4 ++++
 3 files changed, 9 insertions(+)

diff --git a/lib/less/functions/types.js b/lib/less/functions/types.js
index 42a5190..adc1347 100644
--- a/lib/less/functions/types.js
+++ b/lib/less/functions/types.js
@@ -1,4 +1,5 @@
 var Keyword = require("../tree/keyword"),
+    DetachedRuleset = require("../tree/detached-ruleset"),
     Dimension = require("../tree/dimension"),
     Color = require("../tree/color"),
     Quoted = require("../tree/quoted"),
@@ -21,6 +22,9 @@ var isa = function (n, Type) {
         return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;
     };
 functionRegistry.addMultiple({
+    isruleset: function (n) {
+        return isa(n, DetachedRuleset);
+    },
     iscolor: function (n) {
         return isa(n, Color);
     },
diff --git a/test/css/functions.css b/test/css/functions.css
index 37bbfdf..62eac50 100644
--- a/test/css/functions.css
+++ b/test/css/functions.css
@@ -127,6 +127,7 @@
   mixt: rgba(255, 0, 0, 0.5);
 }
 #built-in .is-a {
+  ruleset: true;
   color: true;
   color1: true;
   color2: true;
diff --git a/test/less/functions.less b/test/less/functions.less
index 6a02e70..947b9f2 100644
--- a/test/less/functions.less
+++ b/test/less/functions.less
@@ -137,6 +137,10 @@
   mixt: mix(#ff0000, transparent);
 
   .is-a {
+    @rules: {
+      color: red;
+    };
+    ruleset: isruleset(@rules);
     color: iscolor(#ddd);
     color1: iscolor(red);
     color2: iscolor(rgb(0, 0, 0));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list