mobile.scss 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. $width:(240px,320px,360px,480px,640px,720px,800px,960px,1024px,1280px);
  2. @mixin respond-to($size,$orientation:portrait){
  3. @media screen and (max-device-width: $size) and (min-device-width: $size - 20) {
  4. body{
  5. @if $size > 480 {
  6. width:$size/2;
  7. }
  8. @else {
  9. width: $size;
  10. }
  11. margin:0 auto;
  12. .wrapper{
  13. width:100%;
  14. header{
  15. padding: 30px 0 20px;
  16. h1{
  17. background-size: 200px auto;
  18. background-position: 50px 0;
  19. padding-top: 90px;
  20. height: 45px;
  21. a{
  22. background-size: 160px auto;
  23. background-position: 10px 0;
  24. }
  25. }
  26. p.desc{
  27. font-size: 16px;
  28. }
  29. }
  30. footer {
  31. margin: 20px 0;
  32. }
  33. #page-demo{
  34. width:96%;
  35. margin:0 2%;
  36. }
  37. #link-fork{
  38. z-index: -1;
  39. $w: $size/9;
  40. @if $w > 100px { $w:100px };
  41. @if $w < 80px { $w: 80px };
  42. width:$w;
  43. height: auto;
  44. img{
  45. max-width: $w;
  46. height: auto;
  47. }
  48. }
  49. }
  50. }
  51. nav{
  52. display: none;
  53. }
  54. }
  55. }
  56. @each $w in $width {
  57. @include respond-to($w);
  58. }
  59. //iphone5,5s
  60. @media screen and (device-aspect-ratio: 40/71) and (orientation: landscape) {
  61. body{
  62. width:568px;
  63. }
  64. }
  65. //iphone<5
  66. @media screen and (device-aspect-ratio: 2/3) and (orientation: landscape) {
  67. body{
  68. width:480px;
  69. }
  70. }