1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
/*
CSS media groups
*/
@media screen, projection {
html {
background: #fffef0;
color: #300;
}
body {
max-width: 35em;
margin: 0 auto;
}
}
/*
Variables
*/
@media print {
@var: 42;
.class {
color: blue;
.sub {
width: @var;
}
}
.top, header > h1 {
color: #222 * 2;
}
}
@media screen {
@base: 8;
body { max-width: @base * 60; }
}
/*
pseudo
*/
@media all and (orientation:portrait) {
aside { float: none; }
}
@media not screen and (color), print and (color) {
body { margin: 0 auto; }
}
/*
*/
@media (min-width: 768px) and (max-width: 979px) {
.hidden-desktop { display: none !important; }
}
@minwidth: 12px;
@media (min-width: @minwidth) {
body { margin: 0 auto; }
}
/*
Expressions
*/
@foo: 768px - 1;
@media (width: @foo) {
.visible-xs { display: block; }
}
/*
Vendor extensions and expressions
*/
@media
only screen and ( min--moz-device-pixel-ratio: 5/2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
background-size: 10px;
}
/*
Nested media queries
*/
.lead {
@media (width: 768px) {
font-size: 21px;
}
}
.one {
@media (width: 400px){
font-size: 1.2em;
@media print and (color) {
color: blue;
}
}
}
.two {
@media (width: 400px){
font-size: 1.2em;
}
@media print and (color) {
color: blue;
}
width: 100px;
}
.visible {
@media print {
color: green;
}
&.visible-sm {
@media screen {
color: green;
}
}
}
.navbar {
.form {
@media (max-width: 10px) {
margin-bottom: 5px;
}
}
}
|