-
Notifications
You must be signed in to change notification settings - Fork 661
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-images] [css-gcpm] Overloaded definitions of element() #1981
Comments
This name conflict is already filed as issue 6 in CSS Images 4. Sebastian |
So far I see five different (mostly non-exclusive) solutions for this conflict: 1. Define running elements in HTMLInstead of CSS, running elements could be defined within HTML, e.g. via a Doing so would allow to style them without the need for the Example: <running position="top-center">
<h1>My awesome title</h1>
<h2>With a great subtitle</h2>
</running> @page {
@top-center { color: #808080; }
} 2. Rename the
|
I will let WG and editors to decide what is the best way to fix this. Just for the record element() in GCPM spec has been used earlier than in CCS Images and has more shipping implementations already. So it makes more sense to rename it in CSS Images to something like element-snapshot() or whatever. It's good that issue is mentioned in the spec text, I have missed it, I have only searched GitHub issues before filling new one. |
That's correct. The
As far as I can see on MDN and caniuse and my own tests, the only existing implementation of this is in Firefox and that one is prefixed. And that But you're right that also the definition within CSS Images could be renamed. Thinking further about that, I've added a fifth solution, which suggests to merge the syntax of the Sebastian |
MDN/Caniuse are not good sources for checking implementation status of GCPM module. Browsers have poor printing support but GCPM and unprefixed element() function is already implemented in various formatting engines, e.g.: https://www.antennahouse.com/product/ahf64/ahf-css6.html#css3-functions |
Another solution would be to merge
In all these cases the functionality is exactly the same as what's proposed with It seems weird that while I can And what about |
I found this issue after searching for the reasons why as a front-end dev, I can use While searching for those reasons, I discovered |
@faceless2 wrote:
Obviously you only refer to the definition within CSS Images 4, not the one in CSS GCPM 3. That idea sounds intriguing and I really like it, though reusing Sebastian |
@cdoublev wrote:
The extra features come "for free" because Though I just realized another little downside of merging it into Sebastian |
Thanks, I hadn't noticed that I'm not sure that selecting an element via other types of selectors would be an upside. An image value referencing an element will always resolves to a single (~= unique, like an ID) target, while other selectors are more often used to select multiple targets. |
@cdoublev wrote:
You might be surprised that even ID selectors can match multiple elements, see https://jsfiddle.net/SebastianZ/qumshra7/. So the algorithm behind that feature already needs to take that into account and pick the first matched element. The spec. currently mentions this as "The ID is first looked up in the elementSources map". But anyway, I am not completely against reusing Also note that both solutions are non-exclusive. Sebastian |
Hi,
I have noticed that the following two modules define element() function/notation in the completely different way:
https://www.w3.org/TR/css-images-4/#element-notation
https://www.w3.org/TR/css-gcpm-3/#funcdef-element
I see that css-images define element() for use in properties that can reference image whereas css-gcpm currently uses element() for content property. But using same function name for different purposes and with different function arguments is very confusing for CSS authors.
Each function should be named differently or their behaviour should be unified.
Jirka
The text was updated successfully, but these errors were encountered: