@brandup/ui-kit 1.0.14 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
1
  const fs = require("fs");
2
2
 
3
3
  function parseLessVars(filePath) {
4
- if (!filePath) {
5
- filePath = 'uikit.vars.less';
6
- }
4
+ filePath = filePath ?? 'uikit.vars.less';
5
+ if (!fs.existsSync(filePath))
6
+ throw new Error("Not found UI kit configuration file uikit.vars.less.");
7
7
 
8
- const content = fs.readFileSync(filePath, 'utf-8');
8
+ const content = fs.readFileSync(filePath, 'utf-8');
9
9
 
10
- let variables = {};
10
+ let variables = {};
11
11
 
12
- content.split('\n').forEach(line => {
13
- const match = line.match(/@([\w-]+)\s*:\s*(.+);/);
14
- if (match) variables[`@${match[1]}`] = match[2].trim();
15
- });
16
- return variables;
12
+ content.split('\n').forEach(line => {
13
+ const match = line.match(/@([\w-]+)\s*:\s*(.+);/);
14
+ if (match) variables[`@${match[1]}`] = match[2].trim();
15
+ });
16
+ return variables;
17
17
  }
18
18
  module.exports = parseLessVars;
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "type": "module",
24
24
  "license": "Apache-2.0",
25
- "version": "1.0.14",
25
+ "version": "1.0.18",
26
26
  "main": "source/index.ts",
27
27
  "types": "source/index.ts",
28
28
  "dependencies": {
@@ -1,3 +1,5 @@
1
+ @import (reference) "../vars.less";
2
+
1
3
  :root {
2
4
  // body
3
5
  --main-background: @main-background;
@@ -1,3 +1,5 @@
1
+ @import (reference) "../vars.less";
2
+
1
3
  /*
2
4
 
3
5
  1. Набор переменных для контролов пользовательских ввода данных.
@@ -1,4 +1,4 @@
1
+ @import (reference) "../vars.less";
1
2
  @import "reset.less";
2
3
  @import "common.less";
3
- @import "inputs.less";
4
- @import "../vars.less";
4
+ @import "inputs.less";