On this page
Risorse
La cartella assets può contenere file e sottocartelle che non appartengono ad altre directory. Puoi usarlo per:
- Stili JavaScript (devono essere all'interno di assets/js);
- Stili CSS (devono essere all'interno di assets/css);
- Immagini;
- Caratteri;
- Qualsiasi altra cosa che devi includere.
risorse/js
La directory assets/js è riservata e deve contenere solo file JavaScript. Per essere utilizzati dal widget, specificare questi file in manifest.json.
Per esempio:
"risorse": {
"js": ["class.widget.js"]
}
assets/css
assets/css is reserved and should only contain CSS style files. To be used by the widget, specify these files in the manifest.json.
For example:
"assets": {
"css": ["mywidget.css"]
}
CSS styles
CSS files may contain a custom attribute theme to define different style for a specific frontend themes.
Available themes and their attribute values:
- Blue - [theme='blue-theme']
- Dark - [theme='dark-theme']
- High-contrast light - [theme='hc-light']
- High-contrast dark - [theme='hc-dark']
Example:
.widget {
background-color: red;
}
[theme='dark-theme'] .widget {
background-color: green;
}