-
Notifications
You must be signed in to change notification settings - Fork 72
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
HTML anchor attribute #836
Comments
I'm a bit confused about this... I guess the idea would be that |
As far as I know, there aren't any other CSS properties which refer to elements by ID, except mask and clip-path which can refer to them with the url syntax which we wouldn't want for this. Would this be easy to do in a way which allows you to refer to either element IDs or anchor-name values? Using an HTML attribute also has the benefits of assigning to element.anchorElement imperatively without an ID and that setting up relationships between elements seems like something that HTML attributes are already well suited for. |
I commented on the spec PR. This still feels a bit of a smell to me but I understand it enables useful things. I think at least we should have a name for this that reflects what it really is (an implicit / fallback thing compared to CSS's anchor-name), to avoid author confusion... But I wonder if @jwatt has different opinions here. |
Just saw this comment, sorry. To avoid having the conversation two places, let’s chat on the spec PR. |
Request for Mozilla Position on an Emerging Web Specification
Other information
The
anchor
attribute allows HTML to hook into CSS Anchor positioning to set an implicit anchor element: https://drafts.csswg.org/css-anchor-position-1/#implicit-anchor-elementBy using the
anchor
attribute, you don't have to use theanchor-name
andanchor-default
CSS properties to set up an anchor positioning relationship.Here is an example without the anchor attribute:
And here is an example of the same thing with the anchor attribute which gets rid of
anchor-name
andanchor-default
:The text was updated successfully, but these errors were encountered: