diff --git a/class.cmb-meta-box.php b/class.cmb-meta-box.php index 16893ae2..d9e161d3 100644 --- a/class.cmb-meta-box.php +++ b/class.cmb-meta-box.php @@ -227,7 +227,7 @@ static function layout_fields( array $fields ) { ?>
- +
if ( $current_colspan == 0 ) : ?> -
+
?> -
+ - - + -
+
-
> - display(); ?> -
+
> + display(); ?> +
- + -
+
diff --git a/css/src/layout.css b/css/src/layout.css index 66f8630f..1d0f41df 100644 --- a/css/src/layout.css +++ b/css/src/layout.css @@ -1,24 +1,56 @@ /** CMB Layout **/ -.cmb_metabox .form-table { - margin-top: 0; +.cmb_metabox .field { + padding: 16px 0; + border-bottom: 1px solid #DFDFDF; } -.cmb_metabox .form-table > tbody > tr > td, -.cmb_metabox .form-table > tbody > tr > th { - vertical-align: top; - padding: 0; +.cmb-row:last-child > [class*="cmb-cell-"] > .field { + border-bottom: 0; } -.cmb_metabox .form-table tr:last-child > td, -.cmb_metabox .form-table tr:last-child > th { - border-bottom: 0; +/* Neaten up the margins when metaboxes are within the standard postbox. */ +.postbox > .inside > .cmb_metabox { + margin: -10px 0; } -.cmb_metabox .field { - padding: 16px 0; +.cmb-grid .cmb-row { + overflow: hidden; + margin: 0 -5px; + zoom: 1; } -.postbox > .inside > .cmb_metabox { - margin: -10px 0; +.cmb-grid .cmb-row:before, +.cmb-grid .cmb-row:after { + content: ""; + display: table; +} +.cmb-grid .cmb-row:after { + clear: both; +} + +.cmb-grid [class*="cmb-cell-"] { + float: left; + padding: 0 5px; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.cmb-grid .cmb-cell-1 { width: 8.333333333%; } +.cmb-grid .cmb-cell-2 { width: 16.666666667%; } +.cmb-grid .cmb-cell-3 { width: 25%; } +.cmb-grid .cmb-cell-4 { width: 33.333333333%; } +.cmb-grid .cmb-cell-5 { width: 41.666666667%; } +.cmb-grid .cmb-cell-6 { width: 50%; } +.cmb-grid .cmb-cell-7 { width: 58.333333333%; } +.cmb-grid .cmb-cell-8 { width: 66.666666667%; } +.cmb-grid .cmb-cell-9 { width: 75%; } +.cmb-grid .cmb-cell-10 { width: 83.333333333%; } +.cmb-grid .cmb-cell-11 { width: 91.666666667%; } +.cmb-grid .cmb-cell-12 { width: 100%; } + +@media all and ( max-width: 850px ) { + + .cmb-grid [class*="cmb-cell-"] { width: 100%; } + }