Skip to content

Instantly share code, notes, and snippets.

@rsperl
Last active July 25, 2022 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsperl/667b8873a51591d20cc8bfd85b22615e to your computer and use it in GitHub Desktop.
Save rsperl/667b8873a51591d20cc8bfd85b22615e to your computer and use it in GitHub Desktop.
angular styling priorities #angular #snippet
  1. [ngStyle]={fontSize: '1em'}
  2. [style.fontSize.em]=2
  3. [style]={fontSize: '3em'}
  4. style="font-size: 4em"

  1. @Directive({host: {'[style.fontSize.em]': 5}})
  2. @Directive({host: {'style': 'fontSize: 6em;'}})

  1. @Component({host: {'[style.fontSize.em]': 7}})
  2. @Component({host: {'style': 'font-size: 8em;'}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment