Version 2
What is new? Migration Guide From V1
Getting Started
Understanding WinnetouJs Setting Up
Constructos
Creating Constructos Advanced Options Lazy Loading
Mutables
Constructos State Management Case: Custom State Management System Winnetou FX
Addons
Winnetou Selectors Winnetou Router App Translations CSS Sass Built-in Transpiler SVG Icons Color Themes
Extras
Useful JsDoc Syntax
Plugins
Creating Plugins SlideScreen Official Plugin Animate Official Plugin
Compiling to Production
WBR
API Change Log Git Hub Pull Requests Guidelines Get in touch
Addons

SVG Icons

If we are not careful using icons in our application it can be a problem as we may be carrying more icons than we are actually using and penalizing the user with an unnecessary load of data being trafficked. Therefore, WinnetouJs uses a different way of using icons. You should place your icons in svg format inside your icon folder and let WBR transform only the icons that you will actually use in javascript classes.

If you have for example "./icons/trash.svg", WBR will compile to "./js/constructos/_icons.js" and importing this file we will have the class "icons_trash()", You can separate the icons into folders and subfolders, like this:

./icons/trash.svg ./icons/like.svg // ./js/constructos/_icons.js ./icons/material/home.svg // ./js/constructos/_icons_material.js ./icons/dark/home.svg // ./js/constructos/_icons_dark.js

The icons have only one element, class, which serves to associate a style to the icon, remember, to change icon color user fill css property.

myAwesomeApp.js


import { Winnetou } from "winnetoujs";
import { h1 } from "./constructos/componentsTest.js";        
import { icons_star } from "./constructos/_icons.js";

// using constructoString method
const iconStar = icons_star().constructoString();        
h1({ text: iconStar + ' this is an awesome icon!' })
.create("#app");

// using create method
icons_star().create("#app");