Skip to content

Commit

Permalink
Merge branch 'main' into add-tag-styles
Browse files Browse the repository at this point in the history
  • Loading branch information
dakahn authored Jul 23, 2021
2 parents aa579ba + b5d615e commit 3adcf95
Show file tree
Hide file tree
Showing 47 changed files with 795 additions and 189 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- name: Run yarn dedupe
Expand All @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- name: Install dependencies
Expand All @@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- name: Install dependencies
Expand All @@ -51,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- uses: actions/[email protected]
Expand All @@ -77,7 +77,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- uses: actions/[email protected]
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-react-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@main
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-vanilla-devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@main
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@main
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v1

- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Use Node.js 14.x
uses: actions/setup-node@v2.2.0
uses: actions/setup-node@v2.3.0
with:
node-version: '14.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion config/jest-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jest-config-carbon",
"private": true,
"description": "Jest configuration and preset for Carbon",
"version": "0.6.0",
"version": "0.7.0",
"license": "Apache-2.0",
"main": "index.js",
"repository": {
Expand Down
13 changes: 10 additions & 3 deletions docs/guides/setup/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,18 @@ but can be unexpected.
WSL)
- `sudo umount /mnt/c`
- `sudo mount -t drvfs C: /mnt/c -o metadata`
12. Change directories into your projects folder
12. Increase Linux OS limits to avoid errors in build process (limited by WSL by
default).
- https://muhammadtriwibowo.medium.com/set-permanently-ulimit-n-open-files-in-ubuntu-4d61064429a
- `ulimit -l 65536` -> Increases the maximum amount of locked memory
available to OS
- `ulimit -n 1048576` -> Increases the maximum amount of files that can be
in an open state
13. Change directories into your projects folder
`cd /mnt/c/Users/{username}/projects` (Only an example, use whatever you'd
like)
13. Clone our repo
14. Clone our repo
`git clone https://github.com/carbon-design-system/carbon.git`
14. In the root folder of your freshly cloned repo install and build
15. In the root folder of your freshly cloned repo install and build
- `yarn install`
- `yarn build`
188 changes: 172 additions & 16 deletions docs/migration/11.x-grid.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,178 @@
# Grid

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

## Table of Contents

- [Overview](#overview)
- [Changes](#changes)
- [Configuration](#configuration)
- [Grid](#grid)
- [Row](#row)
- [Column](#column)
- [Breakpoints](#breakpoints)
- [Offset](#offset)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

**Note: everything in this file is a work-in-progress and will be changed.**

## Overview

The `@carbon/grid` package has been modified to use a CSS Grid based
implementation, rather than the previous flexbox implementation.

The grid continues to be integrated into `carbon-components` as well as the new
`@carbon/styles` package. There is no need to install additional packages if you
are using `carbon-components` or `@carbon/styles` already.

## Changes

| Filename | v10 | v11 |
| ------------------- | ------------------------ | ---------------------------------------- |
| `scss/12.scss` | | Removed |
| `scss/_mixins.scss` | | |
| `scss/_mixins.scss` | `$carbon--aspect-ratios` | Removed, use styles package instead |
| `scss/_mixins.scss` | `@mixin carbon--grid` | |
| `scss/_prefix.scss` | | Removed, use `scss/_config.scss` instead |
| `scss/grid.scss` | | |
| `scss/index.scss` | | |

Notes

- The grid now uses 16 columns by default, there is no longer a 12 column mode
- Configure Sass Modules is now done through a `_config.scss` file (for things
like `$prefix`)
- Breakpoints are now defined in `@carbon/grid`
| Filename | v10 | v11 |
| ------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `scss/12.scss` | | Removed |
| `scss/_mixins.scss` | | |
| `scss/_mixins.scss` | `$carbon--aspect-ratios` | Removed, use styles package instead |
| `scss/_mixins.scss` | `@mixin carbon--grid` | Removed, used mixin from `_css-grid.scss` instead |
| `scss/_prefix.scss` | | Removed, use `scss/_config.scss` instead |
| `scss/grid.scss` | | Renamed to `_css-grid.scss` |
| | | `mixin css-grid` |
| | | `mixin subgrid` |
| | `.#{$prefix}--grid` | `.#{$prefix}--css-grid` |
| | `.#{$prefix}--grid--narrow` | `.#{$prefix}--css-grid--narrow` |
| | `.#{$prefix}--grid--condensed` | `.#{$prefix}--css-grid--condensed` |
| | `.#{$prefix}--row` | Removed, columns should be direct children of grid containers |
| | `.#{$prefix}--col` | `.#{$prefix}--col-span-1` (1-16 available) |
| | `.#{$prefix}--col-#{$breakpoint}-#{$columns}` (e.g. `bx--col-sm-2`) | `.#{$prefix}--#{$breakpoint}:col-span#{$columns}` (e.g. `bx--sm:col-span-2`) |
| | `.#{$prefix}--no-gutter` | `.#{$prefix}--css-grid--no-gutter` |
| | `.#{$prefix}--grid--full-width` | `.#{$prefix}--css-grid--full-width` |
| | `.#{$prefix}--offset-#{$breakpoint}-#{$columns}` (e.g. `bx--offset-sm-3`) | `.#{$prefix}--#{$breakpoint}:col-(start/end)-#{$columns}` (e.g. `bx--sm:col-start-4 bx--sm:col-end-5` and `bx--sm:col-start-4 bx--sm:col-end-5`) |
| | | `.#{$prefix}--hang` |
| | | `.#{$prefix}--gutter` |
| | `.#{$prefix}--hang--left` | `.#{$prefix}--gutter-start` |
| | `.#{$prefix}--hang--right` | `.#{$prefix}--gutter-end` |
| | `.#{$prefix}--hang--start` | `.#{$prefix}--gutter-start` |
| | `.#{$prefix}--hang--end` | `.#{$prefix}--gutter-end` |
| | | `.#{$prefix}--justify-items-start` |
| | | `.#{$prefix}--justify-items-end` |
| | | `.#{$prefix}--justify-items-center` |
| | | `.#{$prefix}--align-items-start` |
| | | `.#{$prefix}--align-items-end` |
| | | `.#{$prefix}--align-items-center` |
| `scss/index.scss` | | |

### Configuration

Configuring Sass Modules is now done through a `_config.scss` file (for things
like `$prefix`)

### Grid

The base grid definition now includes 16 columns by default. The new
`.#{$prefix}--css-grid` class should be used.

```diff
-<div class="bx--grid">
+<div class="bx--css-grid">
<div class="bx--row">
<div class="bx--col"></div>
<div class="bx--col"></div>
<div class="bx--col"></div>
<div class="bx--col"></div>
</div>
</div>
```

### Row

Rows are no longer needed and have been removed. Columns can be placed as direct
children of a grid container.

```diff
<div class="bx--css-grid">
- <div class="bx--row">
<div class="bx--col"></div>
<div class="bx--col"></div>
<div class="bx--col"></div>
<div class="bx--col"></div>
- </div>
</div>
```

### Column

The auto-column functionality has changed. In v10 columns would automatically
expand to fill the available space inside the grid container. A grid with only
two columns, each would span 50% width or 6 columns.

In v11, each column by default spans one single column as defined by the parent
grid's parameters.

The default track sizing functions of the grid columns are defined by the
inherited `grid-template-columns` css custom property. This declares that there
should be `--cds-grid-columns` number of columns, and each column should by
default span a `minmax()` of `0` columns minimum, or a maximum of
`--cds-grid-column-size` (`1fr`).

The values of these custom properties can be changed to modify the default
behavior of columns.

If you relied on this auto-column behavior, you will now instead need to
explicitly define your column sizing via the `.#{$prefix}--col-span-*` classes.
When migrating, remember the base grid definition now includes 16 columns by
default instead of 12.

```diff
<div class="bx--css-grid">
- <div class="bx--col"></div>
- <div class="bx--col"></div>
- <div class="bx--col"></div>
- <div class="bx--col"></div>
+ <div class="bx--col-span-4"></div>
+ <div class="bx--col-span-4"></div>
+ <div class="bx--col-span-4"></div>
+ <div class="bx--col-span-4"></div>
</div>
```

### Breakpoints

The ability to specify different column widths at different breakpoints is still
available. The class names have changed slightly.

```diff
<div class="bx--css-grid">
- <div class="bx--col-sm-2 bx--col-md-4 bx--col-lg-6">
+ <div class="bx--sm:col-span-2 bx--md:col-span-4 bx--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>
```

> Note: Breakpoints are now defined in `@carbon/grid`
### Offset

Offset columns are now explicitly defined via a starting and ending column,
instead of the column size and offset amount. These classes map directly to the
`grid-column-start` and `grid-column-end` properties and their values in regard
to the grid column definition/template.

```diff
<div class="bx--css-grid">
- <div class="bx--col-sm-1 bx--offset-sm-3"></div>
+ <div class="bx--sm:col-start-4 bx--sm:col-end-5"></div>

- <div class="bx--col-sm-2 bx--offset-sm-2"></div>
+ <div class="bx--sm:col-start-3 bx--sm:col-end-5"></div>

- <div class="bx--col-sm-3 bx--offset-sm-1"></div>
+ <div class="bx--sm:col-start-2 bx--sm:col-end-5"></div>

- <div class="bx--col-sm-4 bx--offset-sm-0"></div>
+ <div class="bx--sm:col-span-4"></div>
</div>
```
10 changes: 5 additions & 5 deletions packages/carbon-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@carbon/react",
"private": true,
"description": "React components for the Carbon Design System",
"version": "0.8.0-rc.0",
"version": "0.8.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -41,11 +41,11 @@
},
"dependencies": {
"@carbon/feature-flags": "^0.5.0",
"@carbon/icons-react": "^10.36.0-rc.0",
"@carbon/styles": "^0.11.0-rc.0",
"@carbon/icons-react": "^10.36.0",
"@carbon/styles": "^0.11.0",
"@carbon/telemetry": "0.0.0-alpha.6",
"@ibm/plex": "6.0.0-next.6",
"carbon-components-react": "^7.40.0-rc.0"
"carbon-components-react": "^7.40.0"
},
"devDependencies": {
"@babel/core": "^7.14.6",
Expand All @@ -56,7 +56,7 @@
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"@carbon/styles": "^0.11.0-rc.0",
"@carbon/themes": "^10.39.0-rc.0",
"@carbon/themes": "^10.39.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
Expand Down
16 changes: 16 additions & 0 deletions packages/carbon-react/src/components/Theme/Theme-story.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@use '@carbon/styles/scss/themes';
@use '@carbon/styles/scss/theme';
@use '@carbon/styles/scss/zone';

.theme-section {
padding: 1rem;
background: theme.$background;
color: theme.$text-primary;
}
Loading

0 comments on commit 3adcf95

Please sign in to comment.