Skip to content

Commit

Permalink
fix(sketch): remove type param from formatSharedColorStyleName
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Feb 11, 2021
1 parent 67034c8 commit 37584d7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/sketch/src/sharedStyles/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ const { black, white, orange, yellow, ...swatches } = colors;
* name for the swatch, the style type, and an optional grade.
* @param {object} params - formatSharedColorStyleName parameters
* @param {string} params.name
* @param {string} params.type
* @param {string?} params.grade
* @returns {string}
*/
function formatSharedColorStyleName({ name, type, grade }) {
return ['color', type, name.split('-').join(' '), grade]
function formatSharedColorStyleName({ name, grade }) {
return ['color', name.split('-').join(' '), grade]
.filter(Boolean)
.join(' / ');
}
Expand All @@ -40,7 +39,7 @@ export function syncColorStyles({ document }, type) {
const result = Object.keys(swatches[swatchName]).map((grade) => {
return syncColorStyle({
document,
name: formatSharedColorStyleName({ name, type, grade }),
name: formatSharedColorStyleName({ name, grade }),
value: swatches[swatchName][grade],
type,
});
Expand All @@ -56,7 +55,7 @@ export function syncColorStyles({ document }, type) {
].map(([name, value]) => {
return syncColorStyle({
document,
name: formatSharedColorStyleName({ name, type }),
name: formatSharedColorStyleName({ name }),
value,
type,
});
Expand Down

0 comments on commit 37584d7

Please sign in to comment.