-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(sketch): create shared styles for icon stroke #5744
Conversation
ef8c90f
to
f17c190
Compare
There was a problem hiding this 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
Deploy preview for carbon-elements ready! Built with commit 1971cae |
Deploy preview for carbon-components-react ready! Built with commit 1971cae https://deploy-preview-5744--carbon-components-react.netlify.com |
@laurenmrice ah okay, sorry I misunderstood! |
Seems great to me after the changes @laurenmrice suggested! |
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 |
09cee50
to
ca3589b
Compare
isn't this already happening in the plugin? from what I can tell this behavior is not exclusive to this PR steps to replicate:
|
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 If a fill+border is happening in the plugin for the |
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. |
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 |
The border is coming from Sketch applying it by default if folks haven't changed their default layer styles for rectangles 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, | ||
], | ||
}); | ||
export function syncColorStyle(document, name, value, type) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
Let me know if I can help out at all with this! |
d42f1bb
to
e6d987b
Compare
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 |
e6d987b
to
38a1291
Compare
There was a problem hiding this 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(sharedStyles); |
b5b793b
to
c0df0cb
Compare
bump @dakahn let us know if you want to go through this or anything! |
1 similar comment
bump @dakahn let us know if you want to go through this or anything! |
f055955
to
1971cae
Compare
This good to go @emyarod? 👀 |
yes updated the branch to merge |
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
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