Skip to content

Commit

Permalink
capitalize first letter of asset sets
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanLovely committed Oct 19, 2023
1 parent 5403769 commit 7503985
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions knapsack/data/knapsack.asset-sets.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"commercial": {
"id": "commercial",
"title": "commercial",
"title": "Commercial",
"assets": [
{
"src": "../dist/tokens/design-tokens.css"
Expand All @@ -32,7 +32,7 @@
},
"retail": {
"id": "retail",
"title": "retail",
"title": "Retail",
"assets": [
{
"src": "../dist/tokens/design-tokens.css"
Expand Down
6 changes: 5 additions & 1 deletion ks-theme-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ const themes = themeNames.map((theme) => {
};
});

function capitalizeFirstLetter(string: string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

const assetSets: KnapsackAssetSetsConfig = {
globalAssetSetIds: ["salt-light", "salt-dark", ...themeNames],
allAssetSets: Object.fromEntries([
Expand All @@ -66,7 +70,7 @@ const assetSets: KnapsackAssetSetsConfig = {
...themes.map(({ cssPath, themeName }) => {
const assetSet: KnapsackAssetSetConfig = {
id: themeName,
title: themeName,
title: capitalizeFirstLetter(themeName),
assets: [
{
src: "../dist/tokens/design-tokens.css",
Expand Down

0 comments on commit 7503985

Please sign in to comment.