Guys,

I'm searching about the correct use of container widget.

I would like to know when I must use Containers. In specific if it's a good practice to use containers whenever I want to apply a style to a expression (e.g.). 

The excessive use of containers will worsen screen rendering?

Thank you in advance,

Best regards!

Hi Daniela, 

I would assume we need to use container only when necessary, excessive usage won't help rendering for sure. Container is being compiled into a regular html <div>.

Hi Daniela,

Container widget it's used to group content so it can be easily styled with css. This CSS can be on a form of a class or the properties of the container.

Regards,

Marcelo

Roman Tkachenko wrote:

Hi Daniela, 

I would assume we need to use container only when necessary, excessive usage won't help rendering for sure. Container is being compiled into a regular html <div>.

So, if I want for instance apply a fullwidth style to an expression is a better solution the use of a style class created in Style Sheet or the use of Outsystems Styles Editor for each widget in which I want to apply such style??


Solution

Hi Daniela,

If you are using in multiple places you should always use a class. That class can be in multiple places. If you are only using on that screen you can put it on the style sheet of that screen. But if you are using it in multiple places across your application it should be on theme.

Regards,

Marcelo

Solution

Daniela Santos wrote:

Roman Tkachenko wrote:

Hi Daniela, 

I would assume we need to use container only when necessary, excessive usage won't help rendering for sure. Container is being compiled into a regular html <div>.

So, if I want for instance apply a fullwidth style to an expression is a better solution the use of a style class created in Style Sheet or the use of Outsystems Styles Editor for each widget in which I want to apply such style??


You can set a style class for expression. For most cases, you want to separate your styles into a css class so that you can reuse that across the app, however, styles editor is useful when you need to style element instantly. There's a button that'll save your styles into a reusable class as well.