Pluggable Widgets: Custom CSS filename

0
Is it possible to specify a different CSS filename for pluggable widgets? As far as I understand, there is an implicit include of [WidgetName].css when a widget is loaded, but I would like to share a CSS file between a couple of widgets, which are both located next to it in my output, e.g.:   widgetFolder/ ui/ common.css widget1/ widget1.js widget2/ widget2.js Widget1/ Widget1.xml Widget2/ Widget2.xml How can I include common.css? Can it be set in the xml file of the widgets, or the package.xml?
asked
1 answers
0

Hi James, 

When working with Pluggable widget, you can import CSS, when you are using the widget tools from the generator

https://docs.mendix.com/howto/extensibility/create-a-pluggable-widget-one

For your case multiple widgets, the tools might not work. But you have to create one output in the bundle folder ui it can have any name also common.css

Before it was different, it has changed 7.12 See release notes https://docs.mendix.com/releasenotes/studio-pro/7.12#fixes

For custom widgets, previously only one CSS file named after the widget and placed under the **ui** folder was included in an application. The name of the file was case-insensitive on Windows, because the Windows file system is case-insensitive. However, when running in the cloud, the file system is case-sensitive. This led to different behavior when running locally or in the cloud. In addition, when you had multiple *.css* files for your custom widget, you needed to bundle them yourself. Now, all CSS files in the widget bundle are included, except the ones placed under the **lib** folder. So, if your custom widget bundle contains multiple CSS files, they will all be included in the CSS file. If that is not the behavior you want, you should remove obsolete CSS files from your custom widget bundle, or move them to the **lib** folder, which is also excluded from the bundling. (Ticket 48214)

Cheers, Andries

answered