amateras 0.1.0 → 0.1.1
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/README.md +2 -2
- package/ext/css/src/index.ts +3 -2
- package/package.json +1 -1
- package/src/core.ts +4 -0
package/README.md
CHANGED
|
@@ -85,6 +85,6 @@ $(document.body).content([
|
|
|
85
85
|
## Packages
|
|
86
86
|
|-|-|
|
|
87
87
|
|Package name|Size|Size(gzip)|Description|
|
|
88
|
-
|amateras|5.
|
|
88
|
+
|amateras|5.56 kB|2.35 kB|Core
|
|
89
89
|
|amateras/html|0.66 kB|0.28 kB|Import HTMLElement types and methods|
|
|
90
|
-
|[amateras/css](./ext/css/README.md)|3.
|
|
90
|
+
|[amateras/css](./ext/css/README.md)|3.74 kB|1.40 kB|Style in JS|
|
package/ext/css/src/index.ts
CHANGED
|
@@ -90,8 +90,9 @@ function createKeyframesRule(name: string, options: $CSSKeyframesType) {
|
|
|
90
90
|
function insertRule(rule: $CSSRule, recursive = false) {
|
|
91
91
|
if (_instanceof(rule, $CSSStyleRule) && !CSS.supports(`selector(${rule.selector})`)) return rule;
|
|
92
92
|
stylesheet.insertRule(rule.css, stylesheet.cssRules.length);
|
|
93
|
-
if (
|
|
94
|
-
|
|
93
|
+
if (_instanceof(rule, $CSSKeyframesRule)) return rule;
|
|
94
|
+
if (!_instanceof(rule, $CSSMediaRule)) rule.rules.forEach(rule => insertRule(rule));
|
|
95
|
+
else if (!recursive) rule.mediaRules.forEach(rule => insertRule(rule, true));
|
|
95
96
|
return rule;
|
|
96
97
|
}
|
|
97
98
|
|
package/package.json
CHANGED
package/src/core.ts
CHANGED
|
@@ -80,6 +80,10 @@ export namespace $ {
|
|
|
80
80
|
export function orArrayResolver<T>(item: OrArray<T>): T[] {
|
|
81
81
|
return _instanceof(item, Array) ? item : [item];
|
|
82
82
|
}
|
|
83
|
+
|
|
84
|
+
export function span(content: string) {
|
|
85
|
+
return $('span').content(content);
|
|
86
|
+
}
|
|
83
87
|
}
|
|
84
88
|
export type $ = typeof $;
|
|
85
89
|
globalThis.$ = $;
|