Fancy Media Queries with some LESS Magic

后端 未结 8 1392
别跟我提以往
别跟我提以往 2020-12-04 05:23

It would be nice to wrap css-styles for different resolutions within some css-classes using less.

I\'d like to do something like:

footer {
  width: 1         


        
8条回答
  •  -上瘾入骨i
    2020-12-04 05:54

    @highdensity:  ~"only screen and (-webkit-min-device-pixel-ratio: 1.5)",
                   ~"only screen and (min--moz-device-pixel-ratio: 1.5)",
                   ~"only screen and (-o-min-device-pixel-ratio: 3/2)",
                   ~"only screen and (min-device-pixel-ratio: 1.5)";
    
    @mobile:        ~"only screen and (max-width: 750px)";
    @tab:       ~"only screen and (min-width: 751px) and (max-width: 900px)";
    @regular:        ~"only screen and (min-width: 901px) and (max-width: 1280px)";
    @extra-large:  ~"only screen and (min-width: 1281px)";
    

提交回复
热议问题