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

[css-properties-values-api] Example 2: should explain more clearly why inherit instead of green in description #152

Closed
Marat-Tanalin opened this issue May 28, 2016 · 5 comments

Comments

@Marat-Tanalin
Copy link

Marat-Tanalin commented May 28, 2016

The example 2 of CSS Properties and Values API Level 1 draft contains the following code:

.thing {
    --my-color: green;
    --my-color: url("not-a-color");
    color: var(--my-color);
}

But then description says that the color property is set to inherit instead of green. So either this is a typo, and inherit in the description should be replaced with the correct green used in the code, or the description should be more clear on why the property is set to inherit instead of green.

@Marat-Tanalin Marat-Tanalin changed the title [css-properties-values-api] Example 2: inherit instead of green in description [css-properties-values-api] Example 2: wrong inherit instead of green in description May 28, 2016
@FremyCompany
Copy link
Contributor

This is accurate. --my-color has no type, so its value becomes url("...").
As a result, color becomes url("...") which is invalid at computation time, so color reverts to its initial value, which is inherit.

@FremyCompany
Copy link
Contributor

FremyCompany commented May 28, 2016

I just had a read, and this is exactly what the spec says. Not sure what you think was not clear.

Closing the issue but pinging @tabatkins just for the sake of it, maybe he can improve the wording a bit. Why not something like:

At this stage of the css pipeline (computation time), the only available fallback is the initial value of the property, which in the case of "color" is "inherit".

@Marat-Tanalin
Copy link
Author

Thanks, François. After your explanation, the example and its description are more clear. The description in the draft could probably be updated with a more clear text like in your first comment.

@shans shans reopened this May 29, 2016
@shans shans changed the title [css-properties-values-api] Example 2: wrong inherit instead of green in description [css-properties-values-api] Example 2: should explain more clearly why inherit instead of green in description May 29, 2016
@shans
Copy link
Contributor

shans commented May 29, 2016

I've reopened with an updated description so we can improve the prose here.

Hmm, this should probably be filed in the Houdini repository.

@shans
Copy link
Contributor

shans commented May 29, 2016

@shans shans closed this as completed May 29, 2016
birtles added a commit to birtles/csswg-drafts that referenced this issue Dec 4, 2017
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

3 participants