Last active
November 28, 2018 16:16
-
-
Save AllThingsSmitty/208f88399960b0b22241 to your computer and use it in GitHub Desktop.
Use CSS :not() instead of applying and unapplying borders on navigations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.nav-tab { | |
... | |
// instead of putting it on | |
border-right: 1px solid #424242; | |
&:last-child { | |
border-right: 0; // and then taking it off | |
} | |
// use CSS not() to only apply to the elements you want | |
&:not(:last-child) { | |
border-right: 1px solid #424242; | |
} | |
... | |
} |
+1 Cool! Didn't know this one! =)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@AllThingsSmitty This is great. Thanks for the tip!