Last active
December 21, 2015 06:39
-
-
Save swaydeng/6265843 to your computer and use it in GitHub Desktop.
A LESS code style for browsers that don't support media query, that would be better if Mixins could be passed into rulesets as parameters.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media (max-width: 1440px) { | |
.layout .grid { | |
width: 1190px; | |
} | |
.sidebar { | |
float: left; | |
} | |
.sidebar li { | |
display: block; | |
vertical-align: bottom; | |
} | |
} | |
.max1440 .layout .grid { | |
width: 1190px; | |
} | |
.max1440 .sidebar { | |
float: left; | |
} | |
.max1440 .sidebar li { | |
display: block; | |
vertical-align: bottom; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define some useful strings globally | |
@mq1440: ~"(max-width: 1440px)"; | |
@mq1280: ~"(max-width: 1280px)"; | |
@mq1024: ~"(max-width: 1024px)"; | |
// class set that need apply under media query conditions. | |
.clzset () { | |
.layout .grid { | |
width: 1190px; | |
} | |
.sidebar { | |
float: left; | |
} | |
.sidebar li { | |
display: block; | |
vertical-align: bottom; | |
} | |
} | |
// browsers that support mq | |
@media @mq1440 { | |
.clzset(); | |
} | |
// browsers that don't support mq | |
.max1440 { | |
.clzset(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
less-source.css 使用的是 less 源码,经它编译得到的 css 代码是 css-source.css