Skip to main content
1-Visitor
February 1, 2021
Solved

Why does ::part()::part() work in ThingWorx 8.5?

  • February 1, 2021
  • 1 reply
  • 1571 views

Since we are limited by the StyleTheme range of options we are forced to inject CSS to fine-tune our solutions. 

 

Now according to CSS org, W3 and SO the syntax ::part()::part() should not and cannot work. In TWX 8.5 however, we found this was exactly what was required to achieve our intended purpose. We have been struggling to understand why this happens, any ideas?

Best answer by c_lowy

Hi @RD_9093672,

 

Indeed it is not officially supported to use syntaxes like ::part()::part() in custom CSS in ThingWorx. They might happen to work in some cases, but this is not how the support for custom CSS in ThingWorx was designed.

 

The way ThingWorx supports reaching sub-elements is with the "partmap" tag. If the top-element has a "partmap" tag as such :

then the sub-elements can be reached in the css. For example an element called "image" within this icon can be reached with syntax "icon-image".

1 reply

c_lowy16-PearlAnswer
16-Pearl
February 3, 2021

Hi @RD_9093672,

 

Indeed it is not officially supported to use syntaxes like ::part()::part() in custom CSS in ThingWorx. They might happen to work in some cases, but this is not how the support for custom CSS in ThingWorx was designed.

 

The way ThingWorx supports reaching sub-elements is with the "partmap" tag. If the top-element has a "partmap" tag as such :

then the sub-elements can be reached in the css. For example an element called "image" within this icon can be reached with syntax "icon-image".

Support
February 11, 2021

Hi @RD_9093672.

 

If you feel your question has been answered, please mark the response from @c_lowy as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon