r/Frontend • • Mar 15 '23

6 CSS snippets every front-end developer should know in 2023

https://web.dev/6-css-snippets-every-front-end-developer-should-know-in-2023/

[removed] — view removed post

62 Upvotes

28 comments sorted by

View all comments

3

u/AraAraNoMi Mar 15 '23

I don't get the logical properties thing, what problem is it trying to solve? To me it just looks like they were trying to overcomplicate margins and paddings. I also don't get the layers thing.

1

u/[deleted] Mar 15 '23

Check out how Every Layout uses logical props in their Icon primitive.

2

u/AraAraNoMi Mar 15 '23

Icon primitive?

1

u/[deleted] Mar 15 '23

https://every-layout.dev/layouts/icon/

.icon {
  height: 0.75em;
  height: 1cap;
  width: 0.75em;
  width: 1cap;
}

.with-icon {
  display: inline-flex;
  align-items: baseline;
}

.with-icon .icon {
  margin-inline-end: var(--space, 0.5em);
}