项目作者: AlienCreations

项目描述 :
Responsive media queries for LESS
高级语言: CSS
项目地址: git://github.com/AlienCreations/responsiveless.git
创建时间: 2015-09-13T16:05:35Z
项目社区:https://github.com/AlienCreations/responsiveless

开源协议:MIT License

下载


responsiveLESS

Media query mixins for common devices.


Credit and special thanks goes to CSS-Tricks.com for
providing the actual media queries, which we simply converted to mixins for rule and orientation pass-through.

Usage

All mixins will take one @rules argument and an optional @orientation argument. Omitting the
@orientation argument will enforce the rule on both orientations.

Example contract:

  1. .tablets(@rules)
  2. .tablets(@rules, @orientation)

This allows targeting all tablets in either orientation like so:

  1. .tablets({ margin : 20px; });

Or, specifying unique rules respectively:

  1. .tablets({ margin : 20px; }, portrait);
  2. .tablets({ margin : 40px; }, landscape);

Example:

  1. @import '/bower_components/responsiveless/index'
  2. .some-element-class {
  3. font-size : 1.5rem;
  4. background-color : #EFEFEF;
  5. color : #000;
  6. .phones({
  7. color : red;
  8. }, portrait);
  9. .tablets({
  10. color : blue;
  11. }, portrait);
  12. }

Mixins Included

The mixins are inclusively hierarchical, meaning .phones() will leverage rules from .iPhones(), which will
leverage rules from .iPhone4(), .iPhone5(), .iPhone6(), and .iPhone6Plus(), for example. Due to the way the
rules were written, some targeting overlap will occur.

All mixins invoked with (@rules, [@orientation]):

  1. .laptops
  2. .retina
  3. .nonRetina
  4. .phones
  5. .galaxyPhones
  6. .galaxyS3
  7. .galaxyS4
  8. .galaxyS5
  9. .htcPhones
  10. .htcOne
  11. .iPhones
  12. .iPhone4
  13. .iPhone5
  14. .iPhone6
  15. .iPhone6Plus
  16. .tablets
  17. .galaxyTablets
  18. .galaxyTab10
  19. .iPads
  20. .iPad1stGen
  21. .iPad1
  22. .iPad2
  23. .iPad2ndGen
  24. .iPad3
  25. .iPad4
  26. .iPadMini
  27. .kindleFireTablets
  28. .kindleFire7Inch
  29. .kindleFire8Point9Inch
  30. .nexusTablets
  31. .asusNexus7
  32. .wearables
  33. .appleWearables
  34. .appleWatch
  35. .motoWearables
  36. .moto360