-
-
Notifications
You must be signed in to change notification settings - Fork 335
[css] Allow one special element to be skipped when first child is matched #2798
Copy link
Copy link
Closed
Labels
type/featAny feature requests or improvementsAny feature requests or improvements
Description
Feature Request
See atk4/ui#1970 for usecase.
Expected result
In some special cases, the first child is some technical element, usually hidden, which should not be matched by :first-child style. The problem is, when :first-child is hardcoded, there is not way for the developer to fix it as long as the technical element needs to be present as the first child.
The solution is simple - https://jsfiddle.net/fg3kcn85/ - replace any X:first-child selector with X:first-child, .ignore-first:first-child + X where ignore-first is a class name, that will tell the browser to select the "2nd element as if it was 1st".
In very simillar way atk4/ui#1928 (comment) can be fixed, ie. fix selectors like A > B to A > B, A > .ignore-wrap > B.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/featAny feature requests or improvementsAny feature requests or improvements