Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Breakpoint ng classes override the default ngClass class lists  #279

@avatsaev

Description

@avatsaev

https://github.com/angular/flex-layout/wiki/ngClass-API#merging-classes

Note that the default classes (specified by class="" and ngClass="..." will be preserved (and merged) into other activation class lists

this part of the documentation is completely untrue.

the breakpoint ngClasses are overriding the simple ngClass behaviour in this code:

<div class="viewport"

     [ngClass]="{
        'dark-mode': readerService.readerViewPortTheme == 'dark',
        'light-mode': readerService.readerViewPortTheme == 'light',
        'dusk-mode': readerService.readerViewPortTheme == 'dusk'
      }"

     [ngClass.gt-md]="'pad-3'"
     [ngClass.md]="'pad-3'"
     [ngClass.sm]="'pad-1'"
     [ngClass.xs]="'pad-0'"
>

when 'pad-x' class is added to the div it removes 'x-mode' class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Issue that is important to resolve as soon as possible

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions