-
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(themes): add experimental sass modules for themes (#7703)
* refactor(layout): update scale from a list to map * feat(themes): add experimental sass modules for themes * chore(themes): add sass modules example * chore(themes): add example to sass-modules * docs(themes): add early docs for v11 migrations * chore(layout): fix workspace dependency
- Loading branch information
Showing
26 changed files
with
3,870 additions
and
32 deletions.
There are no files selected for viewing
Binary file removed
BIN
-26.3 KB
.yarn/cache/@rollup-plugin-node-resolve-npm-11.1.0-7278c3f15c-87332c94d1.zip
Binary file not shown.
Binary file added
BIN
+26.5 KB
.yarn/cache/@rollup-plugin-node-resolve-npm-11.1.1-96281b2a2a-79161dcdf4.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,21 @@ | ||
# Motion | ||
|
||
**Note: everything in this file is a work-in-progress and will be changed.** | ||
|
||
## Changes | ||
|
||
| Filename | v10 | v11 | | ||
| ------------------ | ----------------------- | ------------------------------------------ | | ||
| `_tokens.scss` | | Deprecated, use Custom Properties directly | | ||
| `_theme-maps.scss` | | Removed, use `_themes.scss` instead | | ||
| `_theme-maps.scss` | `$carbon--theme--white` | `$white` | | ||
| | `$carbon--theme--g10` | `$g10` | | ||
| | `$carbon--theme--g90` | `$g90` | | ||
| | `$carbon--theme--g100` | `$g100` | | ||
| `_mixins.scss` | | Removed, use `_theme.scss` instead | | ||
| `_mixins.scss` | `carbon--theme` | `theme` | | ||
|
||
- Theme maps are now available in `scss/_themes.scss` and no longer require a | ||
namespace | ||
- Theme mixin has been simplified, it now emits the given theme as Custom | ||
Properties for the parent selector |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
scss/generated | ||
generated |
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,2 @@ | ||
enableGlobalCache: true | ||
nodeLinker: node-modules |
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 @@ | ||
# sass-modules |
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,13 @@ | ||
{ | ||
"name": "sass-modules", | ||
"scripts": { | ||
"develop": "next" | ||
}, | ||
"dependencies": { | ||
"@carbon/themes": "link:../../", | ||
"next": "^10.0.6", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"sass": "^1.32.5" | ||
} | ||
} |
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,12 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
import '../styles.scss'; | ||
|
||
export default function App({ Component, pageProps }) { | ||
return <Component {...pageProps} />; | ||
} |
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,18 @@ | ||
export default function IndexPage() { | ||
return ( | ||
<div className="container"> | ||
<section className="white"> | ||
white | ||
</section> | ||
<section className="g10"> | ||
g10 | ||
</section> | ||
<section className="g90"> | ||
g90 | ||
</section> | ||
<section className="g100"> | ||
g100 | ||
</section> | ||
</div> | ||
); | ||
} |
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,57 @@ | ||
// | ||
// 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/themes'; | ||
|
||
@include themes.set(themes.$g100); | ||
|
||
html { | ||
box-sizing: border-box; | ||
} | ||
|
||
*, *::before, *::after { | ||
box-sizing: inherit; | ||
} | ||
|
||
html, body, #__next, .container { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
} | ||
|
||
body { | ||
@include themes.theme(); | ||
} | ||
|
||
.container { | ||
display: grid; | ||
grid-template-rows: repeat(4, 1fr); | ||
} | ||
|
||
.white { | ||
@include themes.theme(themes.$white); | ||
} | ||
|
||
.g10 { | ||
@include themes.theme(themes.$g10); | ||
} | ||
|
||
.g90 { | ||
@include themes.theme(themes.$g90); | ||
} | ||
|
||
.g100 { | ||
@include themes.theme(themes.$g100); | ||
} | ||
|
||
section { | ||
background: var(--cds-ui-background); | ||
color: var(--cds-text-01); | ||
} |
Oops, something went wrong.