-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(project): add styles experiment (#7854)
* feat(project): add styles experiment * docs(migration): add initial migration docs for components * chore(grid): sync readme updates Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
1a721cc
commit 1551b04
Showing
15 changed files
with
221 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# `carbon-components` | ||
|
||
**Note: everything in this file is a work-in-progress and will be changed.** | ||
|
||
## Overview | ||
|
||
- Carbon now uses [Dart Sass](https://npmjs.com/package/sass) along with Sass | ||
Modules | ||
- File paths have been renamed to provide shorter paths and more intuitive ways | ||
to get access to common variables, mixins, functions, and more. | ||
- Prefixed variables, functions, and mixins have been renamed as part of our | ||
migration to Sass Modules | ||
|
||
## Files | ||
|
||
| Filename | v11 | | ||
| --------------------------------------------------------------- | --------------------------------------- | | ||
| `scss/globals` | | | ||
| `scss/globals/fonts/*` | Removed | | ||
| `scss/globals/grid/_grid.scss` | `scss/_grid.scss` | | ||
| `scss/globals/scss` | `scss` | | ||
| `scss/globals/scss/vendor/*` | Removed | | ||
| `scss/globals/scss/_colors.scss` | `scss/_colors.scss` | | ||
| `scss/globals/scss/_component-tokens.scss` | | | ||
| `scss/globals/scss/_css--body.scss` | | | ||
| `scss/globals/scss/_css--font-face.scss` | | | ||
| `scss/globals/scss/_css--helpers.scss` | | | ||
| `scss/globals/scss/_css--reset.scss` | | | ||
| `scss/globals/scss/_deprecate.scss` | | | ||
| `scss/globals/scss/_feature-flags.scss` | | | ||
| `scss/globals/scss/_functions.scss` | | | ||
| `scss/globals/scss/_helper-classes.scss` | | | ||
| `scss/globals/scss/_helper-mixins.scss` | | | ||
| `scss/globals/scss/_import-once.scss` | | | ||
| `scss/globals/scss/_keyframes.scss` | | | ||
| `scss/globals/scss/_layer.scss` | | | ||
| `scss/globals/scss/_layout.scss` | | | ||
| `scss/globals/scss/_mixins.scss` | | | ||
| [`scss/globals/scss/_motion.scss`](#scssglobalsscss_motionscss) | `scss/_motion.scss` | | ||
| `scss/globals/scss/_spacing.scss` | | | ||
| `scss/globals/scss/_theme-tokens.scss` | | | ||
| `scss/globals/scss/_theme.scss` | | | ||
| `scss/globals/scss/_tooltip.scss` | | | ||
| `scss/globals/scss/_typography.scss` | | | ||
| `scss/globals/scss/_vars.scss` | | | ||
| `scss/globals/scss/styles.scss` | `/index.scss`, require package directly | | ||
| `scss/components` | | | ||
|
||
### `scss/globals/scss/_motion.scss` | ||
|
||
| v10 | v11 | | ||
| :------------------------- | :-- | | ||
| `$carbon--ease-in` | | | ||
| `$carbon--ease-out` | | | ||
| `$carbon--standard-easing` | | | ||
| `$transition--base` | | | ||
| `$transition--expansion` | | | ||
| `$duration--fast-01` | | | ||
| `$duration--fast-02` | | | ||
| `$duration--moderate-01` | | | ||
| `$duration--moderate-02` | | | ||
| `$duration--slow-01` | | | ||
| `$duration--slow-02` | | | ||
| `@function motion` | | | ||
| `@mixin motion` | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
**/__mocks__/** | ||
**/__tests__/** | ||
**/examples/** | ||
**/tasks/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* 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. | ||
* | ||
* @jest-environment node | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const { SassRenderer } = require('@carbon/test-utils/scss'); | ||
|
||
const { render } = SassRenderer.create(__dirname); | ||
|
||
describe('@carbon/styles', () => { | ||
test('Public API', async () => { | ||
await render(` | ||
@use '../index.scss' as styles; | ||
`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// 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. | ||
// | ||
|
||
@forward 'scss/config' with ( | ||
$prefix: 'bx' !default, | ||
); | ||
@forward '@carbon/colors'; | ||
@forward '@carbon/grid' hide $prefix; | ||
@forward '@carbon/layout' hide map-deep-get, key-by-index, last-map-item; | ||
@forward '@carbon/motion'; | ||
@forward '@carbon/themes' hide $white; | ||
@forward '@carbon/type' hide $prefix; | ||
|
||
@use 'scss/reset'; | ||
@use 'scss/components'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "@carbon/styles", | ||
"private": true, | ||
"version": "0.0.0", | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/carbon-design-system/carbon.git", | ||
"directory": "packages/styles" | ||
}, | ||
"bugs": "https://github.com/carbon-design-system/carbon/issues", | ||
"keywords": [ | ||
"ibm", | ||
"carbon", | ||
"carbon-design-system", | ||
"components", | ||
"react" | ||
], | ||
"dependencies": { | ||
"@carbon/colors": "10.21.0", | ||
"@carbon/grid": "10.21.0", | ||
"@carbon/layout": "10.19.0", | ||
"@carbon/motion": "10.14.0", | ||
"@carbon/themes": "10.28.0", | ||
"@carbon/type": "10.22.0" | ||
}, | ||
"devDependencies": { | ||
"@carbon/test-utils": "10.15.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// 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. | ||
// | ||
|
||
@forward '@carbon/colors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// 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. | ||
// | ||
|
||
$prefix: 'bx' !default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// 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. | ||
// | ||
|
||
@forward '@carbon/grid'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// 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. | ||
// | ||
|
||
@forward '@carbon/motion'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// | ||
// 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. | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// 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. | ||
// | ||
|
||
@forward '@carbon/themes'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// 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. | ||
// | ||
|
||
@forward '@carbon/type'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// | ||
// 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. | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters