@ngutil/style 0.0.3-dev.16 → 0.0.3-dev.17
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.
- package/esm2022/index.mjs +2 -1
- package/esm2022/sass/animation/vars/index.mjs +24 -0
- package/esm2022/sass/index.mjs +2 -0
- package/fesm2022/ngutil-style.mjs +25 -1
- package/fesm2022/ngutil-style.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.scss +1 -0
- package/package.json +5 -3
- package/sass/animation/vars/index.d.ts +20 -0
- package/sass/index.d.ts +1 -0
- package/src/sass/animation/vars/index.scss +12 -0
- package/src/sass/index.scss +2 -0
- package/src/sass/vars.scss +74 -0
- package/styles/index.scss +0 -1
- package/styles/vars.scss +0 -47
package/esm2022/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { watchMedia } from "./services/media-watcher";
|
|
2
2
|
export { ColorSchemeService } from "./services/color-scheme.service";
|
|
3
|
-
|
|
3
|
+
export { Ease, Duration } from "./sass";
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9zdHlsZS9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLDBCQUEwQixDQUFBO0FBQ3JELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFBO0FBQ3BFLE9BQU8sRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLE1BQU0sUUFBUSxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgd2F0Y2hNZWRpYSB9IGZyb20gXCIuL3NlcnZpY2VzL21lZGlhLXdhdGNoZXJcIlxuZXhwb3J0IHsgQ29sb3JTY2hlbWVTZXJ2aWNlIH0gZnJvbSBcIi4vc2VydmljZXMvY29sb3Itc2NoZW1lLnNlcnZpY2VcIlxuZXhwb3J0IHsgRWFzZSwgRHVyYXRpb24gfSBmcm9tIFwiLi9zYXNzXCJcbiJdfQ==
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* eslint-disable prettier/prettier */
|
|
3
|
+
/* ! AUTO GENERATED DO NOT EDIT ! */
|
|
4
|
+
export class Ease {
|
|
5
|
+
static { this.Deceleration = "cubic-bezier(0, 0, 0.2, 1)"; }
|
|
6
|
+
static { this.Standard = "cubic-bezier(0.4, 0, 0.2, 1)"; }
|
|
7
|
+
static { this.Acceleration = "cubic-bezier(0.4, 0, 1, 1)"; }
|
|
8
|
+
static { this.Sharp = "cubic-bezier(0.4, 0, 0.6, 1)"; }
|
|
9
|
+
/**
|
|
10
|
+
* Reach nearly end position fast, and slowly move to final position
|
|
11
|
+
*/
|
|
12
|
+
static { this.Emphasized = "cubic-bezier(0.12, 0.9, 0.12, 0.9)"; }
|
|
13
|
+
}
|
|
14
|
+
export class Duration {
|
|
15
|
+
static { this.Fast = "200ms"; }
|
|
16
|
+
static { this.FastMs = 200; }
|
|
17
|
+
static { this.Medium = "300ms"; }
|
|
18
|
+
static { this.MediumMs = 300; }
|
|
19
|
+
static { this.Slow = "400ms"; }
|
|
20
|
+
static { this.SlowMs = 400; }
|
|
21
|
+
static { this.Snail = "600ms"; }
|
|
22
|
+
static { this.SnailMs = 600; }
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9zdHlsZS9zcmMvc2Fzcy9hbmltYXRpb24vdmFycy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjo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wgMSwgMSlcIiBhcyBjb25zdFxuICAgIHN0YXRpYyByZWFkb25seSBTaGFycCA9IFwiY3ViaWMtYmV6aWVyKDAuNCwgMCwgMC42LCAxKVwiIGFzIGNvbnN0XG4gICAgLyoqXG4gICAgICogUmVhY2ggbmVhcmx5IGVuZCBwb3NpdGlvbiBmYXN0LCBhbmQgc2xvd2x5IG1vdmUgdG8gZmluYWwgcG9zaXRpb25cbiAgICAgKi9cbiAgICBzdGF0aWMgcmVhZG9ubHkgRW1waGFzaXplZCA9IFwiY3ViaWMtYmV6aWVyKDAuMTIsIDAuOSwgMC4xMiwgMC45KVwiIGFzIGNvbnN0XG59XG5cbmV4cG9ydCBjbGFzcyBEdXJhdGlvbiB7XG4gICAgc3RhdGljIHJlYWRvbmx5IEZhc3QgPSBcIjIwMG1zXCIgYXMgY29uc3RcbiAgICBzdGF0aWMgcmVhZG9ubHkgRmFzdE1zID0gMjAwIGFzIGNvbnN0XG4gICAgc3RhdGljIHJlYWRvbmx5IE1lZGl1bSA9IFwiMzAwbXNcIiBhcyBjb25zdFxuICAgIHN0YXRpYyByZWFkb25seSBNZWRpdW1NcyA9IDMwMCBhcyBjb25zdFxuICAgIHN0YXRpYyByZWFkb25seSBTbG93ID0gXCI0MDBtc1wiIGFzIGNvbnN0XG4gICAgc3RhdGljIHJlYWRvbmx5IFNsb3dNcyA9IDQwMCBhcyBjb25zdFxuICAgIHN0YXRpYyByZWFkb25seSBTbmFpbCA9IFwiNjAwbXNcIiBhcyBjb25zdFxuICAgIHN0YXRpYyByZWFkb25seSBTbmFpbE1zID0gNjAwIGFzIGNvbnN0XG59XG4iXX0=
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Ease, Duration } from "./animation/vars";
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9zdHlsZS9zcmMvc2Fzcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgRWFzZSwgRHVyYXRpb24gfSBmcm9tIFwiLi9hbmltYXRpb24vdmFyc1wiXG4iXX0=
|
|
@@ -42,9 +42,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
42
42
|
args: [{ providedIn: "root" }]
|
|
43
43
|
}] });
|
|
44
44
|
|
|
45
|
+
/* eslint-disable */
|
|
46
|
+
/* eslint-disable prettier/prettier */
|
|
47
|
+
/* ! AUTO GENERATED DO NOT EDIT ! */
|
|
48
|
+
class Ease {
|
|
49
|
+
static { this.Deceleration = "cubic-bezier(0, 0, 0.2, 1)"; }
|
|
50
|
+
static { this.Standard = "cubic-bezier(0.4, 0, 0.2, 1)"; }
|
|
51
|
+
static { this.Acceleration = "cubic-bezier(0.4, 0, 1, 1)"; }
|
|
52
|
+
static { this.Sharp = "cubic-bezier(0.4, 0, 0.6, 1)"; }
|
|
53
|
+
/**
|
|
54
|
+
* Reach nearly end position fast, and slowly move to final position
|
|
55
|
+
*/
|
|
56
|
+
static { this.Emphasized = "cubic-bezier(0.12, 0.9, 0.12, 0.9)"; }
|
|
57
|
+
}
|
|
58
|
+
class Duration {
|
|
59
|
+
static { this.Fast = "200ms"; }
|
|
60
|
+
static { this.FastMs = 200; }
|
|
61
|
+
static { this.Medium = "300ms"; }
|
|
62
|
+
static { this.MediumMs = 300; }
|
|
63
|
+
static { this.Slow = "400ms"; }
|
|
64
|
+
static { this.SlowMs = 400; }
|
|
65
|
+
static { this.Snail = "600ms"; }
|
|
66
|
+
static { this.SnailMs = 600; }
|
|
67
|
+
}
|
|
68
|
+
|
|
45
69
|
/**
|
|
46
70
|
* Generated bundle index. Do not edit.
|
|
47
71
|
*/
|
|
48
72
|
|
|
49
|
-
export { ColorSchemeService, watchMedia };
|
|
73
|
+
export { ColorSchemeService, Duration, Ease, watchMedia };
|
|
50
74
|
//# sourceMappingURL=ngutil-style.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngutil-style.mjs","sources":["../../../../packages/style/src/services/media-watcher.ts","../../../../packages/style/src/services/color-scheme.service.ts","../../../../packages/style/src/ngutil-style.ts"],"sourcesContent":["import { inject, NgZone } from \"@angular/core\"\n\nimport { distinctUntilChanged, Observable, shareReplay, Subscriber } from \"rxjs\"\n\nconst WATCHES: { [key: string]: Observable<boolean> } = {}\n\n/**\n * watchMedia(\"(display-mode: standalone)\")\n */\nexport function watchMedia(expr: string): Observable<boolean> {\n const existing = WATCHES[expr]\n if (existing == null) {\n return (WATCHES[expr] = _createWatcher(expr))\n }\n return existing\n}\n\nfunction _createWatcher(expr: string): Observable<boolean> {\n const zone = inject(NgZone)\n return zone.runOutsideAngular(() =>\n new Observable((sub: Subscriber<boolean>) => {\n const query = window.matchMedia(expr)\n const listener = (event: MediaQueryListEvent) => {\n sub.next(event.matches)\n }\n query.addEventListener(\"change\", listener)\n sub.next(query.matches)\n return () => {\n query.removeEventListener(\"change\", listener)\n delete WATCHES[expr]\n }\n }).pipe(distinctUntilChanged(), shareReplay(1))\n )\n}\n","import { Injectable } from \"@angular/core\"\n\nimport { map, shareReplay } from \"rxjs\"\n\nimport { watchMedia } from \"./media-watcher\"\n\n@Injectable({ providedIn: \"root\" })\nexport class ColorSchemeService {\n readonly isDark = watchMedia(\"(prefers-color-scheme: dark)\")\n readonly isLight = this.isDark.pipe(\n map(v => !v),\n shareReplay(1)\n )\n\n // TODO: set preferred color scheme (dark/light)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA,MAAM,OAAO,GAA2C,EAAE,CAAA;AAE1D;;AAEG;AACG,SAAU,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CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EACZ,WAAW,CAAC,CAAC,CAAC,CACjB,CAAA;AAGJ,KAAA;8GARY,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA,CAAA,EAAA;;2FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACNlC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngutil-style.mjs","sources":["../../../../packages/style/src/services/media-watcher.ts","../../../../packages/style/src/services/color-scheme.service.ts","../../../../packages/style/src/sass/animation/vars/index.ts","../../../../packages/style/src/ngutil-style.ts"],"sourcesContent":["import { inject, NgZone } from \"@angular/core\"\n\nimport { distinctUntilChanged, Observable, shareReplay, Subscriber } from \"rxjs\"\n\nconst WATCHES: { [key: string]: Observable<boolean> } = {}\n\n/**\n * watchMedia(\"(display-mode: standalone)\")\n */\nexport function watchMedia(expr: string): Observable<boolean> {\n const existing = WATCHES[expr]\n if (existing == null) {\n return (WATCHES[expr] = _createWatcher(expr))\n }\n return existing\n}\n\nfunction _createWatcher(expr: string): Observable<boolean> {\n const zone = inject(NgZone)\n return zone.runOutsideAngular(() =>\n new Observable((sub: Subscriber<boolean>) => {\n const query = window.matchMedia(expr)\n const listener = (event: MediaQueryListEvent) => {\n sub.next(event.matches)\n }\n query.addEventListener(\"change\", listener)\n sub.next(query.matches)\n return () => {\n query.removeEventListener(\"change\", listener)\n delete WATCHES[expr]\n }\n }).pipe(distinctUntilChanged(), shareReplay(1))\n )\n}\n","import { Injectable } from \"@angular/core\"\n\nimport { map, shareReplay } from \"rxjs\"\n\nimport { watchMedia } from \"./media-watcher\"\n\n@Injectable({ providedIn: \"root\" })\nexport class ColorSchemeService {\n readonly isDark = watchMedia(\"(prefers-color-scheme: dark)\")\n readonly isLight = this.isDark.pipe(\n map(v => !v),\n shareReplay(1)\n )\n\n // TODO: set preferred color scheme (dark/light)\n}\n","/* eslint-disable */\n/* eslint-disable prettier/prettier */\n/* ! AUTO GENERATED DO NOT EDIT ! */\n\nexport class Ease {\n static readonly Deceleration = \"cubic-bezier(0, 0, 0.2, 1)\" as const\n static readonly Standard = \"cubic-bezier(0.4, 0, 0.2, 1)\" as const\n static readonly Acceleration = \"cubic-bezier(0.4, 0, 1, 1)\" as const\n static readonly Sharp = \"cubic-bezier(0.4, 0, 0.6, 1)\" as const\n /**\n * Reach nearly end position fast, and slowly move to final position\n */\n static readonly Emphasized = \"cubic-bezier(0.12, 0.9, 0.12, 0.9)\" as const\n}\n\nexport class Duration {\n static readonly Fast = \"200ms\" as const\n static readonly FastMs = 200 as const\n static readonly Medium = \"300ms\" as const\n static readonly MediumMs = 300 as const\n static readonly Slow = \"400ms\" as const\n static readonly SlowMs = 400 as const\n static readonly Snail = \"600ms\" as const\n static readonly SnailMs = 600 as const\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA,MAAM,OAAO,GAA2C,EAAE,CAAA;AAE1D;;AAEG;AACG,SAAU,UAAU,CAAC,IAAY,EAAA;AACnC,IAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAC9B,IAAA,IAAI,QAAQ,IAAI,IAAI,EAAE;QAClB,QAAQ,OAAO,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,EAAC;KAChD;AACD,IAAA,OAAO,QAAQ,CAAA;AACnB,CAAC;AAED,SAAS,cAAc,CAAC,IAAY,EAAA;AAChC,IAAA,MAAM,I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,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA,CAAA,EAAA;;2FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACNlC;AACA;AACA;MAEa,IAAI,CAAA;aACG,IAAY,CAAA,YAAA,GAAG,4BAAqC,CAAA,EAAA;aACpD,IAAQ,CAAA,QAAA,GAAG,8BAAuC,CAAA,EAAA;aAClD,IAAY,CAAA,YAAA,GAAG,4BAAqC,CAAA,EAAA;aACpD,IAAK,CAAA,KAAA,GAAG,8BAAuC,CAAA,EAAA;AAC/D;;AAEG;aACa,IAAU,CAAA,UAAA,GAAG,oCAA6C,CAAA,EAAA;;MAGjE,QAAQ,CAAA;aACD,IAAI,CAAA,IAAA,GAAG,OAAgB,CAAA,EAAA;aACvB,IAAM,CAAA,MAAA,GAAG,GAAY,CAAA,EAAA;aACrB,IAAM,CAAA,MAAA,GAAG,OAAgB,CAAA,EAAA;aACzB,IAAQ,CAAA,QAAA,GAAG,GAAY,CAAA,EAAA;aACvB,IAAI,CAAA,IAAA,GAAG,OAAgB,CAAA,EAAA;aACvB,IAAM,CAAA,MAAA,GAAG,GAAY,CAAA,EAAA;aACrB,IAAK,CAAA,KAAA,GAAG,OAAgB,CAAA,EAAA;aACxB,IAAO,CAAA,OAAA,GAAG,GAAY,CAAA,EAAA;;;ACvB1C;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
package/index.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward "./src/sass/index.scss";
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngutil/style",
|
|
3
|
-
"version": "0.0.3-dev.
|
|
3
|
+
"version": "0.0.3-dev.17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"directory": "../../dist/packages/style/"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
9
|
"@angular/common": "^17.1.0",
|
|
10
|
-
"@angular/core": "^17.1.0"
|
|
10
|
+
"@angular/core": "^17.1.0",
|
|
11
|
+
"rxjs": "^7.8.1"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"tslib": "^2.3.0"
|
|
@@ -15,7 +16,8 @@
|
|
|
15
16
|
"sideEffects": false,
|
|
16
17
|
"exports": {
|
|
17
18
|
".": {
|
|
18
|
-
"sass": "./
|
|
19
|
+
"sass": "./index.scss",
|
|
20
|
+
"scss": "./index.scss",
|
|
19
21
|
"types": "./index.d.ts",
|
|
20
22
|
"esm2022": "./esm2022/ngutil-style.mjs",
|
|
21
23
|
"esm": "./esm2022/ngutil-style.mjs",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class Ease {
|
|
2
|
+
static readonly Deceleration: "cubic-bezier(0, 0, 0.2, 1)";
|
|
3
|
+
static readonly Standard: "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
4
|
+
static readonly Acceleration: "cubic-bezier(0.4, 0, 1, 1)";
|
|
5
|
+
static readonly Sharp: "cubic-bezier(0.4, 0, 0.6, 1)";
|
|
6
|
+
/**
|
|
7
|
+
* Reach nearly end position fast, and slowly move to final position
|
|
8
|
+
*/
|
|
9
|
+
static readonly Emphasized: "cubic-bezier(0.12, 0.9, 0.12, 0.9)";
|
|
10
|
+
}
|
|
11
|
+
export declare class Duration {
|
|
12
|
+
static readonly Fast: "200ms";
|
|
13
|
+
static readonly FastMs: 200;
|
|
14
|
+
static readonly Medium: "300ms";
|
|
15
|
+
static readonly MediumMs: 300;
|
|
16
|
+
static readonly Slow: "400ms";
|
|
17
|
+
static readonly SlowMs: 400;
|
|
18
|
+
static readonly Snail: "600ms";
|
|
19
|
+
static readonly SnailMs: 600;
|
|
20
|
+
}
|
package/sass/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Ease, Duration } from "./animation/vars";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* ! AUTO GENERATED DO NOT EDIT ! */
|
|
2
|
+
|
|
3
|
+
$ease-deceleration: cubic-bezier(0, 0, 0.2, 1) !default;
|
|
4
|
+
$ease-standard: cubic-bezier(0.4, 0, 0.2, 1) !default;
|
|
5
|
+
$ease-acceleration: cubic-bezier(0.4, 0, 1, 1) !default;
|
|
6
|
+
$ease-sharp: cubic-bezier(0.4, 0, 0.6, 1) !default;
|
|
7
|
+
/// Reach nearly end position fast, and slowly move to final position
|
|
8
|
+
$ease-emphasized: cubic-bezier(0.12, 0.9, 0.12, 0.9) !default;
|
|
9
|
+
$duration-fast: 200ms !default;
|
|
10
|
+
$duration-medium: 300ms !default;
|
|
11
|
+
$duration-slow: 400ms !default;
|
|
12
|
+
$duration-snail: 600ms !default;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
|
|
4
|
+
/// Detects if the given value is var name: `--var-name`
|
|
5
|
+
///
|
|
6
|
+
/// @param {string} $value value to be need to testing
|
|
7
|
+
/// @return {boolean} true if the given value is var name
|
|
8
|
+
@function is-var-name($value) {
|
|
9
|
+
@return type-of($value) == "string" and string.index($value, "--") == 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/// Detects if the given value is a var fn call: `var(--var-name)`
|
|
14
|
+
///
|
|
15
|
+
/// @param {string} $value value to be need to testing
|
|
16
|
+
/// @return {boolean} true if the given value is var call
|
|
17
|
+
@function is-var-fn($value) {
|
|
18
|
+
@return type-of($value) == "string" and string.index($value, "var(") == 1 and string.index($value, ")") == string.length($value);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/// Detects if the given value is var name or var fn
|
|
23
|
+
///
|
|
24
|
+
/// @param {string} $value value to be need to testing
|
|
25
|
+
/// @return {boolean} true if the given value is var name or var call
|
|
26
|
+
@function is-var($value) {
|
|
27
|
+
@return is-var-name($value) or is-var-fn($value);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@function _var-chain($vars, $idx) {
|
|
31
|
+
$res: "";
|
|
32
|
+
$curr: list.nth($vars, $idx);
|
|
33
|
+
|
|
34
|
+
@if (is-var-name($curr)) {
|
|
35
|
+
$res: "var(#{$curr}";
|
|
36
|
+
} @else {
|
|
37
|
+
@return $curr;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@if (list.length($vars) > $idx) {
|
|
41
|
+
@return string.unquote("#{$res}, #{_var-chain($vars, $idx + 1)})");
|
|
42
|
+
} @else {
|
|
43
|
+
@return string.unquote("#{$res})");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/// Chain variables like this: `var(--var-1, var(--var-2, var(--var-3, default-value)))`
|
|
49
|
+
///
|
|
50
|
+
/// @param {any} $vars variable names or default value
|
|
51
|
+
/// @return {string} the chained variables
|
|
52
|
+
@function var-chain($vars...) {
|
|
53
|
+
@if (list.length($vars) > 0) {
|
|
54
|
+
@return _var-chain($vars, 1);
|
|
55
|
+
} @else {
|
|
56
|
+
@return "";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/// Create configurable css variables:
|
|
62
|
+
///
|
|
63
|
+
/// @example
|
|
64
|
+
/// .nu-button {
|
|
65
|
+
/// @include nu.var-option(button-fg, #000);
|
|
66
|
+
/// // expands to:
|
|
67
|
+
/// ---button-fg: var(--button-fg, #000);
|
|
68
|
+
/// @include nu.var-option(button-hover-fg, ---button-fg, #000);
|
|
69
|
+
/// // expands to:
|
|
70
|
+
/// ---button-hover-fg: var(--button-hover-fg, var(---button-fg), #000);
|
|
71
|
+
/// }
|
|
72
|
+
@mixin var-option($name, $vars...) {
|
|
73
|
+
---#{$name}: #{var-chain(--#{$name}, $vars...)};
|
|
74
|
+
}
|
package/styles/index.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@use "./vars" as *;
|
package/styles/vars.scss
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
@use "sass:list";
|
|
2
|
-
@use "sass:string";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@function is-var($value) {
|
|
6
|
-
@return type-of($value) == "string" and string.index($value, "--") == 1;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@function is-varfn($value) {
|
|
10
|
-
@return type-of($value) == "string" and string.index($value, "var(") == 1 and string.index($value, ")") == string.length($value);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@function -chanin-var($vars, $idx) {
|
|
14
|
-
$res: "";
|
|
15
|
-
$curr: list.nth($vars, $idx);
|
|
16
|
-
|
|
17
|
-
@if (is-var($curr)) {
|
|
18
|
-
$res: "var(#{$curr}";
|
|
19
|
-
} @else {
|
|
20
|
-
@return $curr;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@if (list.length($vars) > $idx) {
|
|
24
|
-
@return string.unquote("#{$res}, #{-chanin-var($vars, $idx + 1)})");
|
|
25
|
-
} @else {
|
|
26
|
-
@return string.unquote("#{$res})");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@function chain-var($vars...) {
|
|
31
|
-
@if (list.length($vars) > 0) {
|
|
32
|
-
@return -chanin-var($vars, 1);
|
|
33
|
-
} @else {
|
|
34
|
-
@return "";
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/*
|
|
40
|
-
.button {
|
|
41
|
-
@include cvar(button-fg, --color, #000);
|
|
42
|
-
---button-fg: var(--button-fg, var(--color), #000);
|
|
43
|
-
}
|
|
44
|
-
*/
|
|
45
|
-
@mixin cvar($name, $defaults...) {
|
|
46
|
-
---#{$name}: #{chain-var(--#{$name}, $defaults...)};
|
|
47
|
-
}
|