line-md 3.0.4 → 3.0.5

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.
Files changed (3) hide show
  1. package/README.md +14 -15
  2. package/css.json +0 -1221
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -78,39 +78,38 @@ JSON format has the following properties:
78
78
 
79
79
  - `content` contains SVG content, as string.
80
80
  - `viewBox` contains icon viewBox attribute value, as object.
81
- - `classes` contains list of used CSS classes, where key is class name, value is an object (see below).
81
+ - `classes` contains list of used CSS classes, where key is class name, value is string with rules.
82
+ - `animations` is the same as `classes`, but for animation rules, so you can wrap it in `@media not (prefers-reduced-motion)` if needed.
82
83
  - `keyframes` contains list of used animations, where key is an animation name, value is CSS.
83
84
 
84
- Classes property is an object, with the following keys (all keys are optional):
85
+ This is the final format used in [SVG Utils](https://github.com/cyberalien/svg-utils) package, supported by [Iconify Unplugin](https://github.com/iconify/iconify-unplugin).
85
86
 
86
- - `rules` contains rules as string.
87
- - `animation` contains rules for animations, as string. It is separate from `rules`, so you can wrap it in `@media not (prefers-reduced-motion)` if needed to make sure icons are not animated for users that prefer non-animated icons.
87
+ Also, `@iconify-vue/line-md` and `@iconify-svelte/line-md` have pre-made components that are generated from this data and use CSS animations, see [Iconify documentation](https://iconify.design/docs/usage/svg-css/).
88
88
 
89
89
  TypeScript type used in generator for exporting these JSON files:
90
90
 
91
91
  ```ts
92
- interface CSSJSONExport {
92
+ // From @cyberalien/svg-utils/lib/svg-css/icon/types.js
93
+ // Reduced to include only properties used in this icon set, all rules and
94
+ // keyframes in this repository are converted to strings to simplify parsing.
95
+ interface SVGCSSIcon {
93
96
  // SVG content
94
97
  content: string;
95
98
 
96
99
  // viewBox
97
- viewBox: IconViewBox;
100
+ viewBox: IconViewBox | string;
98
101
 
99
102
  // Classes, key is class name
100
- classes: Record<string, CSSJSONExportRules>;
103
+ classes: Record<string, string>;
104
+
105
+ // Animations for classes
106
+ // Same as 'classes', but for animation properties, so it can be separated in the output CSS
107
+ animations?: Record<string, string>;
101
108
 
102
109
  // Used keyframes, key is animation name
103
110
  keyframes?: Record<string, string>;
104
111
  }
105
112
 
106
- interface CSSJSONExportRules {
107
- // Basic rules, excluding animations
108
- rules: string;
109
-
110
- // Rules used by animations
111
- animation?: string;
112
- }
113
-
114
113
  // From @cyberalien/svg-utils/lib/svg/viewbox/types.js
115
114
  interface IconViewBox {
116
115
  left?: number;