-
Notifications
You must be signed in to change notification settings - Fork 13
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
Set padding specs on container background instead of text? #37
Comments
Hi Jeff, Allow me answer point 2 first: This plugin is not limited to text layer only. For your case above, you can easily group your text layer and icon together and put the padding on the group name and cmd+j on the group layer should create the button around it. Hope this answers your question. As for point 1: I'm not sure I completely understand. Can you elaborate more on this, or even a gif if possible. I looked at the modulizer code, it almost similar to my code in that it needs to know the dimensions (x, y, width and height) of a layer + desired padding to apply to the BG layer. In modulizer, it puts all the children into a group, gets its dimensions and the applies to the the BG layer. I do the same, the only difference is that it will build the BG around the selected layer you run the command on. As I mentioned above, this layer can be anything. Also, this approach is not something I came up. My plugin is forked from the original dynamic button which was abandoned after v3.5. Given the popularity of the original plugin, I want to keep it as vanilla as possible. Can I also suggest trying out a different plugin that @mwhite05 is being working on lately. Looks promising, see if this works. Do elaborate on point 1, I'll see what I can do to address once I understand. |
I've been using this plugin for a while now and find it incredibly useful. It offers functionality that I think should be way better supported natively by Sketch but am thankful for the plugin ecosystem and your contributions!
There are a couple contexts that make it harder to use this plugin consistently and some of it seems like it might be addressed by a subtle shift in how values are passed/read. A couple are:
Proposed solution: What seems like it would be a solution is to set the padding specs on the BG layer instead of the text layer. I actually noticed similar functionality in the Modulizer plugin but it doesn't seem like it's as robust or well-supported. The functionality is very similar to Dynamic Button though and feels a bit more flexible in taking this approach. This would give the plugin the ability to set padding on any number of different 'container' types by calculating spacing from the children nearest to each edge. The Modulizer plugin also includes a prompt for values when you first trigger it rather than assigning default padding, which is quite helpful too.
Any thoughts on this? I understand it wouldn't be a trivial change, and that you may have already considered this and tradeoffs I'm not aware of, but I'd love to hear your thoughts either way. I know this is also a side project for you, so I doubly appreciate all your efforts!
The text was updated successfully, but these errors were encountered: