Dojo小部件(widget)和样式(themes)自定义

读2012的一篇博文,上面用到了小部件widget。以css后缀命名的叫样式。

widget是dojo最吸引人的地方,估计这也是arcgis api for javascript如此青睐它的原因吧。。?

小部件和样式的关系是?

包含关系。小部件widget包含样式css文件。

Dijit is a widget system layered on top of Dojo. If you are new to the whole Dojo experience, Dijit is a good place to start. You can build amazing Web 2.0 GUI’s using very little, or no, JavaScript (though having an understanding of JavaScript will take you a long way, as will a good understanding of HTML and CSS).

Dijit是一个小部件系统。如果你是dojo新手,那么Dijit是一个好的开始。因为,你可以使用少量或者几乎不用JavaScript便可以创建出绚丽的Web2.0 GUI用户界面。(当然如果你对HTML和CSS有很好的理解将使你走的更远,同样JavaScript也是如此)

您可以通过以下两种方式之一使用Dijit:

通过在常规HTML标记中使用特殊属性以声明方式使用Dijit,以及通过JavaScript以编程方式使用Dijit(欢迎您根据需要混合和匹配这两种样式)。不管怎样,你都有相同的选择。

https://dojotoolkit.org/reference-guide/1.10/dijit/info.html#dijit-info

Themes and Theming(主题)

Dijit Themes lend a consistent look and feel to widgets. Themes are collections of images (icons and background images) and CSS files that bring a common visual style (font, color, texture, layout, animation, etc.) to all the widgets. Dijit comes bundled with four themes which can be used as is or modified, and users can write their own themes too. Both global theming (such as at a container level) and widget-specific theming is possible.

Dijit主题样式为小部件提供了一致的外观和感觉。主题是图像(图标和背景图像)和CSS文件的集合,它们为所有小部件带来共同的视觉样式(字体、颜色、纹理、布局、动画等)。Dijit附带了四个主题,可以按原样使用或修改,用户也可以编写自己的主题。全局主题化(比如在容器级别)和小部件特定的主题化都是可能的。

https://dojotoolkit.org/reference-guide/1.10/dijit/themes.html#dijit-themes

https://dojotoolkit.org/reference-guide/1.10/dijit/index.html

》》相关阅读:

  Dojo - Creating a custom widget创建自定义小部件:https://blog.csdn.net/nmj2008/article/details/113554363

原文地址:https://www.cnblogs.com/2008nmj/p/14357831.html