Replies: 2 comments
-
|
Both the :not negation pseudo-class and :last-child pseudo class are widely available with the exception of IE in versions older than IE9 and are much more readable in my opinion. Plus, you can keep the existing styling instead of changing margin-bottom to margin-top. If this is something that you want to implement, then I'd recommend: Fiddle: https://jsfiddle.net/j6ugz7ea/ Visually, you'd get the same result, but from a code perspective it is much easier to understand the negation pseudo-selector. Edit - Edit #2 - |
Beta Was this translation helpful? Give feedback.
-
|
I think you're right. In the article it mentions needing to predict the level of nesting, but it was written over 10 years ago, a year before :not. I did a check to make sure the same result is produced and it is so I'm happy. https://jsfiddle.net/f2mxc8zg/3/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, love Pico!!
I notice I find myself using
margin-bottom: 0a few times on the last item of a stack. I propose using the "lobotomized owl selector" to space items more intuitively. It's described in this A List Apart article: https://alistapart.com/article/axiomatic-css-and-lobotomized-owls/Basically, instead of
article > * { margin-bottom: 1rem } /* adds bottom margin to all immediate children */Do this:
article > * + * { margin-top: 1rem } /* adds top margin to all immediate children except the first one */The effect is illustrated here:
Let me know what you think, I'm happy to take care of this, I just wanted to post a discussion thread first like it says in the Contributing doc.
Beta Was this translation helpful? Give feedback.
All reactions