|
7 | 7 | @use "sass:list" as *; |
8 | 8 | @use "../Theme/Getters" as *; |
9 | 9 | @use "../../options" as option; |
10 | | -@use "../../Modules/Utilities/index" as helper; |
11 | | -@use "Helpers"; |
| 10 | +@use "../../Modules/Utilities/index" as utility; |
| 11 | +@use "Helpers" as helper; |
12 | 12 |
|
13 | 13 | /// |
14 | 14 | /// Get options value by key |
|
24 | 24 | @function options($keys...) |
25 | 25 | { |
26 | 26 | @if length($keys) > 4 { |
27 | | - @warn "[PUNICA] The Maximum Nesting Depth is Restricted to 4."; |
| 27 | + @warn helper.$nesting-depth; |
28 | 28 | } |
29 | 29 |
|
30 | 30 | @if map.get(option.$options, nth($keys, 1)) == null { |
31 | | - @warn "[PUNICA] INVALID KEY: #{nth($keys, 1)}" + ' key is not found or key returns null in the [options.scss] file.'; |
| 31 | + @warn helper.$invalid-key + " #{nth($keys, 1)} " + helper.$key-not-found; |
32 | 32 | @return null; |
33 | 33 | } |
34 | 34 |
|
|
41 | 41 | $value: map.get($value, nth($keys, 2)); |
42 | 42 |
|
43 | 43 | @if $value == null { |
44 | | - @warn "[PUNICA] INVALID KEY: #{nth($keys, 1)} > #{nth($keys, 2)}" + ' key is not found or key returns null in the [options.scss] file.'; |
| 44 | + @warn helper.$invalid-key + " #{nth($keys, 1)} > #{nth($keys, 2)} " + helper.$key-not-found; |
45 | 45 | @return null; |
46 | 46 | } |
47 | 47 |
|
48 | 48 | @if length($keys) > 2 { |
49 | 49 | $value: map.get($value, nth($keys, 3)); |
50 | 50 | @if $value == null { |
51 | | - @warn "[PUNICA] INVALID KEY: #{nth($keys, 1)} > #{nth($keys, 2)} > #{nth($keys, 3)}" + ' key is not found or key returns null in the [options.scss] file.'; |
| 51 | + @warn helper.$invalid-key + " #{nth($keys, 1)} > #{nth($keys, 2)} > #{nth($keys, 3)} " + helper.$key-not-found; |
52 | 52 | @return null; |
53 | 53 | } |
54 | 54 |
|
55 | 55 | @if length($keys) > 3 { |
56 | 56 | $value: map.get($value, nth($keys, 4)); |
57 | 57 | @if $value == null { |
58 | | - @warn "[PUNICA] INVALID KEY: #{nth($keys, 1)} > #{nth($keys, 2)} > #{nth($keys, 3)} > #{nth($keys, 4)}" + ' key is not found or key returns null in the [options.scss] file.'; |
| 58 | + @warn helper.$invalid-key + " #{nth($keys, 1)} > #{nth($keys, 2)} > #{nth($keys, 3)} > #{nth($keys, 4)} " + helper.$key-not-found; |
59 | 59 | @return null; |
60 | 60 | } |
61 | 61 | } |
|
81 | 81 | $settings: map.get(map.get(options($node), 'settings'), nth($keys, 1)); |
82 | 82 |
|
83 | 83 | @if $settings == null { |
84 | | - @warn "[PUNICA] INVALID KEY: #{$node} > settings > #{nth($keys, 1)}" + ' key is not found or key returns null in the [options.scss] file.'; |
| 84 | + @warn helper.$invalid-key + " #{$node} > settings > #{nth($keys, 1)} " + helper.$key-not-found; |
85 | 85 | @return null; |
86 | 86 | } |
87 | 87 |
|
|
92 | 92 | $settings: map.get($settings, nth($keys, 2)); |
93 | 93 |
|
94 | 94 | @if $settings == null { |
95 | | - @warn "[PUNICA] INVALID KEY: #{$node} > settings > #{nth($keys, 1)} > #{nth($keys, 2)}" + ' key is not found or key returns null in the [options.scss] file.'; |
| 95 | + @warn helper.$invalid-key + " #{$node} > settings > #{nth($keys, 1)} > #{nth($keys, 2)} " + helper.$key-not-found; |
96 | 96 | @return null; |
97 | 97 | } |
98 | 98 |
|
99 | 99 | @if length($keys) > 2 { |
100 | 100 | $settings : map.get($settings, nth($keys, 3)); |
101 | 101 |
|
102 | 102 | @if $settings == null { |
103 | | - @warn "[PUNICA] INVALID KEY: #{$node} > settings > #{nth($keys, 1)} > #{nth($keys, 2)} > #{nth($keys, 3)}" + ' key is not found or key returns null in the [options.scss] file.'; |
| 103 | + @warn helper.$invalid-key + " #{$node} > settings > #{nth($keys, 1)} > #{nth($keys, 2)} > #{nth($keys, 3)} " + helper.$key-not-found; |
104 | 104 | @return null; |
105 | 105 | } |
106 | 106 | } |
|
147 | 147 | @return theme('utilities', $node, $key); |
148 | 148 | } |
149 | 149 |
|
150 | | - $util: if(map.has-key(helper.$helpers, $node), map.get(helper.$helpers, $node), null); |
| 150 | + $util: if(map.has-key(utility.$helpers, $node), map.get(utility.$helpers, $node), null); |
151 | 151 |
|
152 | 152 | @if ($util != null) and $key { |
153 | 153 | $util: if(map.has-key($util, $key), map.get($util, $key), null); |
|
0 commit comments