Skip to content

Commit

Permalink
Merge branch 'prerelease/major' into tokens-studio-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
alanbsmith authored Oct 20, 2023
2 parents 58d71c2 + 68b38be commit c99e72a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Used for conventional commit ranges

- uses: Workday/canvas-kit-actions/install@v1
with:
node_version: 18.x

- name: Install
shell: bash
run: yarn install
# - uses: Workday/canvas-kit-actions/install@v1
# with:
# node_version: 18.x

- name: Build Tokens
shell: bash
run: yarn build:tokens --no-cache

# Build Storybook and extract component stories for Storybook aggregation. This will be used
# for Chromatic rebaselining and publishing to GH Pages.
- name: Build Storybook
shell: bash
run: yarn build-storybook --no-cache --verbose
run: yarn build-storybook

- name: Publish Storybook
uses: JamesIves/[email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const fontFamilyTokens: FontFamilyToken[] = Object.values(system.fontFamily).map

return {
label: varName,
value: value,
value: value.replace(/"/g, ''),
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ interface ShapeToken {
}

function multiplyCalcValues(value: string) {
// Matches numbers such as .25, 0.25, or 25
const numberRegExp = new RegExp(/(0*\.)?\d+/g);
// Find the numbers in the string value
const matches = value.match(/(0.)?\d+/g);
const matches = value.match(numberRegExp);
if (matches) {
// Multiply the matched values
return matches.reduce((acc, current) => acc * Number(current), 1);
Expand All @@ -24,6 +26,7 @@ function multiplyCalcValues(value: string) {
const shapeTokens: ShapeToken[] = Object.values(system.shape).map(varName => {
const value = getComputedStyle(document.documentElement).getPropertyValue(varName);
const computedValue = multiplyCalcValues(value);

return {
label: varName,
value: value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ interface SpaceToken {
}

function multiplyCalcValues(value: string) {
// Matches numbers such as .25, 0.25, or 25
const numberRegExp = new RegExp(/(0*\.)?\d+/g);
// Find the numbers in the string value
const matches = value.match(/(0.)?\d+/g);
const matches = value.match(numberRegExp);
if (matches) {
// Multiply the matched values
return matches.reduce((acc, current) => acc * Number(current), 1);
Expand Down

0 comments on commit c99e72a

Please sign in to comment.