Can't get custom CSS to work in Text Output Widget

I am having trouble getting custom CSS styles to work in the output of the Text Output Widget, whether in the Web Portal or the component’s Interactive View on the desktop client.

However, when I use a Text Output (legacy) node instead of the Text Output Widget, the CSS styles work just fine.

I just noticed that this was a known issue as of more than six months ago. Is a fix on the way? This seems like a pretty fundamental requirement for the Text Output Widget.

Hello @AngusVeitch1,

this was fixed with KNIME version 4.3.0. You should enable the “Use legacy mode” flag in the Layout Editor. See here for more:
https://docs.knime.com/latest/analytics_platform_components_guide/index.html#legacy-flag

Br,
Ivan

1 Like

Thanks @ipazin, enabling legacy mode for the widget produces the desired result, but this seems more like a workaround than a fix. Why should legacy mode be required for this widget? And how is the user supposed to know this? Will the widget be updated so that legacy mode is no longer required?

1 Like

Hello @AngusVeitch1,

Because the Widget nodes user interface has been improved starting from KNIME Analytics Platform version 4.2 and to have legacy mode you need to flag the mark. You can find more about it here:

https://docs.knime.com/latest/analytics_platform_css_guide/index.html

Br,
Ivan

1 Like

Thanks @ipazin but I am still confused. What exactly is being defined as legacy functionality here?

My first assumption upon reading the documentation was that the old (i.e. legacy) approach was to use arbitrary CSS styles, while the new approach is to use a set of pre-defined styles that map to the elements of the views.

But in the tests I’ve done so far, I still need to turn on Legacy mode for the new classes to work. If I don’t, the formatting of the elements (specifically the qf-title, qf-text and qf-container) does not change. Why should I need to turn on ‘Legacy mode’ to enable this new functionality?

To make sure the problem is not at my end, I have included my test workflow. I created this workflow from using the second-most recent version of the platform (i.e. 4.2+), and even tried it with the 4.3.3 update as well. It shows the same behaviour with both the Text Output Widget and the Single Selection Widget.

Assuming that what I am observing is not what is supposed to happen, could you clarify the status now of ‘arbitrary’ CSS styles that don’t map to defined view elements? Is the intention now that everything be achieved by manipulating the pre-defined elements, in combination with custom layouts, rather than defining arbitrary styles?Text_formatting_test_3.knwf (15.5 KB)

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.