How to add custom flex attributes for different sizes of the screen? Referring to the spec here : https://material.angularjs.org/latest/#/layout/options
For example, the flex attribute
flex-gt-lg
Sets flex on devices greater than 1200px wide. I want to add one more attribute say something like flex-gt-lgx
which sets flex on devices greater than 1600px wide, for which angular material does not provide support. How will do something like this?
Based on @codeMan answer with media query ...
Custom Angular directive
You could write a custom directive for
flex-gt-lgx
that would generate the CSS to be apply in thestyle
attribute with the desired flex value passed from the directive parameter.That way you wouldn't be limited to the hardcoded CSS values.
Mimic the Angular Material CSS
You could make the same thing as Angular Material and create all the CSS for possible flex values as stated in their documentation and than use the
flex-gt-lgx
attribute on the desired HTML tag just like any other flex directive.https://material.angularjs.org/latest/layout/children
codeMan,
You will have to change the CSS in a way or another.
Complex way
Go to their css resources an alter it to fit your needs
Easier way
Create your own CSS changes overwriting theirs with
!important
Cheers!
I wrote a media query as follows :
and used the following span tag
and it worked as expected!!
Note: Downside of doing this is that
flex-gt-lgx
should be always set to25
value.