Commits

Doug Stewart committed d391e42

This is even more LESS. LESS more?

Comments (0)

Files changed (13)

includes/functions/hooks.php

 }
 add_action( 'lblg_after_itemtext', 'lblg_post_info' );
 
+/**
+ * Determine which stylesheets and layouts are to be applied and then add them to the
+ * <head> via Core methods.
+ */
 function lblg_styles(){
 	global $lblg_shortname, $lblg_options;
 	$layout_handle = $lblg_shortname . '_layout_stylesheet';
 		break;
 	}
 	
-	if( isset($layout) ){
-		wp_enqueue_style( $layout_handle , $layout, '', '', 'screen' );
+	if( isset($layout) ){ 
+		//wp_enqueue_style( $layout_handle , $layout, '', '', 'screen' );
 	}
 	
 	// if( isset($alt_style) ){
 	// 		wp_enqueue_style( $alt_style_handle, $alt_style, '', '', 'screen' );
 	// }
 	
+	wp_enqueue_style( 'lblg_normalize', get_template_directory_uri() . '/includes/css/normalize.css/normalize.css', '', '', 'screen' );
 	wp_enqueue_style( $alt_style_handle, get_template_directory_uri() . '/styles/less/ng2.less', '', '', 'screen' );
 	
 	//wp_enqueue_style( $normalize_handle, get_template_directory_uri() . '/includes/css/normalize.css/normalize.css', '', '', 'screen' );
 }
 add_action( 'lblg_enqueue_styles', 'lblg_styles' );
 
+/**
+ * Spool up the LESS stylesheet handling.
+ *
+ * @param array $vars
+ * @param string $handle
+ * @return array 
+ */
+function lblg_less_vars( $vars, $handle ) {
+	// $vars['layout'] = '3-columns-fixed-sb-right';
+	$vars['layout'] = '3-columns-fixed-sb-right';
+	 // $vars['wrapperwidth'] = '50%';
+	// $vars['primarysbwidth'] = '600px';
+	// $vars['containerwidth'] = "960px";
+	// $vars['primarysbwidth'] = $vars['secondarysbwidth'] = "60%";
+	// 	$vars['footerwidth'] = "100%";
+	return $vars;
+}
+add_filter( 'less_vars', 'lblg_less_vars', 10, 2 );
 
 function lblg_credits(){
 	global $lblg_shortname, $lblg_options;

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

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

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

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

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

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

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

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

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

-/*
- @wrapperwidth: 70%;
- @primarysbwidth: 29.9%;
- @secondarysbwidth: 100%;
-*/
-#wrapper{float:right;width:@wrapperwidth}
-#primarysb{float:left;width:@primarysbwidth}
-#secondarysb{clear:both;width:@secondarysbwidth}
+#wrapper{float:right;.setwidth(@wrapperwidth, 70%)}
+#primarysb{float:left;.setwidth(99.9% - @wrapperwidth, 29.9%)}
+#secondarysb{clear:both;.setwidth(@secondarysbwidth, 100%)}

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

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

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

-/*
- @wrapperwidth: 70%;
- @primarysbwidth: 29.9%;
- @secondarysbwidth: 100%;
-*/
-#wrapper{float:left;width:@wrapperwidth}
-#primarysb{float:right;width:@primarysbwidth}
-#secondarysb{clear:both;width:@secondarysbwidth}
+#wrapper{float:left;.setwidth(@wrapperwidth, 70%)}
+#primarysb{float:right;.setwidth((99.9% - @wrapperwidth), 29.9%)}
+#secondarysb{clear:both;.setwidth(@secondarysbwidth, 100%)}

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

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

layouts/less/3-columns-fixed-sb-both.less

-/*
- @containerwidth: 960px;
- @wrapperwidth: 100%;
- @primarysbwidth: 150px;
- @footerwidth: 100%;
-*/
-#container{width:@containerwidth;margin:0 auto}
-#wrapper{float:left;width:@wrapperwidth}
-#lb-content{margin: 0 @primarysbwidth - 5px}
-#primarysb{float:left;width:@primarysbwidth;margin-left:-@containerwidth}
-#secondarysb{float:left;width:@primarysbwidth;margin-left:-@primarysbwidth}
-#footer{clear:left;width:@footerwidth}
+/* Custom mix-in for this layout only. */
+.lbmargin(@margin, @default) when (isnumber(@margin)){
+	margin: 0 (@margin - 5px);
+}
+.lbmargin(@margin, @default) when not (isnumber(@margin)){
+	margin: 0 @default;
+}
+#container{.setwidth(@containerwidth, 960px);margin:0 auto}
+#wrapper{float:left;.setwidth(@wrapperwidth, 100%)}
+#lb-content{.lbmargin(@primarysbwidth, 145px)}
+#primarysb{float:left;.setwidth(@primarysbwidth, 150px);.marginl(-@containerwidth, -960px)}
+#secondarysb{float:left;.setwidth(@primarysbwidth, 150px);.marginl(-@primarysbwidth, -150px)}
+#footer{clear:left;.setwidth(@footerwidth, 100%)}
 div#container div#allwrapper{padding-left:0;padding-right:0;}

layouts/less/3-columns-fixed-sb-left.less

-/*
- @containerwidth: 960px;
- @wrapperwidth: 100%;
- @primarysbwidth: 150px;
- @footerwidth: 100%;
-*/
-#container{width:@containerwidth;margin:0 auto}
-#wrapper{float:left;width:@wrapperwidth}
-#lb-content{margin-left: @primarysbwidth * 2}
-#primarysb{float:left;width:@primarysbwidth;margin-left:-@containerwidth + 20px}
-#secondarysb{float:left;width:@primarysbwidth;margin-left:-@containerwidth + 20px + @primarysbwidth}
-#footer{clear:left;width:100%}
+#container{.setwidth(@containerwidth, 960px);margin:0 auto}
+#wrapper{float:left;.setwidth(@wrapperwidth, 100%)}
+#lb-content{.marginl(@primarysbwidth * 2, 300px)}
+#primarysb{float:left;.setwidth(@primarysbwidth, 150px);.marginl(-@containerwidth + 20px, -940px)}
+#secondarysb{float:left;.setwidth(@primarysbwidth, 150px);.marginl(-@containerwidth + 20px + @primarysbwidth, -790px)}
+#footer{clear:left;.setwidth(@footerwidth, 100%)}

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

-/*
- @containerwidth: 960px;
- @wrapperwidth: 100%;
- @primarysbwidth: 150px;
- @footerwidth: 100%;
-*/
-#container{width:@containerwidth;margin:0 auto}
-#wrapper{float:left;width:@wrapperwidth}
-#lb-content{margin-right: @primarysbwidth * 2}
-#primarysb{float:left;width:@primarysbwidth;margin-left:-@primarysbwidth * 2}
-#secondarysb{float:left;width:@primarysbwidth;margin-left:-@primarysbwidth}
-#footer{clear:left;width:@footerwidth}
+#container{.setwidth(@containerwidth, 960px);margin:0 auto}
+#wrapper{float:left;.setwidth(@wrapperwidth, 100%)}
+#lb-content{.marginr(@primarysbwidth * 2, 300px)}
+#primarysb{float:left;.setwidth(@primarysbwidth, 150px);.marginl(-@primarysbwidth * 2, -300px)}
+#secondarysb{float:left;.setwidth(@primarysbwidth, 150px);.marginl(-@primarysbwidth, -150px)}
+#footer{clear:left;.setwidth(@footerwidth, 100%)}

layouts/less/master.less

+/* Set width, fall back to a default if none specified */
 .setwidth(@width, @defaultw) when (isnumber(@width)){
 	width: @width;
 }
 .setwidth(@width, @defaultw) when not(isnumber(@width)){
 	width: @defaultw;
 }
+
+/* Specify left margin, fall back to a default. */
+.marginl(@margin, @default) when (isnumber(@margin)){
+	margin-left: @margin;
+}
+.marginl(@margin, @default) when not (isnumber(@margin)){
+	margin-left: @default;
+}
+
+/* Specify right margin, fall back to a default. */
+.marginr(@margin, @default) when (isnumber(@margin)){
+	margin-right: @margin;
+}
+.marginr(@margin, @default) when not (isnumber(margin)){
+	margin-right: @default;
+}
+
+/* Select a layout, fall back to a default if none specified */
 .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";
-}
-.layout(@layout) when (@layout = 1-column-fluid ) {
-	@import "1-column-fluid.less";
-}
-.layout(@layout) when (@layout = 2-columns-fixed-sb-left-under-full ) {
-	@import "2-columns-fixed-sb-left-under-full.less";
-}
-.layout(@layout) when (@layout = 2-columns-fixed-sb-left-under) {
-	@import "2-columns-fixed-sb-left-under.less";
-}
-.layout(@layout) when (@layout = 2-columns-fixed-sb-left) {
-	@import "2-columns-fixed-sb-left.less";
-}
-.layout(@layout) when (@layout = 2-columns-fixed-sb-right-under-full) {
-	@import "2-columns-fixed-sb-right-under-full.less";
-}
-.layout(@layout) when (@layout = 2-columns-fixed-sb-right-under) {
-	@import "2-columns-fixed-sb-right-under.less";
-}
-.layout(@layout) when (@layout = 2-columns-fixed-sb-right) {
-	@import "2-columns-fixed-sb-right.less";
-}
-.layout(@layout) when (@layout = 2-columns-fluid-sb-fixed-left-sb-under) {
-	@import "2-columns-fluid-sb-fixed-left-sb-under.less";
-}
-.layout(@layout) when (@layout = 2-columns-fluid-sb-fixed-left) {
-	@import "2-columns-fluid-sb-fixed-left.less";
-}
-.layout(@layout) when (@layout = 2-columns-fluid-sb-fixed-right-sb-under) {
-	@import "2-columns-fluid-sb-fixed-right-sb-under.less";
-}
-.layout(@layout) when (@layout = 2-columns-fluid-sb-fixed-right) {
-	@import "2-columns-fluid-sb-fixed-right.less";
-}
-.layout(@layout) when (@layout = 2-columns-percentage-sb-fixed-left-sb-under) {
-	@import "2-columns-percentage-sb-fixed-left-sb-under.less";
-}
-.layout(@layout) when (@layout = 2-columns-percentage-sb-fixed-left) {
-	@import "2-columns-percentage-sb-fixed-left";
-}
-.layout(@layout) when (@layout = 2-columns-percentage-sb-fixed-right-sb-under) {
-	@import "2-columns-percentage-sb-fixed-right-sb-under.less";
-}
-.layout(@layout) when (@layout = 2-columns-percentage-sb-fixed-right) {
-	@import "2-columns-percentage-sb-fixed-right.less";
-}
-.layout(@layout) when (@layout = 3-columns-fixed-sb-both) {
-	@import "3-columns-fixed-sb-both.less";
-}
-.layout(@layout) when (@layout = 3-columns-fixed-sb-left) {
-	@import "3-columns-fixed-sb-left.less";
-}
-.layout(@layout) when (@layout = 3-columns-fixed-sb-right) {
-	@import "3-columns-fixed-sb-right.less";
-}
-.layout(@layout) when (@layout = 3-columns-fluid-sb-fixed-both) {
-	@import "3-columns-fluid-sb-fixed-both.less";
-}
-.layout(@layout) when (@layout = 3-columns-fluid-sb-fixed-left) {
-	@import "3-columns-fluid-sb-fixed-left.less";
-}
-.layout(@layout) when (@layout = 3-columns-fluid-sb-fixed-right) {
-	@import "3-columns-fluid-sb-fixed-right.less";
-}
-.layout(@layout) when (@layout = 3-columns-percentage-sb-both) {
-	@import "3-columns-percentage-sb-both.less";
-}
-.layout(@layout) when (@layout = 3-columns-percentage-sb-left) {
-	@import "3-columns-percentage-sb-left.less";
-}
-.layout(@layout) when (@layout = 3-columns-percentage-sb-right) {
-	@import "3-columns-percentage-sb-right.less";
-}
-.layout(@layout) when (@layout = 3-columns-sb-both-hybrid-left) {
-	@import "3-columns-sb-both-hybrid-left.less";
-}
-.layout(@layout) when (@layout = 3-columns-sb-both-hybrid-right) {
-	@import "3-columns-sb-both-hybrid-right.less";
-}
-.layout(@layout) when (@layout = 3-columns-sb-left-hybrid) {
-	@import "3-columns-sb-left-hybrid.less";
-}
-.layout(@layout) when (@layout = 3-columns-sb-right-hybrid) {
-	@import "3-columns-sb-right-hybrid.less";
-}
-
-.layout(@layout);*/
+.layout(@layout);
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.