Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates DCS Exports with Product Specific Brand Names #81

Merged

Conversation

brianchristopherbrady
Copy link
Contributor

@brianchristopherbrady brianchristopherbrady commented Nov 14, 2023

Modifies existing DCS exports to overwrite existing brand color values with product specific brand color values.

As well as adding a set of SCSS exports.

Comment on lines 6 to 23
const tokenOverrides = {
"globalColorBrand10": "#001919",
"globalColorBrand20": "#012826",
"globalColorBrand30": "#01322e",
"globalColorBrand40": "#033f38",
"globalColorBrand50": "#054d43",
"globalColorBrand60": "#0a5c50",
"globalColorBrand70": "#0c695a",
"globalColorBrand80": "#117865",
"globalColorBrand90": "#1f937e",
"globalColorBrand100": "#2aac94",
"globalColorBrand110": "#3abb9f",
"globalColorBrand120": "#52c7aa",
"globalColorBrand130": "#78d3b9",
"globalColorBrand140": "#9ee0cb",
"globalColorBrand150": "#c0ecdd",
"globalColorBrand160": "#e3f7ef",
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be in a separate token file that only gets included in the DCS builds. I can help set that up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a file called global.brand.dcs.json to the master tokens repo that looks like this (with all 16 colors):

{
	"Global": {
		"Color": {
			"Brand": {
				"10": {
					"$type": "color",
					"$value": "#001919"
				},
				"20": {
					"$type": "color",
					"$value": "#012826"
				}
			}
		}
	}
}

Then you can override the brand colors just by adding global.brand.dcs.json to the list of files to include.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, you should be able to remove this and the corresponding reference around line 31. If you get the latest token files, you'll be able to add --in src/global.brand.dcs.json to the command line (anywhere except before global.json) to get your overrides.

{
let newName = path[0] !== "Global" && path[3] === "Color" ? `color${Utils.pascalCase(path)}` : _.camelCase(path.join(" "))
let newName = path[0] !== "Global" && prop.attributes.category === "color" ? `color${Utils.pascalCase(path)}` : _.camelCase(path.join(""))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_.camelCase(path.join(" ")) and _.camelCase(path.join("")) are subtly different—if you haven't already gone through the output and made sure that there aren't any unintended changes, you might want to put the space back.

@TravisSpomer TravisSpomer merged commit bcd7bd4 into microsoft:main Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants