Doug Stewart avatar Doug Stewart committed e43480f

More LESS.

Comments (0)

Files changed (6)

layouts/less/2-columns-fixed-sb-right-under-full.less

-/*
- @containerwidth: 960px
- @lbcontentwidth: 700px
- @primarysbwidth: 200px
- @secondarysbwidth: 100%
-*/
-#container{width:@containerwidth;margin:0 auto}
-#lb-content{float:left;width:@lbcontentwidth}
-#primarysb{float:right;width:@primarysbwidth}
-#secondarysb{clear:both;width:@secondarysbwidth}
+#container{.setwidth(@containerwidth, 960px);margin:0 auto}
+#lb-content{float:left;.setwidth(@lbcontentwidth, 700px)}
+#primarysb{float:right;.setwidth(@primarysbwidth, 200px)}
+#secondarysb{clear:both;.setwidth(@secondarysbwidth, 100%)}

layouts/less/2-columns-fixed-sb-right-under.less

-/*
- containerwidth: 960px
- lbcontentwidth: 700px
- primarysbwidth: 200px
- secondarysbwidth: 700px
- footerwidth: 100%
-*/
-#container{width:@containerwidth;margin:0 auto}
-#lb-content{float:left;width:@lbcontentwidth}
-#primarysb{float:right;width:@primarysbwidth}
-#secondarysb{float:left;width:@secondarysbwidth}
-#footer{clear:both;width:@footerwidth}
+#container{.setwidth(@containerwidth, 960px);margin:0 auto}
+#lb-content{float:left;.setwidth(@lbcontentwidth, 700px)}
+#primarysb{float:right;.setwidth(@primarysbwidth, 200px)}
+#secondarysb{float:left;.setwidth(@secondarysbwidth, 700px)}
+#footer{clear:both;.setwidth(@footerwidth, 100%)}

layouts/less/2-columns-fixed-sb-right.less

  secondarysbwidth: 200px
  foooterwidth: 100%
 */
-#container{width:@containerwidth;margin:0 auto}
-#lb-content{float:left;width:@lbcontentwidth}
-#primarysb{float:right;width:@primarysbwidth}
-#secondarysb{float:right;clear:right;width:@secondarysbwidth}
-#footer{clear:both;width:@footerwidth}
+#container{.setwidth(@containerwidth, 960px);margin:0 auto}
+#lb-content{float:left;.setwidth(@lbcontentwidth, 700px)}
+#primarysb{float:right;.setwidth(@primarysbwidth, 200px)}
+#secondarysb{float:right;clear:right;.setwidth(@secondarysbwidth, 200px)}
+#footer{clear:both;.setwidth(@footerwidth, 100%)}

layouts/less/2-columns-fluid-sb-fixed-left-sb-under.less

  @primarysbwidth: 200px;
  @secondarysbwidth: 100%;
 */
-#wrapper{float:left;width:@wrapperwidth}
-#lb-content{margin-left:@primarysbwidth}
-#primarysb{float:left;width:@primarysbwidth;margin-left:-@wrapperwidth}
-#secondarysb{clear:left;width:@secondarysbwidth}
+#wrapper{float:left;.setwidth(@wrapperwidth, 100%)}
+#lb-content{.defaultn('margin-left', @primarysbwidth, 200px)}
+#primarysb{float:left;.setwidth(@primarysbwidth, 200px);.defaultn('margin-left', @wrapperwidth, -100%)}
+#secondarysb{clear:left;.setwidth(@secondarysbwidth, 100%)}

layouts/less/2-columns-fluid-sb-fixed-left.less

  @primarysbwidth: 200px;
  @footerwidth: 100%;
 */
-#wrapper{float:right;width:@wrapperwidth;margin-left:-@primarysbwidth}
-#lb-content{margin-left:@primarysbwidth}
-#primarysb{float:left;width:@primarysbwidth}
-#secondarysb{float:left;clear:left;width:@primarysbwidth}
-#footer{clear:both;width:@footerwidth}
+#wrapper{float:right;.setwidth(@wrapperwidth, 100%);.defaultn('margin-left', @primarysbwidth, -200px)}
+#lb-content{.defaultn('margin-left', @primarysbwidth, 200px)}
+#primarysb{float:left;.setwidth(@primarysbwidth, 200px)}
+#secondarysb{float:left;clear:left;.setwidth(@primarysbwidth, 200px)}
+#footer{clear:both;.setwidth(@footerwidth, 100%)}

layouts/less/master.less

 .setwidth(@width, @defaultw) when not(isnumber(@width)){
 	width: @defaultw;
 }
-
 .layout(@layout) when (isstring(@layout)){
 	@import @layout;
 }
-
 .layout(@layout) when not (isstring(@layout)){
 	@import "2-columns-fixed-sb-right.less";
 }
 .layout(@layout);
+
+.defaultn(@prop, @value, @default) when (isnumber(@value)){
+	@prop: @value;
+	margin-right: @value;
+}
+.defaultn(@prop, @value, @default) when not (isnumber(@value)){
+	@@prop: @default;
+	margin-right: @default;
+}
+
 /*
 .layout(@layout) when ( @layout = 1-column-fixed ) {
 	@import "1-column-fixed.less";
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.