Skip to main content

CSS

Bundles and loads CSS stylesheets referred from JavaScript module dependendencies.

TODO: Write the documentation.

Load CSS bundle

Stylesheet bundles are loaded by a call to styleLoad in bundle indexes, for example:

define([
...
], {});

require(['require', 'css'], function (require, css) {
css.styleLoad(require, 'csui/bundles/csui-browse');
});

styleLoad(require, bundleName, separateRTLCSS?)

  • require - the require function required for the module, where the styleLoad is going to be called
  • bundleName - the name of the module bundle, for which the stylesheet will be loaded
  • separateRTLCSS - if the stylesheet for the RTL text-writing direction is in the same or in a separate file (default is true)

If separateRTLCSS is true or not specified and the selected UI language requires the RTL text-writing direction, the stylesheet name will include the suffix -rtl. The RTL stylesheet will be used instead of the default one:

Bundle nameLTR text-writing directionRTL text-writing direction
csui/bundles/csui-browsecsui/bundles/csui-browse.csscsui/bundles/csui-browse-rtl.css

If separateRTLCSS is false and the selected UI language requires the RTL text-writing direction, the default stylesheet name will be used. The default stylesheet is supposed to contain styles supporting both LTR and RTL text-writing direction:

Bundle nameLTR text-writing directionRTL text-writing direction
csui/bundles/csui-browsecsui/bundles/csui-browse.csscsui/bundles/csui-browse.css