Skip to content

[css] Allow one special element to be skipped when first child is matched #2798

@mvorisek

Description

@mvorisek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/featAny feature requests or improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions