@infineon/infineon-icons 3.0.1--canary.37.4ee23d7945db0f7f037bf019bf5e28908f35552b.0 → 3.0.1--canary.37.5b2c65e606356fab86c2f090e0e7d85da841b0bc.0

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.
@@ -4,7 +4,7 @@
4
4
  font-style: normal;
5
5
  font-weight: 400;
6
6
 
7
- src: url("./iconfont.woff2?1730195331833") format("woff2"), url("./iconfont.woff?1730195331833") format("woff"), url("./iconfont.ttf?1730195331833") format("truetype");
7
+ src: url("./iconfont.woff2?1730198591681") format("woff2"), url("./iconfont.woff?1730198591681") format("woff"), url("./iconfont.ttf?1730198591681") format("truetype");
8
8
  }
9
9
 
10
10
  .icon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infineon/infineon-icons",
3
- "version": "3.0.1--canary.37.4ee23d7945db0f7f037bf019bf5e28908f35552b.0",
3
+ "version": "3.0.1--canary.37.5b2c65e606356fab86c2f090e0e7d85da841b0bc.0",
4
4
  "private": false,
5
5
  "description": "Infineon Icons",
6
6
  "license": "MIT",
package/readme.md CHANGED
@@ -54,6 +54,7 @@
54
54
  </ul>
55
55
  </li>
56
56
  <li><a href="#usage">Usage</a></li>
57
+ <li><a href="#usage-of-fonts-in-plain-html">Usage of Fonts in plain HTML</a></li>
57
58
  <li><a href="#contributing">Contributing</a></li>
58
59
  <li><a href="#license">License</a></li>
59
60
  <li><a href="#requesting-new-icons">License</a></li>
@@ -152,6 +153,304 @@ Include the icon as an SVG into your project:
152
153
 
153
154
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
154
155
 
156
+ ## Usage of Fonts in plain HTML
157
+
158
+ **Overview** The `infineon-icons` package provides a collection of SVG icons and an accompanying icon font. Integrating this font into your HTML project allows you to display icons by simply applying CSS classes to HTML elements, enhancing the visual appeal and user experience of your web pages.
159
+
160
+ ---
161
+
162
+ **Prerequisites**
163
+ - Basic understanding of HTML and CSS.
164
+
165
+ - A plain HTML project or webpage where you want to use the icons.
166
+
167
+
168
+ ---
169
+
170
+ Step 1: Obtain the `infineon-icons` Package** **Option 1: Install via NPM**
171
+ If you have Node.js and NPM installed, you can install the package using the following command:
172
+
173
+
174
+ ```bash
175
+ npm install infineon-icons --save
176
+ ```
177
+ This will download the package into your project's `node_modules` directory.**Option 2: Download Manually**
178
+ If you prefer not to use NPM, you can manually download the package:
179
+
180
+ 1. Visit the [NPM package page for infineon-icons](https://www.npmjs.com/package/infineon-icons) .
181
+
182
+ 2. Download the package archive or clone the repository if available.
183
+
184
+ 3. Extract the files to a directory in your project.
185
+
186
+
187
+ ---
188
+
189
+ **Step 2: Include Font Files and CSS in Your Project** **Locate the Necessary Files**
190
+ After obtaining the package, locate the following files:
191
+
192
+ - **Font Files** (formats like `.ttf`, `.woff`, `.woff2`):
193
+
194
+ ```
195
+ infineon-icons.ttf
196
+ infineon-icons.woff
197
+ infineon-icons.woff2
198
+ ```
199
+
200
+ - **CSS File** :
201
+
202
+ ```
203
+ infineon-icons.css
204
+ ```
205
+ **Copy Files to Your Project**
206
+ Organize the files within your project directory:
207
+
208
+ 1. **Create Directories** :
209
+ - **Fonts Directory** : `assets/fonts/`
210
+
211
+ - **CSS Directory** : `assets/css/`
212
+
213
+ 2. **Copy Font Files** :Copy the font files from `./node_modules/@infineon/infineon-icons/dist/fonts` into the `assets/fonts/` directory.
214
+
215
+ 3. **Copy CSS File** :Copy the `infineon-icons.css` file from `./node_modules/@infineon/infineon-icons/dist/fonts` into the `assets/css/` directory.
216
+ **Adjust Font Paths in CSS** Open `infineon-icons.css` and update the `@font-face` `src` paths to point to the correct location of the font files relative to the CSS file.
217
+
218
+ ```css
219
+ @font-face {
220
+ font-family: "infineon-icons";
221
+ src: url("../fonts/infineon-icons.woff2") format("woff2"),
222
+ url("../fonts/infineon-icons.woff") format("woff"),
223
+ url("../fonts/infineon-icons.ttf") format("truetype");
224
+ font-weight: normal;
225
+ font-style: normal;
226
+ }
227
+ ```
228
+
229
+
230
+ ---
231
+
232
+ **Step 3: Reference the CSS File in Your HTML** Include the CSS file in the `<head>` section of your HTML document.
233
+
234
+ ```html
235
+ <!DOCTYPE html>
236
+ <html lang="en">
237
+ <head>
238
+ <meta charset="UTF-8">
239
+ <title>Infineon Icons Example</title>
240
+ <!-- Include the Infineon Icons CSS -->
241
+ <link rel="stylesheet" href="assets/css/infineon-icons.css">
242
+ </head>
243
+ <body>
244
+ <!-- Your content will go here -->
245
+ </body>
246
+ </html>
247
+ ```
248
+
249
+
250
+ ---
251
+
252
+ **Step 4: Use the Icons in Your HTML** **Understanding the CSS Classes** The `infineon-icons.css` file defines CSS classes for each icon. There is a base class (e.g., `icon`) and modifier classes for each icon (e.g., `icon-home`, `icon-user`).**Example Usage**
253
+
254
+ ```html
255
+ <!-- Antenna Icon -->
256
+ <span class="icon icon-antenna" aria-hidden="true"></span>
257
+
258
+ <!-- Arrow Right Icon -->
259
+ <span class="icon icon-arrow-right" aria-hidden="true"></span>
260
+
261
+ <!-- Beginner Icon -->
262
+ <span class="icon icon-beginner" aria-hidden="true"></span>
263
+ ```
264
+ **Find Available Icon Classes** Open `infineon-icons.css` to see the list of available icon classes. Look for classes defined like:
265
+
266
+ ```css
267
+ .icon-antenna::before {
268
+ content: "\e905";
269
+ }
270
+
271
+ .icon-arrow-right::before {
272
+ content: "\e90b";
273
+ }
274
+
275
+ /* ...and so on */
276
+ ```
277
+
278
+
279
+ ---
280
+
281
+
282
+ **Accessibility Considerations** Ensuring your website is accessible to all users, including those with disabilities, is crucial. Below are guidelines to make your use of `infineon-icons` icon font more accessible.Use `aria-hidden="true"` for Decorative Icons**
283
+ - **Purpose** : Decorative icons do not convey essential information and should be hidden from assistive technologies to avoid confusion.
284
+
285
+ - **Action** : Add `aria-hidden="true"` to icons that are purely decorative.
286
+
287
+ ```html
288
+ <!-- Decorative icon -->
289
+ <span class="icon icon-decorative" aria-hidden="true"></span>
290
+ ```
291
+ **Use Tooltips**
292
+ - **Purpose** : Tooltips provide additional context or information about an icon when a user hovers over it.
293
+
294
+ - **Action** : Use the `title` attribute to add tooltips to icons, and provide accessible text using `aria-label` if the icon is interactive.
295
+
296
+ ```html
297
+ <!-- Icon with tooltip -->
298
+ <button aria-label="Help">
299
+ <span class="icon icon-help" aria-hidden="true" title="Get Help"></span>
300
+ </button>
301
+ ```
302
+ **Note** : The `title` attribute may not be consistently read by screen readers, so always pair it with `aria-label` for accessibility.
303
+ Use `role="img"` When Appropriate**
304
+ - **Purpose** : When an icon conveys important information or serves as the sole content within an element, use `role="img"` to indicate it's an image.
305
+
306
+ - **Action** : Apply `role="img"` and provide an `aria-label` to describe the icon's purpose.
307
+
308
+ ```html
309
+ <!-- Icon conveying important information -->
310
+ <span class="icon icon-warning" role="img" aria-label="Warning: Action Required"></span>
311
+ ```
312
+ **Implementing a Visually Hidden Class**
313
+ - **Purpose** : Visually hidden text provides information to screen readers without displaying it on the screen.
314
+
315
+ - **Action** : Use a CSS class to hide text visually but keep it accessible to assistive technologies.
316
+
317
+ ```css
318
+ .visually-hidden {
319
+ position: absolute;
320
+ width: 1px;
321
+ height: 1px;
322
+ padding: 0;
323
+ margin: -1px;
324
+ overflow: hidden;
325
+ clip: rect(0, 0, 0, 0);
326
+ white-space: nowrap;
327
+ border: 0;
328
+ }
329
+ ```
330
+ **Usage Example:**
331
+
332
+ ```html
333
+ <button>
334
+ <span class="icon icon-delete" aria-hidden="true"></span>
335
+ <span class="visually-hidden">Delete item</span>
336
+ </button>
337
+ ```
338
+
339
+ In this example, the visible icon is hidden from screen readers, while the text "Delete item" is hidden visually but read by screen readers.
340
+
341
+
342
+ ---
343
+
344
+ **Advanced Usage** **Using Icons in Buttons or Links**
345
+
346
+ ```html
347
+ <!-- Icon with text label -->
348
+ <button>
349
+ <span class="icon icon-download" aria-hidden="true"></span> Download
350
+ </button>
351
+
352
+ <!-- Icon-only button with accessible label -->
353
+ <button aria-label="Refresh">
354
+ <span class="icon icon-refresh" aria-hidden="true"></span>
355
+ </button>
356
+ ```
357
+ **Styling Icons with Pseudo-elements**
358
+ You can apply icons using CSS pseudo-elements to keep your HTML cleaner.
359
+
360
+
361
+ ```css
362
+ /* CSS */
363
+ .button-print::before {
364
+ content: "";
365
+ display: inline-block;
366
+ font-family: "infineon-icons";
367
+ font-style: normal;
368
+ font-weight: normal;
369
+ speak: none;
370
+ font-size: 16px;
371
+ line-height: 1;
372
+ vertical-align: middle;
373
+ margin-right: 8px;
374
+ /* Use the appropriate Unicode from the CSS */
375
+ content: "\e903"; /* Replace with the desired icon code */
376
+ }
377
+ ```
378
+
379
+
380
+ ```html
381
+ <!-- HTML -->
382
+ <button class="button-print">Print Page</button>
383
+ ```
384
+ **Ensuring Keyboard Accessibility**
385
+ Make sure all interactive elements are focusable and operable via keyboard.
386
+
387
+
388
+ ```html
389
+ <!-- Focusable button with icon -->
390
+ <button aria-label="Close">
391
+ <span class="icon icon-close" aria-hidden="true"></span>
392
+ </button>
393
+ ```
394
+
395
+
396
+ ---
397
+
398
+ **Example Project Structure**
399
+
400
+ ```
401
+ project/
402
+ ├── assets/
403
+ │ ├── css/
404
+ │ │ ├── infineon-icons.css
405
+ │ │ └── styles.css
406
+ │ └── fonts/
407
+ │ ├── infineon-icons.ttf
408
+ │ ├── infineon-icons.woff
409
+ │ └── infineon-icons.woff2
410
+ ├── index.html
411
+ └── other-files...
412
+ ```
413
+ ---
414
+
415
+ **Troubleshooting** **Icons Not Displaying**
416
+ - **Check Font Paths** : Ensure the paths in the `@font-face` declaration within `infineon-icons.css` correctly point to the font files.
417
+
418
+ - **File Names** : Verify that the font file names match those referenced in the CSS file.
419
+
420
+ - **Browser Cache** : Clear your browser cache to make sure it's loading the latest files.
421
+
422
+ - **Incorrect Icon Appearing** : Make sure the Unicode values in the CSS correspond to the correct icons.
423
+
424
+ - **Class Names** : Verify that you're using the correct class names as defined in `infineon-icons.css`.
425
+
426
+ - **CSS Specificity** : If your icons aren't styling as expected, check if other CSS rules are overriding your styles.
427
+
428
+ - **Font Size and Line Height** : Adjust `font-size` and `line-height` to achieve the desired appearance.
429
+
430
+
431
+ ---
432
+
433
+ **Additional Resources**
434
+ - **Infineon Icons NPM Page** : [npmjs.com/package/infineon-icons](https://www.npmjs.com/package/infineon-icons)
435
+
436
+ - **Web Accessibility Initiative (WAI)** : [Using ARIA](https://www.w3.org/WAI/ARIA/apg/)
437
+
438
+ - **MDN Web Docs** :
439
+ - [ARIA Techniques](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques)
440
+
441
+ - [@font-face](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face)
442
+
443
+
444
+ - **WCAG Guidelines** : [Web Content Accessibility Guidelines (WCAG) 2.1](https://www.w3.org/TR/WCAG21/)
445
+
446
+ - **CSS-Tricks** : [Using Icon Fonts in Your Website](https://css-tricks.com/examples/IconFont/)
447
+
448
+
449
+ ---
450
+
451
+ **Feel free to reach out if you have any more questions or need further assistance!**
452
+
453
+
155
454
  <!-- CONTRIBUTING -->
156
455
  ## Contributing
157
456