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

Inheritence between classes has no effect on properties. #18

Open
gck-ableton opened this issue May 19, 2015 · 0 comments
Open

Inheritence between classes has no effect on properties. #18

gck-ableton opened this issue May 19, 2015 · 0 comments

Comments

@gck-ableton
Copy link
Collaborator

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant