dwilliames / paddy-sketch-plugin Goto Github PK
View Code? Open in Web Editor NEWAutomated padding, spacing and alignment for your Sketch layers
License: MIT License
Automated padding, spacing and alignment for your Sketch layers
License: MIT License
Currently when the value for the padding is invalid (for example [A10]
), the plugin sets it to 0
and grows the element to it's parents size.
The preferred action would be to ignore it.
Bug Horisontal padding [10h] Paddy-1.0.4 Crashes Sketch.app
When set padding manually in layers.
http://take.ms/oPemL
Hey David, as mentioned on Facebook, I'm capturing the issue that I ran into when I was trying to create a modal/dialogue box.
This happens when I combine a paddy button with anima stack and it basically behaves very abruptly upon interacting with it.
I've attached a screen capture of the issue here and attaching the sketch file I have setup without paddy. sketch file and screen recording.zip
I don't know if this is related but sounds like the width may be linked. #12
As the title says, it would be pretty nice to not have to measure and enter paddings manually, and instead they should be taken from the current selection. Then you wouldn't necessarily have to show the popup either
actually it doesn't support at all. it takes so much time when inputing padding while symbol is implemented anywhere.
It would be great if i could put resizable button in another symbol and then change text in overrides.
symbol «molecule» //atom do not resize
symbol «atom» //resizable button, resizing work
text
symbol «bg» [10 10]
I updated to latest version of this plugin this morning, and I keep getting a loop alert from Sketch, "Choose at least one layer to duplicate", even though I am not trying to duplicate anything. Sketch version 48.2, Mac OS Sierra. Nothing else has changed in my Sketch set up since last night.
Не работает на символы. Пропала автоматика. Работает только «Enter padding fo selection» на обычных элементах.
=====
Does not work for characters. Automation was lost. Only "Enter padding fo selection" works on ordinary elements.
Firstly, I love this plugin! Im just having a ply and trying to set up a master wireframe document. However I've run into a problem… In the image below, when I resize it or change the text, sometimes the image background on the top will be smaller or bigger than the text box below?
Any ideas how I can get around this?
And here is how I have it all set up…
Hi, So I can't get the spacing shortcut to ever work (control+alt+command+p), other shortcut works fine as does manually adding spacing parameters to groups. Tried removing other plugins, tried in the sketch beta, just never works. I'm in sketch 48.2 on a MacBook Pro with touch bar + High Sierra 10.13.3.
The main problem, and I'm not sure if its an issue or not, but nested groups don't update unless you select something lower down in the the group hierarchy first. Is this the intended behaviour? as it seems to work by bubbling up from what was last selected? Or should it actually update everything when you click outside (which is what I thought it was supposed to do).
video here: https://www.dropbox.com/s/ngla2oojb1eee8a/paddy%20test.mov?dl=0
sketch file here: https://www.dropbox.com/s/a1y9wtn3a7khs5i/paddy%20new%20test.sketch?dl=0
Just wondering if this is a bug or not :)
Thanks!
If you override a symbol's text that has vertical spacing set, I would expect it to push up or down once the text length changes. Below, I have an example of a symbol that has a stacked set of copy. If you change the middle block, it does not push down the third text element when it moves from being one line to many.
When I copy a symbol that works perfectly fine in one file to another the entire Paddy settings no longer apply and the symbol is broken.
Any others come across this?
Have a central spot to host values as variables. This way, if you want to change the value of spacing, you could do it in one spot; rather than tediously changing all occurrences through your document.
For example:
Then using them with the variables, instead of [8 16], it would [small medium]
That way, changing the value of medium to be '20'; simply change it in the centralised place.
In Sketch, when adding text to our artboard we can create either free text layers (by clicking with the text tool), or text boxes (by dragging instead of clicking). The difference between the two types of layers is:
It seems, however, that when we have a text box (with fixed alignment) inside a SYMBOL, Paddy does not respect the set width of the box, and automatically resizes all text boxes HORIZONTALLY to fit the text, as if they were free text layers (with auto alignment). This is not the native behaviour, and gives somewhat confusing results.
To make matters worse, when we add extensive text to a symbol, Paddy seems to resize the symbol arbitrarily. I setup a simple group with 1 background rectangle (with 30px padding), and 1 text box (200px wide). So the entire symbol is supposed to be 260px. I can set it up, and define the symbol without any issues. But when I place the symbol back on the page, it autoresizes it down (because it is autoresizing the text box just wide enough to fit the default text, which is small. If I add a paragraph of text with 2 or 3 lines, it resizes the box to about 410px, and I get 2 lines of text. If I add very extensive text - line, 20 lines - it resizes the box to over 2000px.
Although we can use Paddy's width settings to manually set min/max/default widths, and try to limit this autoresizing, this seems cumbersome, and not what is expected by default.
Basically what the title says. Automatic padding with a shape doesn't work, automatic alignment and spacing either. Only thing that works is with a shape and text layer (a button, for instance). I've attached a sketch file and a video.
Thanks!
Sketch: 48.2
Paddy: 1.0.3
Padding/spacing not automatically applying when clicking outside group. See attached video.
Noticed performance issues when copying and editing symbols. Whenever I would copy and edit symbols, Sketch would freeze for 10 - 15s. Turned off my plugins one by one and noticed that Paddy was causing the issue.
Draw a rectangle
Click anywhere outside to unselect the layer.
Press Cmd + Z for undo.
The rectangle should have been removed as that was the last step.
The rectangle first gets selected, then on a subsequent press of Cmd + Z again, the rectangle is removed.
Can someone else also verify? I noticed this bug today - it was there before the Sketch v49 update also.
I can say that this happens only if I have Paddy plugin enabled. I have checked by removing all others.
Thanks,
Sankalp
Because your padding recalculates everything, it's causing lines/strokes/shape edges to become blurry on resize. I believe this could be remedied by being super anal about maintaining everything on whole pixels, but this would be amazing. I'd just round to the nearest.
Previously I've been using an Alignment Fixed text layer within buttons and the Resize settings set to scale with the button so that on resize in layout it's easy to set button width by detecting at which point the text wraps. i.e. the Fixed alignment combined with Resize rules helps maintain padding when a user doesn't have the plugin.
After the update the button symbol can no longer change width to account for a longer label, only height. Setting the text to Alignment Auto seems to fix this, but then other users without the plugin lose the ability to size accordingly. The previous version seemed to handle this case correctly.
Hey @DWilliames 👋
Thank you very much for this really handy plugin ❤️
But I noticed an issue with ignoring padding for specific edges 🐞
Please take a look at this screencast: https://monosnap.com/file/yxe5a1aA2zkYMHFykytMJr0m7gzLdh 🔍
Source file: https://monosnap.com/file/2DEcKoYR2aChmra8C2xsHshV7BBQOf 💎
macOS 10.12.6 (16G1212)
Sketch 48.2 (47327)
Paddy 1.0
Thanks in advance!
Best!
Ivan
The x
parameter should not impact the padding for edges it is not applied to.
Using the x
to ignore padding on certain edges is causing other padding to not work. For example, I have a button with padding [10 x 11]
for a button with a 40px height on the symbol page. When using the symbol in layout the height changes to 37px. Using an integer instead of x
maintains the button height at 40px. I have also tried [10 x 11 x]
and the same height change happens. You can see in the screenshots that the button appears to be getting cropped on the lower portion.
See above. (Tried to attach Sketch file, but got a "We don't support that file type." error message.
(Please include a screenshot or screen recording if possible)
Unzip, it's a video
paddy bug.zip
(Please attach a Sketch file if possible)
It will happen on a fresh file of sketch 48.2
When duplicating or deleting elements in a auto-spaced and auto-padded group, the spacing update doesn't happen until you click outside the group.
i placed a vertical space between group and it takes time to work. it didn't work directly
Selecting a layer group and then hitting Enter opens the layer group in the layer panel.
Selecting a layer group that includes a layer with padding added and hitting Enter doesn't open the group.
It seems that there is an issue with padding that I've noticed due to my use of Craft.
I noticed that whenever I sync and check the inspect tool in Invision, my overriden button symbols looks something like this:
This is what the structure looks like for the original symbol:
I've noticed that when I sync to Invision the button seems to move and you can briefly see the issue occuring. The symbol has not been detached, just overriden, and is still a symbol after the sync has completed:
In my effort to try and track the issue down, I've noticed that this happens even without trying to use the craft plugin, if I ever detach an overriden button symbol which has paddy applied:
Not sure if the issue is with how I'm setting up the original symbol with "Auto" Alignment, or if any of the other parameters that are set on the text/button background are incorrect, but I wanted to report what was happening in case that this isn't an issue with my workflow.
Otherwise, love this plugin so far! It's been a crazy time saver for keeping consistency across projects.
Thanks!
-Danny
It would be great to give users the option of displaying padding/spacing details within Sketch's right inspector panel. Similar to how 'resizing is displayed'.
Then, optionally, user's could 'turn off' the values in the layer names.
Sometimes it's helpful to view the values within the layers names in the layer list, to quickly glance at. Sometimes, it is unnecessary, and makes it cluttered.
When I used Paddy after I clicked off the artboard or selected another element I get an error box that says "Please select at least one layer to duplicate." with an OK button. If I disable the Paddy plugin everything works fine.
Sketch 48.2
Plugins
Runner
Abstract
Brand.ai
Midnight
Rename It
Sketch Guides
Sketch Measure
Craft
Zeplin
Various sized layer group's Y position was nudged -6px on every 'automatic spacing update' when using the 'middle' expression.
btw, it would be very handy if there is a way to fix the group's position, that way we don't have to manually put it back where it was when rearranging its sub-layers 😄
You are doing an incredibly good job at making a lean and to the point plugin, I have my Anima auto layout uninstalled the first minute I put my hands on this one, Anima is getting way puffier than it should and losing its primary focus. Big thumb up for paddy👍🏻 keep up the good work mate!
macOS 10.13.2 (17C88)
Sketch 48.2 (47327)
"layername[0] [8 4]" or "groupname[1] [8v]" won’t get matched.
Maybe your RegExp should be changed from
/\[(.*)\]/g
(match anything between the first [
and last ]
, which grabs 0] [8 4
and 1] [8v
in my examples, respectively)
to something like
/\[([^]]+)\]$/g
(match only characters between the [
and ]
at the end of the string, which would get 8 4
and 8v
in my examples).
@DWilliames So now when I click on and off the group it still jumps about 1px up or down. I think the reason is that the elements are not using whole numbers for x and y. Each time I click on and off the elements are getting new numbers with decimals. I triple checked to see if it was just the elements starting off on decimals but it's not. Something in the logic is off. Thanks for being so prompt.
When i create a symbol from the group the padding not working when i override the text
Provide an option to select padding / spacing from ones that have been previously applied, when entering from the alert panel.
Perhaps from a drop down list.
For version 1.0.4 it is arbitrarily changing the width of the symbol instances.
For version 1.0.2 (on which I currently am) it does not seem to even apply. Symbol instances are not changing their size according to the set padding.
First, I'm not even using paddy on this symbol or even in this document which is weird.
But I'd like to turn off this warning that occurs when you edit a symbol with 10 or more instances.
Annoying if you're working on existing symbol and you have to click this every time even if you don't make changes. And there is no slow down for me even with 30 symbols
Hey @DWilliames — thanks for this plugin, it's a life-saver!
Do I have any syntax for applying middle + center
? I tried Group [cm]
, Group [c m]
and Group [c, m]
but it doesn't kick in :(
If there's no support for this at moment, it would be nice as an enhancement. We could combine vertical + horizontal alignment strategies. Freaking cool.
Once again, thanks a lot buddy! 🍻
Hi! I have a huge library with buttons, and all of them have "min width" specifications. In this case, the paddings are 15; 24; 17; 24 and width >=100. When I use a short title for my button, such as "Add", the plugin automatically fits the width to 100 px (it's super cool!), but the text field doesn't seem to be aligned to the centre.
same issues as documented here -> https://drive.google.com/file/d/12FF2igRmbjAhoikt-LnYeDcsQrCKGx63/view
(Sketch Version 48.2)
After setting overrides for a symbol; and then removing the overrides, the symbol does not resize to the size of the original text value.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.