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

how to handle inheritance #1

Open
KIC opened this issue Jan 18, 2017 · 1 comment
Open

how to handle inheritance #1

KIC opened this issue Jan 18, 2017 · 1 comment

Comments

@KIC
Copy link

KIC commented Jan 18, 2017

This is really cool, I always wanted to have styling options of js objects to actually be part of the css. Terefore I am playing a little bit around with this idea. But how could we handle inheritance?

i.e. css

div.someclass {
    --test-test-test: 12;
    --test-test-test-2: "dsas";
    content:'{"test-test-test":"12", "test-test-test-2":"das"}';
}

#x {
    --test-test-test-3: "drei";
    content:'{"test-test-test-3":"drei"}';
}

and html

<div class="someclass">
<div id="x" class="someclass">

while var data = CustomProps.data($("div.someclass")); gives us the expected two properties, var data = CustomProps.data($("x")); does not give us all expected three properties.

@KIC
Copy link
Author

KIC commented Jan 29, 2017

Actually I switched from custom-props.js to http://www.brothercake.com/site/resources/scripts/cssutilities/config/#usage where one get all slectors in the correct priority. Now we just loop and do jQuery#extend on each level to merge the properties.

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

No branches or pull requests

1 participant