nui icon indicating copy to clipboard operation
nui copied to clipboard

Inheritance by stylesheet rules

Open 1am opened this issue 12 years ago • 8 comments

Hi

Just wanted to ask if there is some possibility that a style StyleA:StyleB:StyleC which I define in nss file will be respected on an element with nuiClass = StyleC? Right now i'm setting inheritance by applying nuiClass = StyleA:StyleB:StyleC but it would be great if i could just set niuClass = StyleC and the .nss defined style would inherit form StyleA:StyleB automatically (like it is in css).

Cheers

1am avatar Feb 01 '13 09:02 1am

+1

ZugSpi avatar Apr 06 '13 12:04 ZugSpi

:+1:

Additional thought:

  1. the readme is doesn't explain well where Button:LargeButton belongs in the nuiClass = or in the .nss
  2. I cannot get inheritance to work either way

joelash avatar Nov 14 '13 15:11 joelash

+1 - Imho, at the moment, inheritance is the most important feature missing to NUI.

Altimor avatar Aug 15 '14 19:08 Altimor

+1. To me it's not clear how to specify inheritance in the .nss I tried writing SuperClass:Subclass in the .nss, but it doesn't even get parsed.

vittoriom avatar Nov 05 '14 13:11 vittoriom

I got it to work, by specifying classes as independent in the .nss and then expliciting the inheritance in code.

Example:

H3Item {
    font-name: @primaryFontName;
    font-size: @h3FontSize;
    font-color: @darkGreyColor;
}

/* Subclass of H3Item */
H3Loyalty {
    font-color: @loyaltyBlueColor;
}

And in code:

nuiClass = "H3Item:H3Loyalty"

It would be much better IMHO if the inheritance could be specified in the .nss directly, so that it could be given to designers as well, or in general anyway it would be less error-prone.

vittoriom avatar Nov 05 '14 13:11 vittoriom

+1 any update on this?

gastonmorixe avatar Dec 24 '14 17:12 gastonmorixe

+1

sche avatar Feb 11 '16 19:02 sche

+1 Was very discouraged, when found out, that inheritance only applies to nuiClass and not selectors themself

Emailrus avatar Mar 11 '16 08:03 Emailrus