From 1a264be8b373419865f55f1c5f92890fd6bcbd03 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 25 Mar 2017 12:12:02 -0700 Subject: [PATCH] Redo semantic grid example and make it real in the docs --- docs/assets/scss/_component-examples.scss | 34 ++++++++++++++++++++++ docs/layout/grid.md | 35 ++++++++++++----------- 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/docs/assets/scss/_component-examples.scss b/docs/assets/scss/_component-examples.scss index ab3a48dde2..dd3cc190c2 100644 --- a/docs/assets/scss/_component-examples.scss +++ b/docs/assets/scss/_component-examples.scss @@ -37,6 +37,40 @@ border: 1px solid rgba($bd-purple, .15); } +// Grid mixins +.example-container { + width: 800px; + @include make-container(); +} + +.example-row { + @include make-row(); +} + +.example-content-main { + @include make-col-ready(); + + @include media-breakpoint-up(sm) { + @include make-col(6); + } + + @include media-breakpoint-up(lg) { + @include make-col(8); + } +} + +.example-content-secondary { + @include make-col-ready(); + + @include media-breakpoint-up(sm) { + @include make-col(6); + } + + @include media-breakpoint-up(lg) { + @include make-col(4); + } +} + // // Container illustrations diff --git a/docs/layout/grid.md b/docs/layout/grid.md index ab056a8d32..67a7289f6c 100644 --- a/docs/layout/grid.md +++ b/docs/layout/grid.md @@ -646,46 +646,47 @@ Mixins are used in conjunction with the grid variables to generate semantic CSS You can modify the variables to your own custom values, or just use the mixins with their default values. Here's an example of using the default settings to create a two-column layout with a gap between. -See it in action in this rendered example. - {% highlight scss %} -.container { - max-width: 60em; +.example-container { + width: 800px; @include make-container(); } -.row { + +.example-row { @include make-row(); } -.content-main { + +.example-content-main { @include make-col-ready(); - @media (max-width: 32em) { + @include media-breakpoint-up(sm) { @include make-col(6); } - @media (min-width: 32.1em) { + @include media-breakpoint-up(lg) { @include make-col(8); } } -.content-secondary { + +.example-content-secondary { @include make-col-ready(); - @media (max-width: 32em) { + @include media-breakpoint-up(sm) { @include make-col(6); } - @media (min-width: 32.1em) { + @include media-breakpoint-up(lg) { @include make-col(4); } } {% endhighlight %} -{% highlight html %} -
-
-
...
-
...
+{% example html %} +
+
+
Main content
+
Secondary content
-{% endhighlight %} +{% endexample %} ## Customizing the grid