Skip to content

Commit

Permalink
chore(project): sync generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
carbon-bot committed Jul 29, 2021
1 parent 4509b5f commit 068ccc4
Showing 1 changed file with 0 additions and 65 deletions.
65 changes: 0 additions & 65 deletions packages/grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,71 +70,6 @@ The `.bx--col-sm-1` class names tells us that this `<div>` should only span one
column at our `sm` breakpoint. By default, as we scale beyond the breakpoint the
layout will still take up a percentage of the overall width.

## Experimental CSS Grid Usage

_More examples and documentation can be found on this
[live demo website](https://carbon-elements.netlify.com/grid/examples/css-grid/)._

There is an experimental implementation of the Grid built using CSS Grid instead
of flexbox. This implementation ships with a 16 column grid.

`@carbon/grid` has two primitive class types to use in order to structure your
application. They include:

- `.#{$prefix}--css-grid` - defines the overall grid context and sets some
useful attributes like width and margin
- `.#{$prefix}--col-span-*` - used to define individual columns

You can use a combination of these classes to build a layout. For example, if we
wanted a 4 column layout we could use the following markup:

```html
<div class="cds--css-grid">
<div class="cds--col-span-4"></div>
<div class="cds--col-span-4"></div>
<div class="cds--col-span-4"></div>
<div class="cds--col-span-4"></div>
</div>
```

While this layout can work for some grid usage scenarios, we probably will want
more control over how many columns our layout will span at each given
breakpoint.

By default, this uses the breakpoints defined in `@carbon/grid`. There are five
breakpoints: `sm`, `md`, `lg`, `xlg`, and `max`. You can use each one in
combination with a column to specify the number of columns to span at a given
breakpoint. For example, if we wanted four columns to change widths or be hidden
at various breakpoints we could use the following markup:

```html
<div class="cds--css-grid">
<div class="cds--sm:col-span-2 cds--md:col-span-4 cds--lg:col-span-6">
<p>Small: Span 2 of 4</p>
<p>Medium: Span 4 of 8</p>
<p>Large: Span 6 of 16</p>
</div>
<div class="cds--sm:col-span-2 cds--md:col-span-2 cds--lg:col-span-3">
<p>Small: Span 2 of 4</p>
<p>Medium: Span 2 of 8</p>
<p>Large: Span 3 of 16</p>
</div>
<div class="cds--sm:col-span-0 cds--md:col-span-2 cds--lg:col-span-3">
<p>Small: Span 0 of 4</p>
<p>Medium: Span 2 of 8</p>
<p>Large: Span 3 of 16</p>
</div>
<div class="cds--sm:col-span-0 cds--md:col-span-0 cds--lg:col-span-4">
<p>Small: Span 0 of 4</p>
<p>Medium: Span 0 of 8</p>
<p>Large: Span 4 of 16</p>
</div>
</div>
```

The `.cds--sm:col-span-2` class names tells us that this `<div>` should only
span two columns at our `sm` breakpoint.

## 📚 Examples

If you're looking for more examples on how to use `@carbon/grid`, we have some
Expand Down

0 comments on commit 068ccc4

Please sign in to comment.