Using flexbox with angular 2 components

前端 未结 3 778
长情又很酷
长情又很酷 2021-02-05 10:49

I want to update visual side(grid, colors) of my angular 2 application. Old layout was build with bootstrap 4, which I don\'t really need anymore. I decided to go for plain css3

相关标签:
3条回答
  • 2021-02-05 11:22

    The angular team released their own flex-layout package, so you don't need to write it by your self anylonger:

    https://github.com/angular/flex-layout

    0 讨论(0)
  • 2021-02-05 11:30

    I fixed this issue by adding styles to component. For example:

    :host {
      display: flex;
    }
    

    :host {} was the key.

    0 讨论(0)
  • 2021-02-05 11:30

    :host selector solves the problem but you end using it very often in many components.

    I used instead the following global CSS:

    .row > * {
      display: flex;
      flex-basis: 100%;
    }
    
    0 讨论(0)
提交回复
热议问题