Warning, /webapps/ocs-webserver/library/lessphp/tests/inputs/mixins.less is written in an unsupported language. File is not indexed.
0001 0002 @rounded-corners { 0003 border-radius: 10px; 0004 } 0005 0006 .bold { 0007 @font-size: 20px; 0008 font-size: @font-size; 0009 font-weight: bold; 0010 } 0011 0012 body #window { 0013 @rounded-corners; 0014 .bold; 0015 line-height: @font-size * 1.5; 0016 } 0017 0018 #bundle { 0019 .button { 0020 display: block; 0021 border: 1px solid black; 0022 background-color: grey; 0023 &:hover { background-color: white } 0024 } 0025 } 0026 #header a { 0027 color: orange; 0028 #bundle > .button; // mixin the button class 0029 } 0030 0031 div { 0032 @abstract { 0033 hello: world; 0034 b { 0035 color: blue; 0036 } 0037 } 0038 0039 @abstract > b; 0040 @abstract; 0041 } 0042 0043 @poop { 0044 big: baby; 0045 } 0046 0047 body { 0048 div; 0049 } 0050 0051 // not using > to list mixins 0052 0053 .hello { 0054 .world { 0055 color: blue; 0056 } 0057 } 0058 0059 .foobar { 0060 .hello .world; 0061 } 0062 0063 0064 .butter { 0065 .this .one .isnt .found; 0066 } 0067 0068 0069 // arguments 0070 0071 .spam(@something: 100, @dad: land) { 0072 @wow: 23434; 0073 foo: @arguments; 0074 bar: @arguments; 0075 } 0076 0077 .eggs { 0078 .spam(1px, 2px); 0079 .spam(); 0080 } 0081 0082 .first(@one, @two, @three, @four: cool) { 0083 cool: @arguments; 0084 } 0085 0086 #hello { 0087 .first(one, two, three); 0088 } 0089 0090 #hello-important { 0091 .first(one, two, three) !important; 0092 } 0093 0094 .rad(@name) { 0095 cool: @arguments; 0096 } 0097 0098 #world { 0099 @hello: "world"; 0100 .rad("@{hello}"); 0101 } 0102 0103 .second(@x, @y:skip, @z: me) { 0104 things: @arguments; 0105 } 0106 0107 #another { 0108 .second(red, blue, green); 0109 .second(red blue green); 0110 } 0111 0112 0113 .another(@x, @y:skip, @z:me) { 0114 .cool { 0115 color: @arguments; 0116 } 0117 } 0118 0119 #day { 0120 .another(one,two, three); 0121 .another(one two three); 0122 } 0123 0124 0125 .to-be-important() { 0126 color: red; 0127 @color: red; 0128 height: 20px; 0129 0130 pre { 0131 color: @color; 0132 } 0133 } 0134 0135 .mix-suffix { 0136 .to-be-important() !important; 0137 } 0138 0139 0140 0141 0142 #search-all { 0143 .red() { 0144 color:#f00 !important; 0145 } 0146 } 0147 0148 #search-all { 0149 .green() { 0150 color: #0f0 !important; 0151 } 0152 } 0153 0154 .search-test { 0155 #search-all > .red(); 0156 #search-all > .green(); 0157 } 0158 0159 0160 // mixin self without infinite loop 0161 .cowboy() { 0162 color: blue; 0163 } 0164 0165 .cowboy { 0166 .cowboy; 0167 } 0168 0169 0170 // semicolon 0171 0172 .semi1(@color: red, blue, green;) { 0173 color: @color; 0174 } 0175 0176 .semi2(@color: red, blue, green; dad) { 0177 color: @color; 0178 } 0179 0180 .semi3(hello; world; piss) { 0181 hello: world; 0182 } 0183 0184 0185 0186 // self referencing skipping 0187 0188 .nav-divider(@color: red){ 0189 padding: 10px; 0190 } 0191 0192 .nav { 0193 .nav-divider { 0194 .nav-divider(); 0195 } 0196 } 0197 0198 .nav-divider { 0199 .nav-divider(); 0200 } 0201 0202