diff --git a/src/commands/index.js b/src/commands/index.js index d0b6429b4..07d0bc179 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -48,7 +48,7 @@ module.exports = () => { AbsCommands = require('./view/CommandAbstract'); // Need it here as it would be used below - var add = function(id, obj){ + var add = function(id, obj) { if (isFunction(obj)) { obj = { run: obj }; } diff --git a/src/css_composer/index.js b/src/css_composer/index.js index 03a4e9b94..d4f17be6d 100644 --- a/src/css_composer/index.js +++ b/src/css_composer/index.js @@ -3,6 +3,7 @@ * * [get](#get) * * [set](#set) * * [getAll](#getall) + * * [clear](#clear) * * [load](#load) * * [store](#store) * * [setIdRule](#setidrule) @@ -231,6 +232,17 @@ module.exports = () => { return rules; }, + + /** + * Remove all rules + * @return {this} + */ + clear() { + this.getAll().reset(); + return this; + }, + + /** * Add a raw collection of rule objects * This method overrides styles, in case, of already defined rule