-
Notifications
You must be signed in to change notification settings - Fork 688
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-color-4] backgroundColor #364
Comments
I guess for consistency and clarity it should be Sebastian |
I don't care all that stongly what it's called: |
FWIW, your example actually doesn't match what you were expecting, because I doubt its usefulness. Is there any other usecase? In this example, things would not work if the background underneath is an image, or even a gradient. And this simple usecase can easily be achieved via a common variable. This very limited usecase doesn't look very convincing to me. Also given that you made this mistake when you wrote the example (I'm not blaming you, but), I suspect this setting isn't as intuitive as it looks like, which would also be a problem. |
and
I did explicitly set the |
Uses of |
Given that we now have |
And |
.ghost-text {
text-shadow: 0 0 3px black;
color: backgroundColor;
} |
This example makes me more worry about the complexity of adding it... |
Given Xidorn's reasoning in comment #4*, I'm inclined to agree with ~fantasai
|
When you write #<some number>, github autolinks to the issue with that number, no the comment. |
Which comment is that? This one #364 (comment) where he says it can be done with variables? I agree that technically it can be. However, in the case I'm working on, this wouldn't be practical. On a large project, the people responsible for content and the people responsible for UX/UI/Design are often not the same. The kind of shadow effect I was setting up falls under the UX side of things. On the other hand, setting the background of something might be done by UX people, but just as often it might also be done on a semi ad-hoc manner by people in charge of the content. If the two cannot coordinate, or if the content was written first, and the UX people are trying to deal with it, they cannot retroactively replace colors that have been hardcoded into the content with variables which they can then reuse. Concretely, what I am trying to do is to write an additional stylesheet for W3C documents (old and new), and use the shadow effect demoed here on a variety of potentially overflowing elements. But all sorts of specs have all sorts of custom background colors for various elements (notes, examples, warnings, various kinds of notices, IDL declarations, blockquotes, syntax highligthed code samples, non highlighted code samples, grammar definitions...), some shared across most of TR, many not. I cannot retroactively change these into variables, partly because the specs are frozen, partly because there's so many of them. This is what I ran into, but this is by no means unique to TR. If you were writing a theme for a blogging engine, you'd run into the same issue. Same thing If you were restyling MSDN or MDN or any large collection of documents. In theory, you could use variables instead of the |
I agree that your both usecases are valid, but I don't think using
So it's neither simple nor useful enough. I guess we may need some other new mechanism to address the usecases, but I have no idea what that would look like. |
I agree with the naysayers here:
I get that "just use variables" doesn't work very well if you're trying to do a hands-off refactor over the top of some existing styles, but that's not something we usually optimize for in CSS. |
Alright, I am sad that y'all don't like my problem, and I still think it would be cool, but fine, I'll accept that the implementation difficulty and design compromises are bad enough, and the use cases small enough, that this isn't going to work out. Begrudgingly closing. |
Just as we have
currentColor
, havingbackgroundColor
(orbackground-color
) would be useful when you're doing effects that depend on the background color, but you don't know what it is (for example when the background color changes in various parts of the document).Here's an example which could be solved by having that keyword:
http://jsbin.com/detezeb/edit?css,output
The definition, which would parallel that of
currentColor
, would be something like:The text was updated successfully, but these errors were encountered: