Ability to add classes to blocks
96
Views
1
Comments
New
Frontend (App Interfaces)

Idea: Allow Adding CSS Classes Directly to Block Elements

Problem: Currently, when styling OutSystems blocks, developers often need to rely on CSS selectors targeting the generated block. This process can be time-consuming and inefficient, especially when multiple blocks require consistent styling. Since the main block element does not provide a direct way to assign a CSS class, developers must write complex selectors to override or apply styles.

Proposed Solution: Introduce the ability to add custom CSS classes directly to the main block element within OutSystems. This would work similarly to how we can add classes to containers, inputs, or other widgets.

Benefits:

  1. Efficiency – Saves time by eliminating the need for complex selectors.

  2. Maintainability – Styles become easier to read, manage, and update.

  3. Consistency – Ensures reusable styling across different blocks.

  4. Developer Experience – Provides more flexibility and control for frontend developers.
    This would honestly be an amazing improvement for the front-end of OutSystems. Excited to see what you guys think.

    Thanks

I agree it would be nice if this were available OOTB, but an easy workaround that can be used in most blocks, is to add a top level container inside the block, and apply the class there.