<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Using LESS</title><link>https://community.telligent.com/community/11/w/developer-training/67232/using-less</link><description /><dc:language>en-US</dc:language><generator>14.0.0.586 14</generator><item><title>Using LESS</title><link>https://community.telligent.com/community/11/w/developer-training/67232/using-less</link><pubDate>Wed, 05 Aug 2020 16:17:53 GMT</pubDate><guid isPermaLink="false">cb7761eb-6cc7-4a1f-a0b2-2a21792e37ed</guid><dc:creator>Former Member</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/67232/using-less#comments</comments><description>Current Revision posted to Developer Training by Former Member on 08/05/2020 16:17:53&lt;br /&gt;
&lt;p&gt;[[Scripting|Scripted customizations]] often&amp;nbsp;output HTML&amp;nbsp;content. When rendering CSS to help with the layout and styling of that content, Verint Community provides support for LESS, a processed extension to CSS.&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="What_is_LESS" name="What_is_LESS"&gt;&lt;/a&gt;What is LESS?&lt;/h2&gt;
&lt;p&gt;LESS is a set of extensions to cascading style sheets (CSS) that make defining styling metadata easier by introducing nesting, variables, functions, and more. LESS is processed by Verint Community and output as standard CSS to web clients (LESS is not natively understood by web browsers). Verint Community uses dotLess, which is a port of the less.js implementation of the LESS language.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Nesting" name="Nesting"&gt;&lt;/a&gt;Nesting&lt;/h3&gt;
&lt;p&gt;In CSS, context-specific style rules are defined as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But with LESS, they can be nested to simplify the child selectors:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget .field-list .field-item {
    .name { color: #333; }
    .input { color: #333; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Variables" name="Variables"&gt;&lt;/a&gt;Variables&lt;/h3&gt;
&lt;p&gt;In CSS, similar values often are repeated which makes updates difficult:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In LESS, these can be abstracted into a variable so the value can be set in a single location:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@foreground-color: #333;
.content-fragment.my-widget .field-list .field-item .name { color: @foreground-color; }
.content-fragment.my-widget .field-list .field-item .input { color: @foreground-color; }&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Functions" name="Functions"&gt;&lt;/a&gt;Functions&lt;/h3&gt;
&lt;p&gt;Functions in LESS enable descriptive adjustments to style data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@foreground-color: #33;
.content-fragment.my-widget .field-list .field-item {
    .name { color: lighten(@foreground-color, 10%); }
    .input { color: @foreground-color; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="LESS_Language_Documentation" name="LESS_Language_Documentation"&gt;&lt;/a&gt;LESS Language Documentation&lt;/h3&gt;
&lt;p&gt;For documentation on the LESS language, see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/dotless/dotless/wiki"&gt;dotLess Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/features/"&gt;less.js Language Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/functions/"&gt;less.js Function Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a id="How_can_I_use_LESS" name="How_can_I_use_LESS"&gt;&lt;/a&gt;How can I use LESS?&lt;/h2&gt;
&lt;p&gt;In [[Themes]], LESS files included in the &amp;quot;Style Sheets&amp;quot; node under the theme in [[Working with Theme Studio|Theme Studio]] are automatically rendered. LESS files can be created as embedded files in any [[Scripting|scriptable customization]], however, and included in HTML output by using &lt;code&gt;core_v2_widget.GetExecutedFileUrl(&amp;#39;NAME_OF_LESS_FILE&amp;#39;)&lt;/code&gt; and rendering it directly into a &lt;code&gt;&amp;lt;link /&amp;gt;&lt;/code&gt; tag or by using the &lt;code&gt;core_v2_page.AddLink()&lt;/code&gt; API, for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="velocity"&gt;$core_v2_page.AddLink(&amp;#39;stylesheet&amp;#39;, $core_v2_widget.GetExecutedFileUrl(&amp;#39;style.less&amp;#39;), &amp;quot;%{ Position = &amp;#39;AfterTheme&amp;#39; }&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Because LESS is processed, it is important to use &lt;code&gt;core_v2_widget.GetExecutedFileUrl()&lt;/code&gt; to resolve the LESS to standard CSS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LESS is a syntax-sensitive language. When errors occur while processing LESS, the error message will be returned as the content of the processed file, the message will be logged as an &amp;quot;Unknown&amp;quot; error in the exceptions log (&lt;strong&gt;Administration &amp;gt; Monitoring &amp;gt; Exceptions&lt;/strong&gt;), and, for themes, errors are also sent as system notifications to administrators of the community.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Community_LESS_Functions" name="Community_LESS_Functions"&gt;&lt;/a&gt;Community LESS Functions&lt;/h2&gt;
&lt;p&gt;When using LESS, you can make use of the base LESS language features as well as [[api-documentation:Less Functions|Verint Community-specific functions]] that make integrating with community functionality easier.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Configuration_Functions" name="Theme_Configuration_Functions"&gt;&lt;/a&gt;Theme Configuration Functions&lt;/h3&gt;
&lt;p&gt;Instead of defining local variables, it is often beneficial to define [[Using Dynamic Configuration|dynamic configuration]] options to end-users to adjust styling options. When defined by a [[Themes|theme]], configuration options can be read within LESS files using functions prefixed with &lt;code&gt;-evo-themeconfig&lt;/code&gt;, for example, [[api-documentation:-evo-themeconfig-color LESS Function|-evo-themeconfig-color]]:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget {
    color: -evo-themeconfig-color(&amp;#39;foregroundColor&amp;#39;, &amp;#39;#000&amp;#39;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would set the color of text in the widget to the color defined by the theme configuration property &amp;quot;foregroundColor&amp;quot;. If &amp;quot;foregroundColor&amp;quot; was defined by the theme (or the data type was not color), the default color, #000, would be used.&lt;/p&gt;
&lt;p&gt;Theme configuration, other than [[api-documentation:-evo-themeconfig-embeddedurl LESS Function|-evo-themeconfig-embeddedurl]], can be read from all [[Scripting|scriptable customizations]], not just [[Themes|themes]].&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Palette_Functions" name="Theme_Palette_Functions"&gt;&lt;/a&gt;Theme Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palettes to retrieve configured values for a specific palette type, paletted, and value ID using functions prefixed with &lt;code&gt;-evo-themepalette&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_File_Functions" name="Theme_File_Functions"&gt;&lt;/a&gt;Theme File Functions&lt;/h3&gt;
&lt;p&gt;LESS files within a theme can reference other embedded files within the theme using the [[api-documentation:-evo-themefile-url Less Function|-evo-themefile-url]] function. For example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-themefile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-themefile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the theme and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the theme.&lt;/p&gt;
&lt;p&gt;Note that the &lt;code&gt;-evo-themefile-url&lt;/code&gt; function can only be used within a theme. Other [[Scripting|scriptable customizations]] cannot use it within their embedded LESS files.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Configuration_Functions" name="Widget_Configuration_Functions"&gt;&lt;/a&gt;Widget Configuration Functions&lt;/h3&gt;
&lt;p&gt;Similar to theme configuration functions, widget configuration functions provide access to retrieve configuration data from the currently executing [[Scripting|scripted customization]]. Widget configuration functions are prefixed &lt;code&gt;-evo-widgetconfig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When executing scripts within a [[Themes|theme]], the &lt;code&gt;-evo-widgetconfig-X&lt;/code&gt; and &lt;code&gt;-evo-themeconfig-X&lt;/code&gt; functions will return the same results.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_File_Functions" name="Widget_File_Functions"&gt;&lt;/a&gt;Widget File Functions&lt;/h3&gt;
&lt;p&gt;LESS files embedded within the currently executing [[Scripting|scriptable customization]] can be referenced using the [[api-documentation:-evo-widgetfile-url LESS Function|-evo-widgetfile-url]] function. For example,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-widgetfile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-widgetfile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the current scripted customization and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the scripted customization.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Palette_Functions" name="Widget_Palette_Functions"&gt;&lt;/a&gt;Widget Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palette selections made by widget [[Using Dynamic Configuration|configuration options]] using functions prefixed with &lt;code&gt;-evo-widgetpalette&lt;/code&gt;.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;a id="Best_Practices" name="Best_Practices"&gt;&lt;/a&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Make use of configuration options and palette selections to expose styling customization to end users and use the Verint Community LESS functions to retrieve those values.&lt;/li&gt;
&lt;li&gt;Apply generic styling (applying to multiple/all widgets) to [[Themes]] and any widget-specific styling should be defined within the widget that makes use of it. This keeps the widget markup and styling together and ensures easier upgrades.&lt;/li&gt;
&lt;li&gt;If your LESS is complex, consider breaking it into multiple files with &lt;code&gt;@import&lt;/code&gt; directives referencing the sub-components.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: best practices, less&lt;/div&gt;
</description></item><item><title>Using LESS</title><link>https://community.telligent.com/community/11/w/developer-training/67232/using-less/revision/5</link><pubDate>Thu, 26 Mar 2020 18:24:58 GMT</pubDate><guid isPermaLink="false">cb7761eb-6cc7-4a1f-a0b2-2a21792e37ed</guid><dc:creator>Ben Tiedt</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/67232/using-less#comments</comments><description>Revision 5 posted to Developer Training by Ben Tiedt on 03/26/2020 18:24:58&lt;br /&gt;
&lt;p&gt;[[Scripting|Scripted customizations]] often&amp;nbsp;output HTML&amp;nbsp;content. When rendering CSS to help with the layout and styling of that content, Verint Community provides support for LESS, a processed extension to CSS.&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="What_is_LESS" name="What_is_LESS"&gt;&lt;/a&gt;What is LESS?&lt;/h2&gt;
&lt;p&gt;LESS is a set of extensions to cascading style sheets (CSS) that make defining styling metadata easier by introducing nesting, variables, functions, and more. LESS is processed by Verint Community and output as standard CSS to web clients (LESS is not natively understood by web browsers). Verint Community uses dotLess, which is a port of the less.js implementation of the LESS language.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Nesting" name="Nesting"&gt;&lt;/a&gt;Nesting&lt;/h3&gt;
&lt;p&gt;In CSS, context-specific style rules are defined as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But with LESS, they can be nested to simplify the child selectors:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget .field-list .field-item {
    .name { color: #333; }
    .input { color: #333; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Variables" name="Variables"&gt;&lt;/a&gt;Variables&lt;/h3&gt;
&lt;p&gt;In CSS, similar values often are repeated which makes updates difficult:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In LESS, these can be abstracted into a variable so the value can be set in a single location:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@foreground-color: #333;
.content-fragment.my-widget .field-list .field-item .name { color: @foreground-color; }
.content-fragment.my-widget .field-list .field-item .input { color: @foreground-color; }&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Functions" name="Functions"&gt;&lt;/a&gt;Functions&lt;/h3&gt;
&lt;p&gt;Functions in LESS enable descriptive adjustments to style data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@foreground-color: #33;
.content-fragment.my-widget .field-list .field-item {
    .name { color: lighten(@foreground-color, 10%); }
    .input { color: @foreground-color; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="LESS_Language_Documentation" name="LESS_Language_Documentation"&gt;&lt;/a&gt;LESS Language Documentation&lt;/h3&gt;
&lt;p&gt;For documentation on the LESS language, see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/dotless/dotless/wiki"&gt;dotLess Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/features/"&gt;less.js Language Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/functions/"&gt;less.js Function Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a id="How_can_I_use_LESS" name="How_can_I_use_LESS"&gt;&lt;/a&gt;How can I use LESS?&lt;/h2&gt;
&lt;p&gt;In [[Themes]], LESS files included in the &amp;quot;Style Sheets&amp;quot; node under the theme in [[Working with Theme Studio|Theme Studio]] are automatically rendered. LESS files can be created as embedded files in any [[Scripting|scriptable customization]], however, and included in HTML output by using &lt;code&gt;core_v2_widget.GetExecutedFileUrl(&amp;#39;NAME_OF_LESS_FILE&amp;#39;)&lt;/code&gt; and rendering it directly into a &lt;code&gt;&amp;lt;link /&amp;gt;&lt;/code&gt; tag or by using the &lt;code&gt;core_v2_page.AddLink()&lt;/code&gt; API, for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="velocity"&gt;$core_v2_page.AddLink(&amp;#39;stylesheet&amp;#39;, $core_v2_widget.GetExecutedFileUrl(&amp;#39;style.less&amp;#39;), &amp;quot;%{ Position = &amp;#39;AfterTheme&amp;#39; }&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Because LESS is processed, it is important to use &lt;code&gt;core_v2_widget.GetExecutedFileUrl()&lt;/code&gt; to resolve the LESS to standard CSS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LESS is a syntax-sensitive language. When errors occur while processing LESS, the error message will be returned as the content of the processed file, the message will be logged as an &amp;quot;Unknown&amp;quot; error in the exceptions log (&lt;strong&gt;Administration &amp;gt; Monitoring &amp;gt; Exceptions&lt;/strong&gt;), and, for themes, errors are also sent as system notifications to administrators of the community.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Community_LESS_Functions" name="Community_LESS_Functions"&gt;&lt;/a&gt;Community LESS Functions&lt;/h2&gt;
&lt;p&gt;When using LESS, you can make use of the base LESS language features as well as [[api-documentation:Less Functions|Verint Community-specific functions]] that make integrating with community functionality easier.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Configuration_Functions" name="Theme_Configuration_Functions"&gt;&lt;/a&gt;Theme Configuration Functions&lt;/h3&gt;
&lt;p&gt;Instead of defining local variables, it is often beneficial to define [[Using Dynamic Configuration|dynamic configuration]] options to end-users to adjust styling options. When defined by a [[Themes|theme]], configuration options can be read within LESS files using functions prefixed with &lt;code&gt;-evo-themeconfig&lt;/code&gt;, for example, [[api-documentation:-evo-themeconfig-color LESS Function|-evo-themeconfig-color]]:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget {
    color: -evo-themeconfig-color(&amp;#39;foregroundColor&amp;#39;, &amp;#39;#000&amp;#39;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would set the color of text in the widget to the color defined by the theme configuration property &amp;quot;foregroundColor&amp;quot;. If &amp;quot;foregroundColor&amp;quot; was defined by the theme (or the data type was not color), the default color, #000, would be used.&lt;/p&gt;
&lt;p&gt;Theme configuration, other than [[api-documentation:-evo-themeconfig-embeddedurl LESS Function|-evo-themeconfig-embeddedurl]], can be read from all [[Scripting|scriptable customizations]], not just [[Themes|themes]].&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Palette_Functions" name="Theme_Palette_Functions"&gt;&lt;/a&gt;Theme Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palettes to retrieve configured values for a specific palette type, paletted, and value ID using functions prefixed with &lt;code&gt;-evo-themepalette&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_File_Functions" name="Theme_File_Functions"&gt;&lt;/a&gt;Theme File Functions&lt;/h3&gt;
&lt;p&gt;LESS files within a theme can reference other embedded files within the theme using the [[api-documentation:-evo-themefile-url Less Function|-evo-themefile-url]] function. For example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-themefile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-themefile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the theme and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the theme.&lt;/p&gt;
&lt;p&gt;Note that the &lt;code&gt;-evo-themefile-url&lt;/code&gt; function can only be used within a theme. Other [[Scripting|scriptable customizations]] cannot use it within their embedded LESS files.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Configuration_Functions" name="Widget_Configuration_Functions"&gt;&lt;/a&gt;Widget Configuration Functions&lt;/h3&gt;
&lt;p&gt;Similar to theme configuration functions, widget configuration functions provide access to retrieve configuration data from the currently executing [[Scripting|scripted customization]]. Widget configuration functions are prefixed &lt;code&gt;-evo-widgetconfig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When executing scripts within a [[Themes|theme]], the &lt;code&gt;-evo-widgetconfig-X&lt;/code&gt; and &lt;code&gt;-evo-themeconfig-X&lt;/code&gt; functions will return the same results.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_File_Functions" name="Widget_File_Functions"&gt;&lt;/a&gt;Widget File Functions&lt;/h3&gt;
&lt;p&gt;LESS files embedded within the currently executing [[Scripting|scriptable customization]] can be referenced using the [[api-documentation:-evo-widgetfile-url LESS Function|-evo-widgetfile-url]] function. For example,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-widgetfile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-widgetfile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the current scripted customization and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the scripted customization.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Palette_Functions" name="Widget_Palette_Functions"&gt;&lt;/a&gt;Widget Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palette selections made by widget [[Using Dynamic Configuration|configuration options]] using functions prefixed with &lt;code&gt;-evo-widgetpalette&lt;/code&gt;.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;a id="Best_Practices" name="Best_Practices"&gt;&lt;/a&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Make use of configuration options and palette selections to expose styling customization to end users and use the Verint Community LESS functions to retrieve those values.&lt;/li&gt;
&lt;li&gt;Apply generic styling (applying to multiple/all widgets) to [[Themes]] and any widget-specific styling should be defined within the widget that makes use of it. This keeps the widget markup and styling together and ensures easier upgrades.&lt;/li&gt;
&lt;li&gt;If your LESS is complex, consider breaking it into multiple files with &lt;code&gt;@import&lt;/code&gt; directives referencing the sub-components.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: best practices&lt;/div&gt;
</description></item><item><title>Using LESS</title><link>https://community.telligent.com/community/11/w/developer-training/67232/using-less/revision/4</link><pubDate>Fri, 27 Sep 2019 14:55:18 GMT</pubDate><guid isPermaLink="false">cb7761eb-6cc7-4a1f-a0b2-2a21792e37ed</guid><dc:creator>Ramzi Banna</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/67232/using-less#comments</comments><description>Revision 4 posted to Developer Training by Ramzi Banna on 09/27/2019 14:55:18&lt;br /&gt;
&lt;p&gt;[[Scripting|Scripted customizations]] often&amp;nbsp;output HTML&amp;nbsp;content. When rendering CSS to help with the layout and styling of that content, Verint Community provides support for LESS, a processed extension to CSS.&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="What_is_LESS" name="What_is_LESS"&gt;&lt;/a&gt;What is LESS?&lt;/h2&gt;
&lt;p&gt;LESS is a set of extensions to cascading style sheets (CSS) that make defining styling metadata easier by introducing nesting, variables, functions, and more. LESS is processed by Verint Community and output as standard CSS to web clients (LESS is not natively understood by web browsers). Verint Community uses dotLess, which is a port of the less.js implementation of the LESS language.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Nesting" name="Nesting"&gt;&lt;/a&gt;Nesting&lt;/h3&gt;
&lt;p&gt;In CSS, context-specific style rules are defined as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But with LESS, they can be nested to simplify the child selectors:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget .field-list .field-item {
    .name { color: #333; }
    .input { color: #333; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Variables" name="Variables"&gt;&lt;/a&gt;Variables&lt;/h3&gt;
&lt;p&gt;In CSS, similar values often are repeated which makes updates difficult:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In LESS, these can be abstracted into a variable so the value can be set in a single location:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@foreground-color: #333;
.content-fragment.my-widget .field-list .field-item .name { color: @foreground-color; }
.content-fragment.my-widget .field-list .field-item .input { color: @foreground-color; }&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Functions" name="Functions"&gt;&lt;/a&gt;Functions&lt;/h3&gt;
&lt;p&gt;Functions in LESS enable descriptive adjustments to style data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@foreground-color: #33;
.content-fragment.my-widget .field-list .field-item {
    .name { color: lighten(@foreground-color, 10%); }
    .input { color: @foreground-color; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="LESS_Language_Documentation" name="LESS_Language_Documentation"&gt;&lt;/a&gt;LESS Language Documentation&lt;/h3&gt;
&lt;p&gt;For documentation on the LESS language, see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/dotless/dotless/wiki"&gt;dotLess Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/features/"&gt;less.js Language Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/functions/"&gt;less.js Function Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a id="How_can_I_use_LESS" name="How_can_I_use_LESS"&gt;&lt;/a&gt;How can I use LESS?&lt;/h2&gt;
&lt;p&gt;In [[Themes]], LESS files included in the &amp;quot;Style Sheets&amp;quot; node under the theme in [[Working with Theme Studio|Theme Studio]] are automatically rendered. LESS files can be created as embedded files in any [[Scripting|scriptable customization]], however, and included in HTML output by using &lt;code&gt;core_v2_widget.GetExecutedFileUrl(&amp;#39;NAME_OF_LESS_FILE&amp;#39;)&lt;/code&gt; and rendering it directly into a &lt;code&gt;&amp;lt;link /&amp;gt;&lt;/code&gt; tag or by using the &lt;code&gt;core_v2_page.AddLink()&lt;/code&gt; API, for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="velocity"&gt;$core_v2_page.AddLink(&amp;#39;stylesheet&amp;#39;, $core_v2_widget.GetExecutedFileUrl(&amp;#39;style.less&amp;#39;), &amp;quot;%{ Position = &amp;#39;AfterTheme&amp;#39; }&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Because LESS is processed, it is important to use &lt;code&gt;core_v2_widget.GetExecutedFileUrl()&lt;/code&gt; to resolve the LESS to standard CSS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LESS is a syntax-sensitive language. When errors occur while processing LESS, the error message will be returned as the content of the processed file, the message will be logged as an &amp;quot;Unknown&amp;quot; error in the exceptions log (&lt;strong&gt;Administration &amp;gt; Monitoring &amp;gt; Exceptions&lt;/strong&gt;), and, for themes, errors are also sent as system notifications to administrators of the community.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Community_LESS_Functions" name="Community_LESS_Functions"&gt;&lt;/a&gt;Community LESS Functions&lt;/h2&gt;
&lt;p&gt;When using LESS, you can make use of the base LESS language features as well as [[api-documentation:Less Functions|Verint Community-specific functions]] that make integrating with community functionality easier.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Configuration_Functions" name="Theme_Configuration_Functions"&gt;&lt;/a&gt;Theme Configuration Functions&lt;/h3&gt;
&lt;p&gt;Instead of defining local variables, it is often beneficial to define [[Using Dynamic Configuration|dynamic configuration]] options to end-users to adjust styling options. When defined by a [[Themes|theme]], configuration options can be read within LESS files using functions prefixed with &lt;code&gt;-evo-themeconfig&lt;/code&gt;, for example, [[api-documentation:-evo-themeconfig-color LESS Function|-evo-themeconfig-color]]:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget {
    color: -evo-themeconfig-color(&amp;#39;foregroundColor&amp;#39;, &amp;#39;#000&amp;#39;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would set the color of text in the widget to the color defined by the theme configuration property &amp;quot;foregroundColor&amp;quot;. If &amp;quot;foregroundColor&amp;quot; was defined by the theme (or the data type was not color), the default color, #000, would be used.&lt;/p&gt;
&lt;p&gt;Theme configuration, other than [[api-documentation:-evo-themeconfig-embeddedurl LESS Function|-evo-themeconfig-embeddedurl]], can be read from all [[Scripting|scriptable customizations]], not just [Themes|themes]].&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Palette_Functions" name="Theme_Palette_Functions"&gt;&lt;/a&gt;Theme Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palettes to retrieve configured values for a specific palette type, paletted, and value ID using functions prefixed with &lt;code&gt;-evo-themepalette&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_File_Functions" name="Theme_File_Functions"&gt;&lt;/a&gt;Theme File Functions&lt;/h3&gt;
&lt;p&gt;LESS files within a theme can reference other embedded files within the theme using the [[api-documentation:-evo-themefile-url Less Function|-evo-themefile-url]] function. For example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-themefile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-themefile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the theme and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the theme.&lt;/p&gt;
&lt;p&gt;Note that the &lt;code&gt;-evo-themefile-url&lt;/code&gt; function can only be used within a theme. Other [[Scripting|scriptable customizations]] cannot use it within their embedded LESS files.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Configuration_Functions" name="Widget_Configuration_Functions"&gt;&lt;/a&gt;Widget Configuration Functions&lt;/h3&gt;
&lt;p&gt;Similar to theme configuration functions, widget configuration functions provide access to retrieve configuration data from the currently executing [[Scripting|scripted customization]]. Widget configuration functions are prefixed &lt;code&gt;-evo-widgetconfig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When executing scripts within a [[Themes|theme]], the &lt;code&gt;-evo-widgetconfig-X&lt;/code&gt; and &lt;code&gt;-evo-themeconfig-X&lt;/code&gt; functions will return the same results.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_File_Functions" name="Widget_File_Functions"&gt;&lt;/a&gt;Widget File Functions&lt;/h3&gt;
&lt;p&gt;LESS files embedded within the currently executing [[Scripting|scriptable customization]] can be referenced using the [[api-documentation:-evo-widgetfile-url LESS Function|-evo-widgetfile-url]] function. For example,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-widgetfile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-widgetfile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the current scripted customization and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the scripted customization.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Palette_Functions" name="Widget_Palette_Functions"&gt;&lt;/a&gt;Widget Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palette selections made by widget [[Using Dynamic Configuration|configuration options]] using functions prefixed with &lt;code&gt;-evo-widgetpalette&lt;/code&gt;.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;a id="Best_Practices" name="Best_Practices"&gt;&lt;/a&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Make use of configuration options and palette selections to expose styling customization to end users and use the Verint Community LESS functions to retrieve those values.&lt;/li&gt;
&lt;li&gt;Apply generic styling (applying to multiple/all widgets) to [[Themes]] and any widget-specific styling should be defined within the widget that makes use of it. This keeps the widget markup and styling together and ensures easier upgrades.&lt;/li&gt;
&lt;li&gt;If your LESS is complex, consider breaking it into multiple files with &lt;code&gt;@import&lt;/code&gt; directives referencing the sub-components.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: best practices&lt;/div&gt;
</description></item><item><title>Using LESS</title><link>https://community.telligent.com/community/11/w/developer-training/67232/using-less/revision/3</link><pubDate>Mon, 08 Jul 2019 15:11:54 GMT</pubDate><guid isPermaLink="false">cb7761eb-6cc7-4a1f-a0b2-2a21792e37ed</guid><dc:creator>Ben Tiedt</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/67232/using-less#comments</comments><description>Revision 3 posted to Developer Training by Ben Tiedt on 07/08/2019 15:11:54&lt;br /&gt;
&lt;p&gt;[[Scripting|Scripted customizations]] often&amp;nbsp;output HTML&amp;nbsp;content. When rendering CSS to help with the layout and styling of that content, Verint Community provides support for LESS, a processed extension to CSS.&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="What_is_LESS" name="What_is_LESS"&gt;&lt;/a&gt;What is LESS?&lt;/h2&gt;
&lt;p&gt;LESS is a set of extensions to cascading style sheets (CSS) that make defining styling metadata easier by introducing nesting, variables, functions, and more. LESS is processed by Verint Community and output as standard CSS to web clients (LESS is not natively understood by web browsers). Verint Community uses dotLess, which is a port of the less.js implementation of the LESS language.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Nesting" name="Nesting"&gt;&lt;/a&gt;Nesting&lt;/h3&gt;
&lt;p&gt;In CSS, context-specific style rules are defined as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But with LESS, they can be nested to simplify the child selectors:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget .field-list .field-item {
    .name { color: #333; }
    .input { color: #333; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Variables" name="Variables"&gt;&lt;/a&gt;Variables&lt;/h3&gt;
&lt;p&gt;In CSS, similar values often are repeated which makes updates difficult:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In LESS, these can be abstracted into a variable so the value can be set in a single location:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@foreground-color: #333;
.content-fragment.my-widget .field-list .field-item .name { color: @foreground-color; }
.content-fragment.my-widget .field-list .field-item .input { color: @foreground-color; }&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Functions" name="Functions"&gt;&lt;/a&gt;Functions&lt;/h3&gt;
&lt;p&gt;Functions in LESS enable descriptive adjustments to style data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@foreground-color: #33;
.content-fragment.my-widget .field-list .field-item {
    .name { color: lighten(@foreground-color, 10%); }
    .input { color: @foreground-color; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="LESS_Language_Documentation" name="LESS_Language_Documentation"&gt;&lt;/a&gt;LESS Language Documentation&lt;/h3&gt;
&lt;p&gt;For documentation on the LESS language, see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/dotless/dotless/wiki"&gt;dotLess Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/features/"&gt;less.js Language Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/functions/"&gt;less.js Function Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a id="How_can_I_use_LESS" name="How_can_I_use_LESS"&gt;&lt;/a&gt;How can I use LESS?&lt;/h2&gt;
&lt;p&gt;In [[Themes]], LESS files included in the &amp;quot;Style Sheets&amp;quot; node under the theme in [[Working with Theme Studio|Theme Studio]] are automatically rendered. LESS files can be created as embedded files in any [[Scripting|scriptable customization]], however, and included in HTML output by using &lt;code&gt;core_v2_widget.GetExecutedFileUrl(&amp;#39;NAME_OF_LESS_FILE&amp;#39;)&lt;/code&gt; and rendering it directly into a &lt;code&gt;&amp;lt;link /&amp;gt;&lt;/code&gt; tag or by using the &lt;code&gt;core_v2_page.AddLink()&lt;/code&gt; API, for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="velocity"&gt;$core_v2_page.AddLink(&amp;#39;stylesheet&amp;#39;, $core_v2_widget.GetExecutedFileUrl(&amp;#39;style.less&amp;#39;), &amp;quot;%{ Position = &amp;#39;AfterTheme&amp;#39; }&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Because LESS is processed, it is important to use &lt;code&gt;core_v2_widget.GetExecutedFileUrl()&lt;/code&gt; to resolve the LESS to standard CSS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LESS is a syntax-sensitive language. When errors occur while processing LESS, the error message will be returned as the content of the processed file, the message will be logged as an &amp;quot;Unknown&amp;quot; error in the exceptions log (&lt;strong&gt;Administration &amp;gt; Monitoring &amp;gt; Exceptions&lt;/strong&gt;), and, for themes, errors are also sent as system notifications to administrators of the community.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Community_LESS_Functions" name="Community_LESS_Functions"&gt;&lt;/a&gt;Community LESS Functions&lt;/h2&gt;
&lt;p&gt;When using LESS, you can make use of the base LESS language features as well as [[api-documentation:Less Functions|Verint Community-specific functions]] that make integrating with community functionality easier.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Configuration_Functions" name="Theme_Configuration_Functions"&gt;&lt;/a&gt;Theme Configuration Functions&lt;/h3&gt;
&lt;p&gt;Instead of defining local variables, it is often beneficial to define [[Using Dynamic Configuration|dynamic configuration]] options to end-users to adjust styling options. When defined by a [[Themes|theme]], configuration options can be read within LESS files using functions prefixed with &lt;code&gt;-evo-themeconfig&lt;/code&gt;, for example, [[api-documentation:-evo-themeconfig-color LESS Function|-evo-themeconfig-color]]:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget {
    color: -evo-themeconfig-color(&amp;#39;foregroundColor&amp;#39;, &amp;#39;#000&amp;#39;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would set the color of text in the widget to the color defined by the theme configuration property &amp;quot;foregroundColor&amp;quot;. If &amp;quot;foregroundColor&amp;quot; was defined by the theme (or the data type was not color), the default color, #000, would be used.&lt;/p&gt;
&lt;p&gt;Theme configuration, other than [[api-documentation:-evo-themeconfig-embeddedurl LESS Function|-evo-themeconfig-embeddedurl]], can be read from all [[Scripting|scriptable customizations]], not just [Themes|themes]].&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Palette_Functions" name="Theme_Palette_Functions"&gt;&lt;/a&gt;Theme Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palettes to retrieve configured values for a specific palette type, paletted, and value ID using functions prefixed with &lt;code&gt;-evo-themepalette&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_File_Functions" name="Theme_File_Functions"&gt;&lt;/a&gt;Theme File Functions&lt;/h3&gt;
&lt;p&gt;LESS files within a theme can reference other embedded files within the theme using the [[api-documentation:-evo-themefile-url Less Function|-evo-themefile-url]] function. For example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-themefile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-themefile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the theme and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the theme.&lt;/p&gt;
&lt;p&gt;Note that the &lt;code&gt;-evo-themefile-url&lt;/code&gt; function can only be used within a theme. Other [[Scripting|scriptable customizations]] cannot use it within their embedded LESS files.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Configuration_Functions" name="Widget_Configuration_Functions"&gt;&lt;/a&gt;Widget Configuration Functions&lt;/h3&gt;
&lt;p&gt;Similar to theme configuration functions, widget configuration functions provide access to retrieve configuration data from the currently executing [[Scripting|scripted customization]]. Widget configuration functions are prefixed &lt;code&gt;-evo-widgetconfig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When executing scripts within a [[Themes|theme]], the &lt;code&gt;-evo-widgetconfig-X&lt;/code&gt; and &lt;code&gt;-evo-themeconfig-X&lt;/code&gt; functions will return the same results.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_File_Functions" name="Widget_File_Functions"&gt;&lt;/a&gt;Widget File Functions&lt;/h3&gt;
&lt;p&gt;LESS files embedded within the currently executing [[Scripting|scriptable customization]] can be referenced using the [[api-documentation:-evo-widgetfile-url LESS Function|-evo-widgetfile-url]] function. For example,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-widgetfile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-widgetfile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the current scripted customization and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the scripted customization.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Palette_Functions" name="Widget_Palette_Functions"&gt;&lt;/a&gt;Widget Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palette selections made by widget [[Using Dynamic Configuration|configuration options]] using functions prefixed with &lt;code&gt;-evo-widgetpalette&lt;/code&gt;.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;a id="Best_Practices" name="Best_Practices"&gt;&lt;/a&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Make use of configuration options and palette selections to expose styling customization to end users and use the Verint Community LESS functions to retrieve those values.&lt;/li&gt;
&lt;li&gt;Apply generic styling (applying to multiple/all widgets) to [[Themes]] and any widget-specific styling should be defined within the widget that makes use of it. This keeps the widget markup and styling together and ensures easier upgrades.&lt;/li&gt;
&lt;li&gt;If your LESS is complex, consider breaking it into multiple files with &lt;code&gt;@import&lt;/code&gt; directives referencing the sub-components.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using LESS</title><link>https://community.telligent.com/community/11/w/developer-training/67232/using-less/revision/2</link><pubDate>Mon, 08 Jul 2019 15:10:42 GMT</pubDate><guid isPermaLink="false">cb7761eb-6cc7-4a1f-a0b2-2a21792e37ed</guid><dc:creator>Ben Tiedt</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/67232/using-less#comments</comments><description>Revision 2 posted to Developer Training by Ben Tiedt on 07/08/2019 15:10:42&lt;br /&gt;
&lt;p&gt;[[Scripting|Scripted customizations]] often&amp;nbsp;output HTML&amp;nbsp;content. When rendering CSS to help with the layout and styling of that content, Verint Community provides support for LESS, an a processed extension to CSS.&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="What_is_LESS" name="What_is_LESS"&gt;&lt;/a&gt;What is LESS?&lt;/h2&gt;
&lt;p&gt;LESS is a set of extensions to cascading style sheets (CSS) that make defining styling metadata easier by introducing nesting, variables, functions, and more. LESS is processed by Verint Community and output as standard CSS to web clients (LESS is not natively understood by web browsers). Verint Community uses dotLess, which is a port of the less.js implementation of the LESS language.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Nesting" name="Nesting"&gt;&lt;/a&gt;Nesting&lt;/h3&gt;
&lt;p&gt;In CSS, context-specific style rules are defined as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But with LESS, they can be nested to simplify the child selectors:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget .field-list .field-item {
    .name { color: #333; }
    .input { color: #333; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Variables" name="Variables"&gt;&lt;/a&gt;Variables&lt;/h3&gt;
&lt;p&gt;In CSS, similar values often are repeated which makes updates difficult:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In LESS, these can be abstracted into a variable so the value can be set in a single location:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@foreground-color: #333;
.content-fragment.my-widget .field-list .field-item .name { color: @foreground-color; }
.content-fragment.my-widget .field-list .field-item .input { color: @foreground-color; }&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Functions" name="Functions"&gt;&lt;/a&gt;Functions&lt;/h3&gt;
&lt;p&gt;Functions in LESS enable descriptive adjustments to style data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@foreground-color: #33;
.content-fragment.my-widget .field-list .field-item {
    .name { color: lighten(@foreground-color, 10%); }
    .input { color: @foreground-color; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="LESS_Language_Documentation" name="LESS_Language_Documentation"&gt;&lt;/a&gt;LESS Language Documentation&lt;/h3&gt;
&lt;p&gt;For documentation on the LESS language, see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/dotless/dotless/wiki"&gt;dotLess Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/features/"&gt;less.js Language Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/functions/"&gt;less.js Function Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a id="How_can_I_use_LESS" name="How_can_I_use_LESS"&gt;&lt;/a&gt;How can I use LESS?&lt;/h2&gt;
&lt;p&gt;In [[Themes]], LESS files included in the &amp;quot;Style Sheets&amp;quot; node under the theme in [[Working with Theme Studio|Theme Studio]] are automatically rendered. LESS files can be created as embedded files in any [[Scripting|scriptable customization]], however, and included in HTML output by using &lt;code&gt;core_v2_widget.GetExecutedFileUrl(&amp;#39;NAME_OF_LESS_FILE&amp;#39;)&lt;/code&gt; and rendering it directly into a &lt;code&gt;&amp;lt;link /&amp;gt;&lt;/code&gt; tag or by using the &lt;code&gt;core_v2_page.AddLink()&lt;/code&gt; API, for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="velocity"&gt;$core_v2_page.AddLink(&amp;#39;stylesheet&amp;#39;, $core_v2_widget.GetExecutedFileUrl(&amp;#39;style.less&amp;#39;), &amp;quot;%{ Position = &amp;#39;AfterTheme&amp;#39; }&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Because LESS is processed, it is important to use &lt;code&gt;core_v2_widget.GetExecutedFileUrl()&lt;/code&gt; to resolve the LESS to standard CSS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LESS is a syntax-sensitive language. When errors occur while processing LESS, the error message will be returned as the content of the processed file, the message will be logged as an &amp;quot;Unknown&amp;quot; error in the exceptions log (&lt;strong&gt;Administration &amp;gt; Monitoring &amp;gt; Exceptions&lt;/strong&gt;), and, for themes, errors are also sent as system notifications to administrators of the community.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Community_LESS_Functions" name="Community_LESS_Functions"&gt;&lt;/a&gt;Community LESS Functions&lt;/h2&gt;
&lt;p&gt;When using LESS, you can make use of the base LESS language features as well as [[api-documentation:Less Functions|Verint Community-specific functions]] that make integrating with community functionality easier.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Configuration_Functions" name="Theme_Configuration_Functions"&gt;&lt;/a&gt;Theme Configuration Functions&lt;/h3&gt;
&lt;p&gt;Instead of defining local variables, it is often beneficial to define [[Using Dynamic Configuration|dynamic configuration]] options to end-users to adjust styling options. When defined by a [[Themes|theme]], configuration options can be read within LESS files using functions prefixed with &lt;code&gt;-evo-themeconfig&lt;/code&gt;, for example, [[api-documentation:-evo-themeconfig-color LESS Function|-evo-themeconfig-color]]:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget {
    color: -evo-themeconfig-color(&amp;#39;foregroundColor&amp;#39;, &amp;#39;#000&amp;#39;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would set the color of text in the widget to the color defined by the theme configuration property &amp;quot;foregroundColor&amp;quot;. If &amp;quot;foregroundColor&amp;quot; was defined by the theme (or the data type was not color), the default color, #000, would be used.&lt;/p&gt;
&lt;p&gt;Theme configuration, other than [[api-documentation:-evo-themeconfig-embeddedurl LESS Function|-evo-themeconfig-embeddedurl]], can be read from all [[Scripting|scriptable customizations]], not just [Themes|themes]].&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Palette_Functions" name="Theme_Palette_Functions"&gt;&lt;/a&gt;Theme Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palettes to retrieve configured values for a specific palette type, paletted, and value ID using functions prefixed with &lt;code&gt;-evo-themepalette&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_File_Functions" name="Theme_File_Functions"&gt;&lt;/a&gt;Theme File Functions&lt;/h3&gt;
&lt;p&gt;LESS files within a theme can reference other embedded files within the theme using the [[api-documentation:-evo-themefile-url Less Function|-evo-themefile-url]] function. For example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-themefile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-themefile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the theme and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the theme.&lt;/p&gt;
&lt;p&gt;Note that the &lt;code&gt;-evo-themefile-url&lt;/code&gt; function can only be used within a theme. Other [[Scripting|scriptable customizations]] cannot use it within their embedded LESS files.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Configuration_Functions" name="Widget_Configuration_Functions"&gt;&lt;/a&gt;Widget Configuration Functions&lt;/h3&gt;
&lt;p&gt;Similar to theme configuration functions, widget configuration functions provide access to retrieve configuration data from the currently executing [[Scripting|scripted customization]]. Widget configuration functions are prefixed &lt;code&gt;-evo-widgetconfig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When executing scripts within a [[Themes|theme]], the &lt;code&gt;-evo-widgetconfig-X&lt;/code&gt; and &lt;code&gt;-evo-themeconfig-X&lt;/code&gt; functions will return the same results.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_File_Functions" name="Widget_File_Functions"&gt;&lt;/a&gt;Widget File Functions&lt;/h3&gt;
&lt;p&gt;LESS files embedded within the currently executing [[Scripting|scriptable customization]] can be referenced using the [[api-documentation:-evo-widgetfile-url LESS Function|-evo-widgetfile-url]] function. For example,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-widgetfile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-widgetfile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the current scripted customization and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the scripted customization.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Palette_Functions" name="Widget_Palette_Functions"&gt;&lt;/a&gt;Widget Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palette selections made by widget [[Using Dynamic Configuration|configuration options]] using functions prefixed with &lt;code&gt;-evo-widgetpalette&lt;/code&gt;.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;a id="Best_Practices" name="Best_Practices"&gt;&lt;/a&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Make use of configuration options and palette selections to expose styling customization to end users and use the Verint Community LESS functions to retrieve those values.&lt;/li&gt;
&lt;li&gt;Apply generic styling (applying to multiple/all widgets) to [[Themes]] and any widget-specific styling should be defined within the widget that makes use of it. This keeps the widget markup and styling together and ensures easier upgrades.&lt;/li&gt;
&lt;li&gt;If your LESS is complex, consider breaking it into multiple files with &lt;code&gt;@import&lt;/code&gt; directives referencing the sub-components.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using LESS</title><link>https://community.telligent.com/community/11/w/developer-training/67232/using-less/revision/1</link><pubDate>Mon, 08 Jul 2019 15:07:06 GMT</pubDate><guid isPermaLink="false">cb7761eb-6cc7-4a1f-a0b2-2a21792e37ed</guid><dc:creator>Ben Tiedt</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/67232/using-less#comments</comments><description>Revision 1 posted to Developer Training by Ben Tiedt on 07/08/2019 15:07:06&lt;br /&gt;
&lt;p&gt;[[Scripting|Scripted customizations]] often&amp;nbsp;output HTML&amp;nbsp;content. When rendering To help with the layout and styling of that content, Verint Community provides support for LESS.&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="What_is_LESS" name="What_is_LESS"&gt;&lt;/a&gt;What is LESS?&lt;/h2&gt;
&lt;p&gt;LESS is a set of extensions to cascading style sheets (CSS) that make defining styling metadata easier by introducing nesting, variables, functions, and more. LESS is processed by Verint Community and output as standard CSS to web clients (LESS is not natively understood by web browsers). Verint Community uses dotLess, which is a port of the less.js implementation of the LESS language.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Nesting" name="Nesting"&gt;&lt;/a&gt;Nesting&lt;/h3&gt;
&lt;p&gt;In CSS, context-specific style rules are defined as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But with LESS, they can be nested to simplify the child selectors:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget .field-list .field-item {
    .name { color: #333; }
    .input { color: #333; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Variables" name="Variables"&gt;&lt;/a&gt;Variables&lt;/h3&gt;
&lt;p&gt;In CSS, similar values often are repeated which makes updates difficult:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="css"&gt;.content-fragment.my-widget .field-list .field-item .name { color: #333; }
.content-fragment.my-widget .field-list .field-item .input { color: #333; }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In LESS, these can be abstracted into a variable so the value can be set in a single location:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@foreground-color: #333;
.content-fragment.my-widget .field-list .field-item .name { color: @foreground-color; }
.content-fragment.my-widget .field-list .field-item .input { color: @foreground-color; }&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Functions" name="Functions"&gt;&lt;/a&gt;Functions&lt;/h3&gt;
&lt;p&gt;Functions in LESS enable descriptive adjustments to style data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@foreground-color: #33;
.content-fragment.my-widget .field-list .field-item {
    .name { color: lighten(@foreground-color, 10%); }
    .input { color: @foreground-color; }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a id="LESS_Language_Documentation" name="LESS_Language_Documentation"&gt;&lt;/a&gt;LESS Language Documentation&lt;/h3&gt;
&lt;p&gt;For documentation on the LESS language, see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/dotless/dotless/wiki"&gt;dotLess Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/features/"&gt;less.js Language Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/functions/"&gt;less.js Function Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a id="How_can_I_use_LESS" name="How_can_I_use_LESS"&gt;&lt;/a&gt;How can I use LESS?&lt;/h2&gt;
&lt;p&gt;In [[Themes]], LESS files included in the &amp;quot;Style Sheets&amp;quot; node under the theme in [[Working with Theme Studio|Theme Studio]] are automatically rendered. LESS files can be created as embedded files in any [[Scripting|scriptable customization]], however, and included in HTML output by using &lt;code&gt;core_v2_widget.GetExecutedFileUrl(&amp;#39;NAME_OF_LESS_FILE&amp;#39;)&lt;/code&gt; and rendering it directly into a &lt;code&gt;&amp;lt;link /&amp;gt;&lt;/code&gt; tag or by using the &lt;code&gt;core_v2_page.AddLink()&lt;/code&gt; API, for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="velocity"&gt;$core_v2_page.AddLink(&amp;#39;stylesheet&amp;#39;, $core_v2_widget.GetExecutedFileUrl(&amp;#39;style.less&amp;#39;), &amp;quot;%{ Position = &amp;#39;AfterTheme&amp;#39; }&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Because LESS is processed, it is important to use &lt;code&gt;core_v2_widget.GetExecutedFileUrl()&lt;/code&gt; to resolve the LESS to standard CSS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;LESS is a syntax-sensitive language. When errors occur while processing LESS, the error message will be returned as the content of the processed file, the message will be logged as an &amp;quot;Unknown&amp;quot; error in the exceptions log (&lt;strong&gt;Administration &amp;gt; Monitoring &amp;gt; Exceptions&lt;/strong&gt;), and, for themes, errors are also sent as system notifications to administrators of the community.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Community_LESS_Functions" name="Community_LESS_Functions"&gt;&lt;/a&gt;Community LESS Functions&lt;/h2&gt;
&lt;p&gt;When using LESS, you can make use of the base LESS language features as well as [[api-documentation:Less Functions|Verint Community-specific functions]] that make integrating with community functionality easier.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Configuration_Functions" name="Theme_Configuration_Functions"&gt;&lt;/a&gt;Theme Configuration Functions&lt;/h3&gt;
&lt;p&gt;Instead of defining local variables, it is often beneficial to define [[Using Dynamic Configuration|dynamic configuration]] options to end-users to adjust styling options. When defined by a [[Themes|theme]], configuration options can be read within LESS files using functions prefixed with &lt;code&gt;-evo-themeconfig&lt;/code&gt;, for example, [[api-documentation:-evo-themeconfig-color LESS Function|-evo-themeconfig-color]]:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;.content-fragment.my-widget {
    color: -evo-themeconfig-color(&amp;#39;foregroundColor&amp;#39;, &amp;#39;#000&amp;#39;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would set the color of text in the widget to the color defined by the theme configuration property &amp;quot;foregroundColor&amp;quot;. If &amp;quot;foregroundColor&amp;quot; was defined by the theme (or the data type was not color), the default color, #000, would be used.&lt;/p&gt;
&lt;p&gt;Theme configuration, other than [[api-documentation:-evo-themeconfig-embeddedurl LESS Function|-evo-themeconfig-embeddedurl]], can be read from all [[Scripting|scriptable customizations]], not just [Themes|themes]].&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_Palette_Functions" name="Theme_Palette_Functions"&gt;&lt;/a&gt;Theme Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palettes to retrieve configured values for a specific palette type, paletted, and value ID using functions prefixed with &lt;code&gt;-evo-themepalette&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Theme_File_Functions" name="Theme_File_Functions"&gt;&lt;/a&gt;Theme File Functions&lt;/h3&gt;
&lt;p&gt;LESS files within a theme can reference other embedded files within the theme using the [[api-documentation:-evo-themefile-url Less Function|-evo-themefile-url]] function. For example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-themefile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-themefile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the theme and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the theme.&lt;/p&gt;
&lt;p&gt;Note that the &lt;code&gt;-evo-themefile-url&lt;/code&gt; function can only be used within a theme. Other [[Scripting|scriptable customizations]] cannot use it within their embedded LESS files.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Configuration_Functions" name="Widget_Configuration_Functions"&gt;&lt;/a&gt;Widget Configuration Functions&lt;/h3&gt;
&lt;p&gt;Similar to theme configuration functions, widget configuration functions provide access to retrieve configuration data from the currently executing [[Scripting|scripted customization]]. Widget configuration functions are prefixed &lt;code&gt;-evo-widgetconfig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When executing scripts within a [[Themes|theme]], the &lt;code&gt;-evo-widgetconfig-X&lt;/code&gt; and &lt;code&gt;-evo-themeconfig-X&lt;/code&gt; functions will return the same results.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_File_Functions" name="Widget_File_Functions"&gt;&lt;/a&gt;Widget File Functions&lt;/h3&gt;
&lt;p&gt;LESS files embedded within the currently executing [[Scripting|scriptable customization]] can be referenced using the [[api-documentation:-evo-widgetfile-url LESS Function|-evo-widgetfile-url]] function. For example,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="less"&gt;@import &amp;quot;-evo-widgetfile-url(&amp;#39;supplementary.less&amp;#39;)&amp;quot;;

.my-style-rule {
    background-image: url(-evo-widgetfile-url(&amp;#39;image.png&amp;#39;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This would include and process the embedded file &amp;quot;supplementary.less&amp;quot; from the current scripted customization and set the background image of elements classified as &amp;quot;my-style-rule&amp;quot; to the URL of the &amp;quot;image.png&amp;quot; file embedded in the scripted customization.&lt;/p&gt;
&lt;h3&gt;&lt;a id="Widget_Palette_Functions" name="Widget_Palette_Functions"&gt;&lt;/a&gt;Widget Palette Functions&lt;/h3&gt;
&lt;p&gt;LESS files can make use of theme palette selections made by widget [[Using Dynamic Configuration|configuration options]] using functions prefixed with &lt;code&gt;-evo-widgetpalette&lt;/code&gt;.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;a id="Best_Practices" name="Best_Practices"&gt;&lt;/a&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Make use of configuration options and palette selections to expose styling customization to end users and use the Verint Community LESS functions to retrieve those values.&lt;/li&gt;
&lt;li&gt;Apply generic styling (applying to multiple/all widgets) to [[Themes]] and any widget-specific styling should be defined within the widget that makes use of it. This keeps the widget markup and styling together and ensures easier upgrades.&lt;/li&gt;
&lt;li&gt;If your LESS is complex, consider breaking it into multiple files with &lt;code&gt;@import&lt;/code&gt; directives referencing the sub-components.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>