Skip to content

Style element constructor (StyleElementConstructors)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Error BSL Minor Yes 5 standard
badpractice

Description

You should use style elements to change the appearance, rather than setting specific values directly in the controls. This is required in order for similar controls to look the same in all forms where they occur.

Types of style elements:

  • Color - RGB value is set
  • Font - type, size and style are set
  • Border - the type and width of the borders are set

Examples

Sources

System of standards * Source: Standard: Style Elements (RU)

Snippets

Diagnostic ignorance in code

// BSLLS:StyleElementConstructors-off
// BSLLS:StyleElementConstructors-on

Parameter for config

"StyleElementConstructors": false