Skip to content

Commit

Permalink
feat(elements): update colors, layout, and motion packages with exper…
Browse files Browse the repository at this point in the history
…imental Sass Modules (#7546)

* refactor(colors): move Sass Modules to colors/index.scss

* feat(layout): add support for sass modules

* feat(motion): add support for sass modules

* docs(migration): add initial 11.x docs for sass modules

* chore(components): update sass check to ignore vendor files

* chore(colors): update modules test to new location

Co-authored-by: TJ Egan <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 25, 2021
1 parent 9e4485a commit adb7cd1
Show file tree
Hide file tree
Showing 19 changed files with 516 additions and 2,268 deletions.
24 changes: 24 additions & 0 deletions docs/migration/11.x-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Layout

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

## Changes

| v10 | v11 |
| --------------------------------- | ------------------------- |
| `$carbon--base-font-size` | `$base-font-size` |
| `carbon--rem` | `rem` |
| `carbon--em` | `em` |
| `$carbon--grid-gutter` | `$grid-gutter` |
| `$carbon--grid-gutter--condensed` | `$grid-gutter--condensed` |
| `$carbon--grid-breakpoints` | `$grid-breakpoints` |
| `carbon--breakpoint-next` | `breakpoint-next` |
| `carbon--breakpoint-prev` | `breakpoint-prev` |
| `carbon--is-smallest-breakpoint` | `is-smallest-breakpoint` |
| `carbon--largest-breakpoint-name` | `largest-breakpoint-name` |
| `carbon--breakpoint-infix` | `breakpoint-infix` |
| `carbon--breakpoint-up` | `breakpoint-up` |
| `carbon--breakpoint-down` | `breakpoint-down` |
| `carbon--breakpoint-between` | `breakpoint-between` |
| `carbon--largest-breakpoint` | `largest-breakpoint` |
| `carbon--breakpoint` | `breakpoint` |
11 changes: 11 additions & 0 deletions docs/migration/11.x-motion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Motion

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

## Changes

| v10 | v11 |
| -------------------------- | ---------- |
| `$carbon--easings` | `$easings` |
| `@function carbon--motion` | `motion` |
| `@mixin carbon--motion` | `motion` |
1 change: 1 addition & 0 deletions packages/colors/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
scss
index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`modules.scss Public API 1`] = `
exports[`@carbon/colors Public API 1`] = `
Object {
"black": "#000000",
"black-100": "#000000",
Expand Down
6 changes: 3 additions & 3 deletions packages/colors/__tests__/modules-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

describe('modules.scss', () => {
describe('@carbon/colors', () => {
test('Public API', async () => {
const { getValue } = await render(`
@use 'sass:meta';
@use '../scss/module';
@use '../index.scss' as colors;
$_: get-value(meta.module-variables('module'));
$_: get-value(meta.module-variables('colors'));
`);

const variables = getValue(0);
Expand Down
Loading

0 comments on commit adb7cd1

Please sign in to comment.