Skip to content

Commit

Permalink
fix: use kebab-case instead of camelCase for variable extensions
Browse files Browse the repository at this point in the history
Utilities generated by extensions were `camelCased`, they are now `kebabCased`
  • Loading branch information
innocenzi committed May 28, 2020
1 parent dc29036 commit b4fa030
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/theme/variable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Variable {
return '';
}

return `${this._path}.${_.camelCase(this._name)}`;
return `${this._path}.${_.kebabCase(this._name)}`;
}

/**
Expand Down
11 changes: 11 additions & 0 deletions test/unit/generateTailwindConfiguration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,14 @@ it('extends Tailwind', () => {
},
});
});

it('handles multi-word variable names', () => {
testExtendOutput(
new Theme().setVariable('sans-serif', ['Roboto', 'Arial'], 'fontFamily', 'font'),
{
fontFamily: {
'sans-serif': 'var(--font-sans-serif)',
},
}
);
});

0 comments on commit b4fa030

Please sign in to comment.