CSS for right-to-left languages in portals
-
- UpdatedAug 3, 2023
- 2 minutes to read
- Vancouver
- Service Portal Designer
If you're an existing customer using the Service Portal (sp) portal for employee self-service use cases, we recommend that you migrate to the Employee Center (esc) portal for a better experience.
You can control the generation of CSS for right-to-left languages using a variety of methods.
Base system portals besides Service Portal (/sp) and custom portals might need additional CSS customization to mirror the direction of a portal for right-to-left languages completely.
Custom widgets might need some manual conversion for right-to-left languages.
- For inline styles in a widget's HTML template, move these styles to the widget's CSS so they’ll be automatically converted.
- For internal styles in a widget's HTML template, you can use the
[dir=”rtl”]
attribute selector or.rtl
class selector to provide CSS that is specific to right-to-left languages. - To include CSS that is specific to right-to-left languages, you can call the isRTLEnabled() method in the GlideSPScriptable - Scoped class in a widget’s server script or use the g_portal_isrtl global flag in the widget’s client script.
Also, in the theme, page, widget, or widget instance CSS, you can add right-to-left directives to CSS properties only using a Sass interpolation string (#{""}
).