Skip to content

Inheritence between classes has no effect on properties. #18

@gck-ableton

Description

@gck-ableton

Selectors matching on a base class are not matched by subclasses.

For example:

// in: TitleBar.qml
Item {
  property color color: root.StyleSet.props.color("color")
}

// in: HorizontalTitleBar.qml
TitleBar {
  // ... things
}

// in: styles.css
TitleBar {
  color: "white";
}

HorizontalTitleBar {
//  color: "green";
}

When using HorizontalTitleBar the color property (from the TitleBar selector) is not matched.

To achieve this the rule matcher has not only to match rules for the class' type proper but also for it's super classes. This should be fairly trivial to do, but needs some thoughts on specificity. E.g. for a class setup like

C is-a B is-a A
Z is-a Y is-a X

which rule is more specific:

A Z { }
B Y { }
C X { }

One possible solution is to give all of them the same specificity and let the css-writer resolve ambiguities in the normal way (order, classnames, etc.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions