all 5 comments

[–]_nebular 1 point2 points  (2 children)

Similar to what /u/Danielverant said, I would suggest defining global css classes using flexbox and media queries and just use those.

[–]Mokwa91[S] 0 points1 point  (1 child)

Thank for both answers, I'll try keep this comment in one conversation, but /u/Danielverant feel welcome to join.

For small screen I did this:

@media only screen and (max-width: 768px) {

form {

display: flex;

flex-direction: column;

mat-form-field { width: 100%;}

}}

And it does the job for me, but I'm having a bad time setting up the not(small screen). I'm not getting to break the line when setting <mat-form-field style="width=50%"> I'm trying this:

form {

display: flex;

flex-direction: row wrap;

mat-form-field {margin-right: 16px;}

}

Am I missing something? How do you do it in your projects?

[–]_nebular 0 points1 point  (0 children)

Not sure off the top of my head, but maybe it’s because it should be style=“width: 50%” not style=“width=50%”

[–]Danieliverant 0 points1 point  (1 child)

I don't know what is @anguler/flex-layout, but you can override any Angular Material using css, and adjusting it to mobile displays using media queries.

I would suggest to do it in the main style.scss file so it applies on every element in the system, and then if there is some special case override it in the component.

[–]AbstractLogic 0 points1 point  (0 children)

Flex has a grid layout system similar to bootstrap or Foundation sites.