Skip to content

to ensure consistency #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

cbbfcd
Copy link

@cbbfcd cbbfcd commented May 2, 2018

Regarding point 4, about the ":not()".
your demo is:

.nav li:not(:last-child) {
  border-right: 1px solid #666;
}

Sure, you can use .nav li + li or even .nav li:first-child ~ li, but with :not() the intent is very clear and the CSS selector defines the border the way a human would describe it.

but, in fact, .nav li + li or even .nav li:first-child ~ li, All indicate selectors other than the first element,
Therefore, in order to avoid readers' misunderstanding, you can change the selector in the demo to:

.nav li:not(:first-child) {
  border-right: 1px solid #666;
}

@AllThingsSmitty
Copy link
Owner

Thanks for the PR. I agree consistency is important and I don't want the reader to get tripped up. Because the scenario is familiar (last element needing something special), I'm more inclined to remove the "or even .nav li:first-child ~ li" from the last paragraph.

@cbbfcd
Copy link
Author

cbbfcd commented May 3, 2018

Thanks for your reply, I very much agree and support your opinion

@cbbfcd
Copy link
Author

cbbfcd commented May 3, 2018

I will launch a new PR and hope to remove this confusing point

@cbbfcd cbbfcd closed this May 3, 2018
@cbbfcd cbbfcd deleted the ht-dev branch May 3, 2018 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants