@odx/icons 4.0.0-rc.20 → 4.0.0-rc.21
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 +4 -2
- package/dist/src/main.d.ts +1 -0
- package/dist/src/main.js +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ npm i @odx/icons@next
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
-
The library provides a custom element `<odx-icon>` to display icons. You can choose between different icon sets (
|
|
15
|
+
The library provides a custom element `<odx-icon>` to display icons. You can choose between different icon sets (core, safety, ...) or import individual icons to reduce your bundle size.
|
|
16
16
|
|
|
17
17
|
> **We rely on the esm module behavior in order to keep a global state.** If you load an asset from a CDN ensure that the same module of **@odx/assets-utils** is used throughout your application. One common technique is the usage of an [import map](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) (`<script type="importmap">`).
|
|
18
18
|
|
|
@@ -55,6 +55,8 @@ import '@odx/icons/core/user';
|
|
|
55
55
|
### CSS Property API
|
|
56
56
|
|
|
57
57
|
- **--color**: string - default: `currentColor`
|
|
58
|
+
- **--rotate**: string - default: `0deg`
|
|
59
|
+
- **--size**: string - default: `1em`
|
|
58
60
|
|
|
59
61
|
### HTML Example
|
|
60
62
|
|
|
@@ -89,7 +91,7 @@ import '@odx/icons/core';
|
|
|
89
91
|
|
|
90
92
|
// Create an icon dynamically
|
|
91
93
|
const icon = document.createElement('odx-icon');
|
|
92
|
-
icon.
|
|
94
|
+
icon.name='core::user'
|
|
93
95
|
|
|
94
96
|
document.body.appendChild(icon);
|
|
95
97
|
```
|
package/dist/src/main.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare class OdxIconElement extends OdxAssetElement {
|
|
|
14
14
|
readonly values: ["currentColor"];
|
|
15
15
|
readonly attributes: ["fill", "stroke"];
|
|
16
16
|
}];
|
|
17
|
+
static readonly styles: string[];
|
|
17
18
|
readonly namespace = "odx-icon";
|
|
18
19
|
readonly defaultSet = "core";
|
|
19
20
|
set name(value: OdxIconName);
|
package/dist/src/main.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { OdxAssetElement, registerAssetElement } from '@odx/assets-utils';
|
|
2
|
+
const styles = `
|
|
3
|
+
:host {
|
|
4
|
+
--rotate: 0deg;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
transform-origin: 50% 50%;
|
|
9
|
+
transform: rotate(var(--rotate));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
svg {
|
|
13
|
+
inline-size: 100%;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
2
17
|
export class OdxIconElement extends OdxAssetElement {
|
|
3
18
|
static assetAttributes = [
|
|
4
19
|
{ name: 'color', values: ['currentColor'], attributes: ['fill', 'stroke'] },
|
|
5
20
|
];
|
|
21
|
+
static styles = [styles];
|
|
6
22
|
namespace = 'odx-icon';
|
|
7
23
|
defaultSet = 'core';
|
|
8
24
|
set name(value) {
|
package/package.json
CHANGED