How do I import third party css files for a Mendix widget?

0
It's the same question as below https://community.mendix.com/link/questions/85496   However, I get a 404 error " file not found for file: mxclientsystem/xstyle.js'' when I try to use xstyle as the example given. Also, it's unclear to me where the path starts.
asked
3 answers
2

I finally found a solution.

I guess this solution is best for third party css files and perhaps another solution is needed for wanting to use multiple self-created css files.

 

define([
    "dojo/_base/declare",
    ...
    "dojo/text!WidgetName/widget/template/WidgetName.html"
    
], function (declare, ..., widgetTemplate) {
    "use strict";

    var $ = _jQuery.noConflict(true);
    
    dom.addCss(require.toUrl("WidgetName/lib/path/to/file.css"));

    ...
...

 

answered
0

You probably use a css include in the widget. The 6.x widgets don't use that include but an implicit include of a css file called "[WidgetName].css".  Replace [WidgetName] with referenceSetSelector or xstyle or you widget name.

answered