How to force nested dynamic component HTML content in standard layout with CSS grid?

Asked
Active3 hr before
Viewed126 times

7 Answers

standardcomponentnestedcontentlayout
90%

The Bootstrap Grid System is used for layout, specifically Responsive Layouts, Understanding how it works is vital to understanding Bootstrap

Example_snippet/controller/utility/_standard.js/ <div class="container"> <di. . .
<div class="container">
   <div class="row">
      <div class="col">I'm your content inside the grid!</div>
   </div>
</div>
Step 2 continued with <div class="container"> <di. . .
<div class="container">
   <div class="row">
      <div class="col">Left column</div>
      <div class="col">Right column</div>
   </div>
</div>
Step 3 continued with <div class="container"> <di. . .
<div class="container">
   <div class="row">
      <div class="col">Left column</div>
      <div class="col">Center column</div>
      <div class="col">Right column</div>
   </div>
</div>
load more v
88%

Bootstrap's grid system uses a series of containers, rows, and columns to layout and align content, It's built with flexbox and is fully responsive

Example_snippet/controller/utility/_standard.js/ <b-container class="bv-example. . .
<b-container class="bv-example-row">
   <b-row>
      <b-col>1 of 3</b-col>
      <b-col>2 of 3</b-col>
      <b-col>3 of 3</b-col>
   </b-row>
</b-container>

<!-- b-grid-how-it-works.vue -->
load more v
72%

Use our powerful mobile-first flexbox grid to build layouts of all shapes and sizes thanks to a twelve column system, five default responsive tiers, Sass variables and mixins, and dozens of predefined classes,,Bootstrap’s grid system uses a series of containers, rows, and columns to layout and align content

Example_snippet/controller/utility/_standard.js/ <div class="container"> <div. . .
<div class="container">
   <div class="row">
      <div class="col-sm">
         One of three columns
      </div>
      <div class="col-sm">
         One of three columns
      </div>
      <div class="col-sm">
         One of three columns
      </div>
   </div>
</div>
load more v
65%

So do you recommend using both :before and :after?,(and on a sidenote, I really like the reply/comment layout, Clean, attractive, interesting),I agree with the above comments about keeping it semantic and using preprocessors for grids

Example_snippet/controller/utility/_standard.js/ <div class="grid"> <!-- 100%. . .
<div class="grid">
   <!-- 100% wide -->
</div>
Step 2 continued with <div class="grid"> <div clas. . .
<div class="grid">
   <div class="col-2-3">
      Main Content
   </div>
   <div class="col-1-3">
      Sidebar
   </div>
</div>
Step 3 continued with [class*='col-'] { float: lef. . .
[class *= 'col-'] {
   float: left;
}
Step 4 continued with .col-2-3 { width: 66.66%; } . . .
.col - 2 - 3 {
      width: 66.66 % ;
   }
   .col - 1 - 3 {
      width: 33.33 % ;
   }
Step 5 continued with .grid:after { content: ""; . . .
.grid: after {
   content: "";
   display: table;
   clear: both;
}
Step 6 continued with *, *:after, *:before { -webk. . .
*, *: after, *: before {
   -webkit - box - sizing: border - box; -
   moz - box - sizing: border - box;
   box - sizing: border - box;
}
Step 7 continued with [class*='col-'] { padding-ri. . .
[class *= 'col-'] {
   padding - right: 20 px;
}
[class *= 'col-']: last - of -type {
   padding - right: 0;
}
Step 8 continued with <div class="grid grid-pad"> . . .
<div class="grid grid-pad">
   Grid with outside gutters also
</div>
Step 9 continued with .grid-pad { padding: 20px 0 . . .
.grid - pad {
   padding: 20 px 0 20 px 20 px;
}
Step 10 continued with .grid-pad > [class*='col-']:la. . .
.grid - pad > [class *= 'col-']: last - of -type {
   padding - right: 20 px;
}
Step 11 continued with .col-1-2 { width: 50%; } .co. . .
.col - 1 - 2 {
      width: 50 % ;
   }
   .col - 1 - 4 {
      width: 25 % ;
   }
   .col - 1 - 8 {
      width: 12.5 % ;
   }
Step 12 continued with * { @include box-sizing(bord. . .
*{
   @include box - sizing(border - box);
}

$pad: 20 px;

.grid {
   background: white;
   margin: 0 0 $pad 0;

   &
   : after {
      /* Or @extend clearfix */
      content: "";
      display: table;
      clear: both;
   }
}

[class *= 'col-'] {
   float: left;
   padding - right: $pad;
   .grid &: last - of -type {
      padding - right: 0;
   }
}
.col - 2 - 3 {
      width: 66.66 % ;
   }
   .col - 1 - 3 {
      width: 33.33 % ;
   }
   .col - 1 - 2 {
      width: 50 % ;
   }
   .col - 1 - 4 {
      width: 25 % ;
   }
   .col - 1 - 8 {
      width: 12.5 % ;
   }

   /* Opt-in outside padding */
   .grid - pad {
      padding: $pad 0 $pad $pad;
      [class *= 'col-']: last - of -type {
         padding - right: $pad;
      }
   }
Step 13 continued with <div class="grid"> <div clas. . .
<div class="grid">
   <div class="col-2-3">
      <article class="module">
         stuff
      </article>
      <article class="module">
         stuff
      </article>
   </div>
   <div class="col-1-3">
      <aside class="module">
         Sidebar stuff. Sub modules?
      </aside>
   </div>
</div>
load more v
75%

If you can take your component and draw a grid over it, with rows and columns, It is two-dimensional — use grid layout for that

Example_snippet/controller/utility/_standard.js/ flex-grow. . .
flex - grow
Step 2 continued with flex-shrink. . .
flex - shrink
Step 3 continued with flex-basis. . .
flex - basis
load more v
40%

grid-template-columns,Level 2 of the CSS Grid Layout specification includes a subgrid value for grid-template-columns and grid-template-rows, This guide details what subgrid does, and gives some use cases and design patterns that are solved by the feature

Example_snippet/controller/utility/_standard.js/ subgrid. . .
subgrid
load more v
22%

I have a pretty standard layout of [menu column] + [content], and shoehorning the [content] part in the predefined layout proved to be difficult,,I don't know how the desired layout could be achieved, because the layout is injected with all sorts of Angular elements, so I can't really make a clean css, and I don't know how to style the content of the editor to fit into an outer css (if that makes sense)

Example_snippet/controller/utility/_component.js/ ------------------------------. . .
-----------------------------------
| | |
| list items | editor |
| | |
| | |
| | |-------------|
| | |cancel | save|
-----------------------------------
<div class="main-content">
   <div class="list">
      <app-list>
   </div>
   <div class="editor">
      <app-editor>
         <div class="buttons">
            <button>Cancel</button>
            <button>Save</button>
         </div>
   </div>
</div>
load more v