Загрузка видео...

Не удалось загрузить видео

На главную

little trick on how to automate visual alignment

81,208 просмотров • 11 месяцев назад •via X (Twitter)

Комментарии: 23

Фото профиля matt
matt11 месяцев назад

💯 we use this technique throughout our system to maintain balance when showing/hiding decorations. one edge case: optical balance for icons that don't follow the icon grid (like carets), where we apply negative margins for consistent visual weight.

Фото профиля Aaron
Aaron11 месяцев назад

ofc you'd also set a fixed height lol

Фото профиля Anthony
Anthony11 месяцев назад

Love this trick. Been doing this in our design systems as well.

Фото профиля Martin
Martin11 месяцев назад

do the same all the time, only i instead wrap the icon, haha. great tip. this is the correct approach. ✦

Фото профиля Asmit Malakannawar
Asmit Malakannawar11 месяцев назад

Using this same technique in the Noora design system:

Фото профиля Ray Finkle
Ray Finkle11 месяцев назад

Great tip

Фото профиля Daniel D.
Daniel D.11 месяцев назад

@leyeConnect This is magical 👏😂

Фото профиля Moss
Moss11 месяцев назад

cool trick

Фото профиля Jerry
Jerry11 месяцев назад

Adopt me as your apprentice @aaronmahlke lmao 😂 this is really cool.

Фото профиля Wages Of Sin
Wages Of Sin11 месяцев назад

@leyeConnect , you might wanna see this as some sort of "update" or "addendum" to your visual alignment sheet

Фото профиля Jan · HappyDesign
Jan · HappyDesign11 месяцев назад

nice one

Фото профиля Aarón González 
Aarón González 11 месяцев назад

QQ: When doing this in code? Is it ok to wrap the content in a div within the button or we should do it differently?

Фото профиля Aaron
Aaron11 месяцев назад

totally fine to wrap the content in a div or span

Фото профиля Yianni
Yianni11 месяцев назад

Nice tip!!

Фото профиля Nonattributable
Nonattributable11 месяцев назад

What about having a button with 2 elements each having their own padding, wouldn't that make it look balanced? <button> <span style="padding-left: 2px" >x</span> <span style="padding: 2px" >delete</span> </button> Or is the point of the demo something else?

Фото профиля Aaron
Aaron11 месяцев назад

yup can work for sure. but usually icons already have a frame / bounding box that includes some space around the actual icon. which is why it looks of-balance if you don't also add some padding to the text.

Фото профиля Nonattributable
Nonattributable11 месяцев назад

Ah ok that makes sense! Thanks!

Фото профиля Mayor
Mayor11 месяцев назад

Niceee

Фото профиля SHOWROCK
SHOWROCK11 месяцев назад

Aaron gave us a great tip... thank you so much. we want more pls

Фото профиля Florian
Florian11 месяцев назад

that's amazing, yes - I wish more companies would adopt this in their design system

Фото профиля Fabian B.
Fabian B.11 месяцев назад

You can also wrap the icon into a frame that is as wide as the icon minus the space you want to visual align. Nicer if you ask me, since the regular button without icons is not affected + it’s clearer what the intention is (when implementing)

Фото профиля Miqueias | volvix.com.br
Miqueias | volvix.com.br11 месяцев назад

shift + a

Фото профиля Peanut Butter Chocolate
Peanut Butter Chocolate11 месяцев назад

If you’ve ever worked on real stuffs, you’d know devs won’t bother doing all of that custom padding anyway LMFAO

Похожие видео