Skip to content

Less files : Class name separator issue #409

Closed
@Nuranto

Description

@Nuranto

Preconditions

M2.4.4
Coding standard v25

Steps to reproduce

  1. Create a module
  2. Add file view/css/source/_module.less with content :
/**
 * @DoNotInject
 */
.admin__menu {
    .item-mymodule.level-0 {
        & > a {
            min-height: auto;
            padding: 1rem;
            &:before {
                content: url('Namespace_Module::images/module-logo.png');
                display: block;
                height: 28px;
                margin-bottom: .5rem;
            }
        }
    }
}
  1. Launch phpcs

Expected result

No errors

Actual result

4 | WARNING | CSS class names should be separated with "-" (dash)
    |         | instead of "_" (underscore)

Notes

We should either :

  • remove that rule since it is not respected by M2 core code.
  • Fix class names in core M2 repo, but it will be a breaking change for all existing modules
  • add exceptions to that rule

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions