Skip to content
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

Оптимизация :first-child/:nth-child и т.д. #21

Closed
kizu opened this issue Sep 2, 2011 · 1 comment
Closed

Оптимизация :first-child/:nth-child и т.д. #21

kizu opened this issue Sep 2, 2011 · 1 comment

Comments

@kizu
Copy link

kizu commented Sep 2, 2011

Мелочи, но всё же:

  1. :first-child короче чем :nth-child(1) на один символ.
  2. :last-child короче чем :nth-last-child(1) аж на семь символов.
  3. Аналогично и с …-of-type.

Единственный момент: есть версии браузеров, которые понимают :first-child, но не понимают nth-child.

Ну и представить такое в коде я могу только если например что-то или кто-то автоматически нагенерит стилей с …(1),…(2),…(3) и т.д. и не прооптимизирует соответствующие пункты с единичками.

@afelix
Copy link
Contributor

afelix commented Sep 3, 2011

есть версии браузеров, которые понимают :first-child, но не понимают nth-child.

Потому этого делать нельзя, к сожалению. Любой риск сломать рендеринг является блокером для фичи.

@afelix afelix closed this as completed Sep 3, 2011
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

No branches or pull requests

2 participants