forked from channel-io/bezier-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bezier-tokens): create a CSS entry point and add composition tok…
…ens (channel-io#1769)
- Loading branch information
1 parent
8f88a03
commit d1e0fc7
Showing
23 changed files
with
425 additions
and
113 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,5 @@ | ||
--- | ||
"@channel.io/bezier-tokens": minor | ||
--- | ||
|
||
Add composition tokens, such as box-shadow. |
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,5 @@ | ||
--- | ||
"@channel.io/bezier-tokens": minor | ||
--- | ||
|
||
Now serving one combined styles.css file. This is a breaking change for anyone who was importing the individual CSS files. You will need to update your import to `@channel.io/bezier-tokens/css/styles.css`. |
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,3 +1 @@ | ||
@use "../../node_modules/@channel.io/bezier-tokens/dist/css/global.css"; | ||
@use "../../node_modules/@channel.io/bezier-tokens/dist/css/light-theme.css"; | ||
@use "../../node_modules/@channel.io/bezier-tokens/dist/css/dark-theme.css"; | ||
@use "../../node_modules/@channel.io/bezier-tokens/dist/css/styles.css"; |
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 @@ | ||
@mixin square($dimension) { | ||
width: $dimension; | ||
height: $dimension; | ||
} |
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,67 @@ | ||
// NOTE: WIP. Change to only accessible from the Text component? | ||
@mixin size-11 { | ||
font-size: var(--typography-size-11-font-size); | ||
line-height: var(--typography-size-11-line-height); | ||
} | ||
|
||
@mixin size-12 { | ||
font-size: var(--typography-size-12-font-size); | ||
line-height: var(--typography-size-12-line-height); | ||
} | ||
|
||
@mixin size-13 { | ||
font-size: var(--typography-size-13-font-size); | ||
line-height: var(--typography-size-13-line-height); | ||
} | ||
|
||
@mixin size-14 { | ||
font-size: var(--typography-size-14-font-size); | ||
line-height: var(--typography-size-14-line-height); | ||
} | ||
|
||
@mixin size-15 { | ||
font-size: var(--typography-size-15-font-size); | ||
line-height: var(--typography-size-15-line-height); | ||
letter-spacing: var(--typography-size-15-letter-spacing); | ||
} | ||
|
||
@mixin size-16 { | ||
font-size: var(--typography-size-16-font-size); | ||
line-height: var(--typography-size-16-line-height); | ||
letter-spacing: var(--typography-size-16-letter-spacing); | ||
} | ||
|
||
@mixin size-17 { | ||
font-size: var(--typography-size-17-font-size); | ||
line-height: var(--typography-size-17-line-height); | ||
letter-spacing: var(--typography-size-17-letter-spacing); | ||
} | ||
|
||
@mixin size-18 { | ||
font-size: var(--typography-size-18-font-size); | ||
line-height: var(--typography-size-18-line-height); | ||
} | ||
|
||
@mixin size-22 { | ||
font-size: var(--typography-size-22-font-size); | ||
line-height: var(--typography-size-22-line-height); | ||
letter-spacing: var(--typography-size-22-letter-spacing); | ||
} | ||
|
||
@mixin size-24 { | ||
font-size: var(--typography-size-24-font-size); | ||
line-height: var(--typography-size-24-line-height); | ||
letter-spacing: var(--typography-size-24-letter-spacing); | ||
} | ||
|
||
@mixin size-30 { | ||
font-size: var(--typography-size-30-font-size); | ||
line-height: var(--typography-size-30-line-height); | ||
letter-spacing: var(--typography-size-30-letter-spacing); | ||
} | ||
|
||
@mixin size-36 { | ||
font-size: var(--typography-size-36-font-size); | ||
line-height: var(--typography-size-36-line-height); | ||
letter-spacing: var(--typography-size-36-letter-spacing); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
|
||
const buildPath = 'dist/css' | ||
const destination = 'styles.css' | ||
|
||
function concatenateStylesheet() { | ||
const files = fs.readdirSync(buildPath) | ||
const outputData = files | ||
.filter(file => file.endsWith('.css') && file !== destination) | ||
.map(file => fs.readFileSync(path.join(buildPath, file), 'utf8')) | ||
.join('\n') | ||
|
||
fs.writeFileSync(path.join(buildPath, destination), outputData) | ||
// eslint-disable-next-line no-console | ||
console.log(`\n✔︎ Created ${buildPath}/${destination}`) | ||
} | ||
|
||
function cleanUp() { | ||
const files = fs.readdirSync(buildPath) | ||
files.forEach(file => { | ||
if (file !== destination) { | ||
fs.unlinkSync(path.join(buildPath, file)) | ||
// eslint-disable-next-line no-console | ||
console.log(` ✔︎ Removed ${buildPath}/${file}`) | ||
} | ||
}) | ||
} | ||
|
||
function main() { | ||
concatenateStylesheet() | ||
cleanUp() | ||
} | ||
|
||
main() |
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
Oops, something went wrong.