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

feat(sketch): create shared styles for icon stroke #5744

Merged

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Mar 30, 2020

Closes #5692

This PR renames the fill shared style layers and lays the groundwork for specifying shared style type (currently "fill" or "border") to prepare for #4130/#5567 (branched off of #5569)

Changelog

Changed

  • change shared sync command and generate commands for colors, themes, and icons to use new naming scheme
  • fix symbol sync test

Testing / Reviewing

Ensure the sketch plugin works as expected and the new shared style names are correct

Plugin can be downloaded and tested here:

carbon-elements.sketchplugin.zip

@emyarod emyarod requested a review from a team as a code owner March 30, 2020 17:29
@ghost ghost requested a review from dakahn March 30, 2020 17:29
@emyarod emyarod force-pushed the 5692-shared-styles-icon-stroke branch from ef8c90f to f17c190 Compare March 30, 2020 17:33
Copy link
Contributor

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Do we want all colors to be under fill and stroke and no longer want the color / swatch / grade shared styles? Seems like we might need them for backwards-compat in the library? cc @laurenmrice

@netlify
Copy link

netlify bot commented Mar 31, 2020

Deploy preview for carbon-elements ready!

Built with commit 1971cae

https://deploy-preview-5744--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Mar 31, 2020

Deploy preview for carbon-components-react ready!

Built with commit 1971cae

https://deploy-preview-5744--carbon-components-react.netlify.com

@laurenmrice
Copy link
Member

laurenmrice commented Mar 31, 2020

I want to keep our existing fill shared color styles separate from the border shared styles. They should not be combined into one style, which is how the plugin is in this pr:

Fill styles should be: color / fill / gray / 100
Border styles should be: color / border / gray / 100


This is how I want them to be bucketed.
Fill:
Screen Shot 2020-03-31 at 10 34 42 AM

Border:
Screen Shot 2020-03-31 at 10 35 19 AM


Ex of sketch library bucketing with this naming convention (notice how fill and border are separate): (to clarify: the bucket should say border not stroke, this was just an example to test this)
Screen Shot 2020-03-31 at 10 21 01 AM

@joshblack
Copy link
Contributor

@laurenmrice ah okay, sorry I misunderstood!

@joshblack
Copy link
Contributor

Seems great to me after the changes @laurenmrice suggested!

@emyarod
Copy link
Member Author

emyarod commented Mar 31, 2020

just to clarify, this PR does not contain any of the border work yet, it just lays the groundwork for it in a follow up PR, since the style renaming can cause breakage. this is mostly a refactor of the existing plugin

@emyarod emyarod force-pushed the 5692-shared-styles-icon-stroke branch from 09cee50 to ca3589b Compare March 31, 2020 16:23
@laurenmrice
Copy link
Member

I was confused because if you run the plugin that is attached, the fill color styles have been changed to also include a border on them. Before they were fill only and need to stay that way.

example of what I am seeing:
Screen Shot 2020-03-31 at 11 26 56 AM

@emyarod
Copy link
Member Author

emyarod commented Mar 31, 2020

isn't this already happening in the plugin? from what I can tell this behavior is not exclusive to this PR

steps to replicate:

  1. sync colors
  2. generate color page
  3. sync icons
  4. observe border being applied to color swatches

@laurenmrice
Copy link
Member

From the last time we released the plugin (9 months ago?) It was exporting correctly and had fills only (no borders applied). You can test this by downloading the current IDL Library that has our generated color styles. sketch://add-library/cloud/nwqmk

Example:
Screen Shot 2020-03-31 at 11 48 09 AM


If a fill+border is happening in the plugin for the fill styles that we originally have had, then it's a bug.

@laurenmrice
Copy link
Member

Andrew and I had a webex convo about this. Seems like there was a regression in the plugin, which is a separate issue from what is happening in the PR. Will need to solve the fill+border color style regression separately.

@emyarod
Copy link
Member Author

emyarod commented Mar 31, 2020

this appears to be a regression but I haven't found the change which caused this. I have a fix if we want to address this separately but it would be helpful to have more context around how this regression came up

@joshblack
Copy link
Contributor

The border is coming from Sketch applying it by default if folks haven't changed their default layer styles for rectangles 👍

Copy link
Contributor

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

image

Seems like the generate command might not be working?

},
],
});
export function syncColorStyle(document, name, value, type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of adding a type to the end of this and updating all the call signatures that exist already, would it make sense to add a syncFillStyle and syncBorderStyle helper and then we can call them separately?

Copy link
Member Author

Choose a reason for hiding this comment

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

so would those two additional helpers be called by the sharedStyles helpers?

@joshblack
Copy link
Contributor

Let me know if I can help out at all with this!

@emyarod emyarod force-pushed the 5692-shared-styles-icon-stroke branch 2 times, most recently from d42f1bb to e6d987b Compare April 1, 2020 15:20
@emyarod
Copy link
Member Author

emyarod commented Apr 1, 2020

the generate command was still working, it's the layout that changed because of the layer name difference. it should now be the same as the previous behavior

@emyarod emyarod force-pushed the 5692-shared-styles-icon-stroke branch from e6d987b to 38a1291 Compare April 1, 2020 15:22
@emyarod emyarod requested a review from joshblack April 2, 2020 16:11
Copy link
Contributor

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Looks great after removing console 👍

@@ -19,12 +19,13 @@ export function generate() {
command('commands/colors/generate', () => {
const document = Document.getSelectedDocument();
const page = selectPage(findOrCreatePage(document, 'color'));
const sharedStyles = syncColorStyles(document);
const sharedStyles = syncColorStyles(document, 'fill');
console.log(sharedStyles);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
console.log(sharedStyles);

@emyarod emyarod force-pushed the 5692-shared-styles-icon-stroke branch from b5b793b to c0df0cb Compare April 2, 2020 19:47
@joshblack
Copy link
Contributor

bump @dakahn let us know if you want to go through this or anything!

1 similar comment
@joshblack
Copy link
Contributor

bump @dakahn let us know if you want to go through this or anything!

@joshblack
Copy link
Contributor

This good to go @emyarod? 👀

@emyarod emyarod merged commit 3679b73 into carbon-design-system:master Apr 8, 2020
@emyarod
Copy link
Member Author

emyarod commented Apr 8, 2020

yes updated the branch to merge

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.

Create shared styles for icon stroke
4 participants