Skip to content

Commit

Permalink
fix(sketch): update based on theme changes (#4274)
Browse files Browse the repository at this point in the history
* fix(sketch): update based on theme changes

- Only sync color styles for themes
- Make sure yellow-30 is used instead of yellow-20 for yellow in colors

* Update packages/sketch/src/sharedStyles/themes.js

Co-Authored-By: Abbey Hart <[email protected]>
  • Loading branch information
joshblack and abbeyhrt committed Oct 22, 2019
1 parent 5b42ce2 commit f37bd54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/sketch/src/sharedStyles/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function syncColorStyles(document) {
['black', black['100']],
['white', white['0']],
['orange', orange['40']],
['yellow', yellow['20']],
['yellow', yellow['30']],
].map(([name, value]) => {
return syncColorStyle(document, formatSharedStyleName(name), value);
});
Expand Down
5 changes: 4 additions & 1 deletion packages/sketch/src/sharedStyles/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ import {
g90,
g100,
formatTokenName,
tokens,
unstable__meta as meta,
} from '@carbon/themes';
import { syncColorStyle } from '../tools/sharedStyles';

const { colors } = tokens;

/**
* Sync theme color shared styles to the given document and return the result
* @param {Document} document
Expand All @@ -31,7 +34,7 @@ export function syncThemeColorStyles(document) {
const sharedStyles = Object.keys(themes).flatMap(theme => {
return Object.keys(themes[theme])
.filter(token => {
return !meta.deprecated.includes(token);
return colors.includes(token) && !meta.deprecated.includes(token);
})
.map(token => {
const { type } = meta.colors.find(group => {
Expand Down

0 comments on commit f37bd54

Please sign in to comment.